text: """Client for the Wikipedia REST API, version 1."""
  # Standard
  from dataclasses import dataclass
  
  # Third-Party
  import click
  import desert
  import marshmallow
  import requests
  
  # Definitions
  API_URL: str = "https://{language}.wikipedia.org/api/rest_v1/page/random/summary"
  
  
  @dataclass
  class Page:
      """Page Resource.
  
      Attributes:
          title: The title of Wikipedia Page.
          extract: A plain text summary.
      """
  
      title: str
      extract: str
  
  
  schema = desert.schema(Page, meta={"unknown": marshmallow.EXCLUDE})
  
  
  def random_page(language: str = "en") -> Page:
      """Return a random page.
  
      Performs a GET request to the /page/random/summary endpoint.
  
      Args:
          language: The Wikipedia language edition. By default, english ("en") used
  
      Returns:
          A page resource.
  
      Raises:
          ClickException: The HTTP request failed or the HTTP Response contained an invalid body.
  
      Example:
          >>> from hypermodern_python import wikipedia
          >>> page = wikipedia.random_page(language="en")
          >>> bool(page.title)
          True
      """
      url = API_URL.format(language=language)
  
      try:
          with requests.get(url) as response:
              response.raise_for_status()
              data = response.json()
              return schema.load(data)
      except (requests.RequestException, marshmallow.ValidationError) as error:
          message = str(error)
          raise click.ClickException(message)
  