{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.APIGateway.Types.RestApi
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.APIGateway.Types.RestApi where

import Amazonka.APIGateway.Types.ApiKeySourceType
import Amazonka.APIGateway.Types.EndpointConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Represents a REST API.
--
-- /See:/ 'newRestApi' smart constructor.
data RestApi = RestApi'
  { -- | The source of the API key for metering requests according to a usage
    -- plan. Valid values are: >@HEADER@ to read the API key from the
    -- @X-API-Key@ header of a request. @AUTHORIZER@ to read the API key from
    -- the @UsageIdentifierKey@ from a custom authorizer.
    RestApi -> Maybe ApiKeySourceType
apiKeySource :: Prelude.Maybe ApiKeySourceType,
    -- | The list of binary media types supported by the RestApi. By default, the
    -- RestApi supports only UTF-8-encoded text payloads.
    RestApi -> Maybe [Text]
binaryMediaTypes :: Prelude.Maybe [Prelude.Text],
    -- | The timestamp when the API was created.
    RestApi -> Maybe POSIX
createdDate :: Prelude.Maybe Data.POSIX,
    -- | The API\'s description.
    RestApi -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether clients can invoke your API by using the default
    -- @execute-api@ endpoint. By default, clients can invoke your API with the
    -- default @https:\/\/{api_id}.execute-api.{region}.amazonaws.com@
    -- endpoint. To require that clients use a custom domain name to invoke
    -- your API, disable the default endpoint.
    RestApi -> Maybe Bool
disableExecuteApiEndpoint :: Prelude.Maybe Prelude.Bool,
    -- | The endpoint configuration of this RestApi showing the endpoint types of
    -- the API.
    RestApi -> Maybe EndpointConfiguration
endpointConfiguration :: Prelude.Maybe EndpointConfiguration,
    -- | The API\'s identifier. This identifier is unique across all of your APIs
    -- in API Gateway.
    RestApi -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | A nullable integer that is used to enable compression (with non-negative
    -- between 0 and 10485760 (10M) bytes, inclusive) or disable compression
    -- (with a null value) on an API. When compression is enabled, compression
    -- or decompression is not applied on the payload if the payload size is
    -- smaller than this value. Setting it to zero allows compression for any
    -- payload size.
    RestApi -> Maybe Int
minimumCompressionSize :: Prelude.Maybe Prelude.Int,
    -- | The API\'s name.
    RestApi -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A stringified JSON policy document that applies to this RestApi
    -- regardless of the caller and Method configuration.
    RestApi -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
    -- | The collection of tags. Each tag element is associated with a given
    -- resource.
    RestApi -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A version identifier for the API.
    RestApi -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The warning messages reported when @failonwarnings@ is turned on during
    -- API import.
    RestApi -> Maybe [Text]
warnings :: Prelude.Maybe [Prelude.Text]
  }
  deriving (RestApi -> RestApi -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestApi -> RestApi -> Bool
$c/= :: RestApi -> RestApi -> Bool
== :: RestApi -> RestApi -> Bool
$c== :: RestApi -> RestApi -> Bool
Prelude.Eq, ReadPrec [RestApi]
ReadPrec RestApi
Int -> ReadS RestApi
ReadS [RestApi]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestApi]
$creadListPrec :: ReadPrec [RestApi]
readPrec :: ReadPrec RestApi
$creadPrec :: ReadPrec RestApi
readList :: ReadS [RestApi]
$creadList :: ReadS [RestApi]
readsPrec :: Int -> ReadS RestApi
$creadsPrec :: Int -> ReadS RestApi
Prelude.Read, Int -> RestApi -> ShowS
[RestApi] -> ShowS
RestApi -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestApi] -> ShowS
$cshowList :: [RestApi] -> ShowS
show :: RestApi -> String
$cshow :: RestApi -> String
showsPrec :: Int -> RestApi -> ShowS
$cshowsPrec :: Int -> RestApi -> ShowS
Prelude.Show, forall x. Rep RestApi x -> RestApi
forall x. RestApi -> Rep RestApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RestApi x -> RestApi
$cfrom :: forall x. RestApi -> Rep RestApi x
Prelude.Generic)

-- |
-- Create a value of 'RestApi' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'apiKeySource', 'restApi_apiKeySource' - The source of the API key for metering requests according to a usage
-- plan. Valid values are: >@HEADER@ to read the API key from the
-- @X-API-Key@ header of a request. @AUTHORIZER@ to read the API key from
-- the @UsageIdentifierKey@ from a custom authorizer.
--
-- 'binaryMediaTypes', 'restApi_binaryMediaTypes' - The list of binary media types supported by the RestApi. By default, the
-- RestApi supports only UTF-8-encoded text payloads.
--
-- 'createdDate', 'restApi_createdDate' - The timestamp when the API was created.
--
-- 'description', 'restApi_description' - The API\'s description.
--
-- 'disableExecuteApiEndpoint', 'restApi_disableExecuteApiEndpoint' - Specifies whether clients can invoke your API by using the default
-- @execute-api@ endpoint. By default, clients can invoke your API with the
-- default @https:\/\/{api_id}.execute-api.{region}.amazonaws.com@
-- endpoint. To require that clients use a custom domain name to invoke
-- your API, disable the default endpoint.
--
-- 'endpointConfiguration', 'restApi_endpointConfiguration' - The endpoint configuration of this RestApi showing the endpoint types of
-- the API.
--
-- 'id', 'restApi_id' - The API\'s identifier. This identifier is unique across all of your APIs
-- in API Gateway.
--
-- 'minimumCompressionSize', 'restApi_minimumCompressionSize' - A nullable integer that is used to enable compression (with non-negative
-- between 0 and 10485760 (10M) bytes, inclusive) or disable compression
-- (with a null value) on an API. When compression is enabled, compression
-- or decompression is not applied on the payload if the payload size is
-- smaller than this value. Setting it to zero allows compression for any
-- payload size.
--
-- 'name', 'restApi_name' - The API\'s name.
--
-- 'policy', 'restApi_policy' - A stringified JSON policy document that applies to this RestApi
-- regardless of the caller and Method configuration.
--
-- 'tags', 'restApi_tags' - The collection of tags. Each tag element is associated with a given
-- resource.
--
-- 'version', 'restApi_version' - A version identifier for the API.
--
-- 'warnings', 'restApi_warnings' - The warning messages reported when @failonwarnings@ is turned on during
-- API import.
newRestApi ::
  RestApi
newRestApi :: RestApi
newRestApi =
  RestApi'
    { $sel:apiKeySource:RestApi' :: Maybe ApiKeySourceType
apiKeySource = forall a. Maybe a
Prelude.Nothing,
      $sel:binaryMediaTypes:RestApi' :: Maybe [Text]
binaryMediaTypes = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:RestApi' :: Maybe POSIX
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:RestApi' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:disableExecuteApiEndpoint:RestApi' :: Maybe Bool
disableExecuteApiEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointConfiguration:RestApi' :: Maybe EndpointConfiguration
endpointConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:id:RestApi' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:minimumCompressionSize:RestApi' :: Maybe Int
minimumCompressionSize = forall a. Maybe a
Prelude.Nothing,
      $sel:name:RestApi' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:policy:RestApi' :: Maybe Text
policy = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:RestApi' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:version:RestApi' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:RestApi' :: Maybe [Text]
warnings = forall a. Maybe a
Prelude.Nothing
    }

-- | The source of the API key for metering requests according to a usage
-- plan. Valid values are: >@HEADER@ to read the API key from the
-- @X-API-Key@ header of a request. @AUTHORIZER@ to read the API key from
-- the @UsageIdentifierKey@ from a custom authorizer.
restApi_apiKeySource :: Lens.Lens' RestApi (Prelude.Maybe ApiKeySourceType)
restApi_apiKeySource :: Lens' RestApi (Maybe ApiKeySourceType)
restApi_apiKeySource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe ApiKeySourceType
apiKeySource :: Maybe ApiKeySourceType
$sel:apiKeySource:RestApi' :: RestApi -> Maybe ApiKeySourceType
apiKeySource} -> Maybe ApiKeySourceType
apiKeySource) (\s :: RestApi
s@RestApi' {} Maybe ApiKeySourceType
a -> RestApi
s {$sel:apiKeySource:RestApi' :: Maybe ApiKeySourceType
apiKeySource = Maybe ApiKeySourceType
a} :: RestApi)

-- | The list of binary media types supported by the RestApi. By default, the
-- RestApi supports only UTF-8-encoded text payloads.
restApi_binaryMediaTypes :: Lens.Lens' RestApi (Prelude.Maybe [Prelude.Text])
restApi_binaryMediaTypes :: Lens' RestApi (Maybe [Text])
restApi_binaryMediaTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe [Text]
binaryMediaTypes :: Maybe [Text]
$sel:binaryMediaTypes:RestApi' :: RestApi -> Maybe [Text]
binaryMediaTypes} -> Maybe [Text]
binaryMediaTypes) (\s :: RestApi
s@RestApi' {} Maybe [Text]
a -> RestApi
s {$sel:binaryMediaTypes:RestApi' :: Maybe [Text]
binaryMediaTypes = Maybe [Text]
a} :: RestApi) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The timestamp when the API was created.
restApi_createdDate :: Lens.Lens' RestApi (Prelude.Maybe Prelude.UTCTime)
restApi_createdDate :: Lens' RestApi (Maybe UTCTime)
restApi_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:RestApi' :: RestApi -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: RestApi
s@RestApi' {} Maybe POSIX
a -> RestApi
s {$sel:createdDate:RestApi' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: RestApi) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The API\'s description.
restApi_description :: Lens.Lens' RestApi (Prelude.Maybe Prelude.Text)
restApi_description :: Lens' RestApi (Maybe Text)
restApi_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe Text
description :: Maybe Text
$sel:description:RestApi' :: RestApi -> Maybe Text
description} -> Maybe Text
description) (\s :: RestApi
s@RestApi' {} Maybe Text
a -> RestApi
s {$sel:description:RestApi' :: Maybe Text
description = Maybe Text
a} :: RestApi)

-- | Specifies whether clients can invoke your API by using the default
-- @execute-api@ endpoint. By default, clients can invoke your API with the
-- default @https:\/\/{api_id}.execute-api.{region}.amazonaws.com@
-- endpoint. To require that clients use a custom domain name to invoke
-- your API, disable the default endpoint.
restApi_disableExecuteApiEndpoint :: Lens.Lens' RestApi (Prelude.Maybe Prelude.Bool)
restApi_disableExecuteApiEndpoint :: Lens' RestApi (Maybe Bool)
restApi_disableExecuteApiEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe Bool
disableExecuteApiEndpoint :: Maybe Bool
$sel:disableExecuteApiEndpoint:RestApi' :: RestApi -> Maybe Bool
disableExecuteApiEndpoint} -> Maybe Bool
disableExecuteApiEndpoint) (\s :: RestApi
s@RestApi' {} Maybe Bool
a -> RestApi
s {$sel:disableExecuteApiEndpoint:RestApi' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
a} :: RestApi)

-- | The endpoint configuration of this RestApi showing the endpoint types of
-- the API.
restApi_endpointConfiguration :: Lens.Lens' RestApi (Prelude.Maybe EndpointConfiguration)
restApi_endpointConfiguration :: Lens' RestApi (Maybe EndpointConfiguration)
restApi_endpointConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe EndpointConfiguration
endpointConfiguration :: Maybe EndpointConfiguration
$sel:endpointConfiguration:RestApi' :: RestApi -> Maybe EndpointConfiguration
endpointConfiguration} -> Maybe EndpointConfiguration
endpointConfiguration) (\s :: RestApi
s@RestApi' {} Maybe EndpointConfiguration
a -> RestApi
s {$sel:endpointConfiguration:RestApi' :: Maybe EndpointConfiguration
endpointConfiguration = Maybe EndpointConfiguration
a} :: RestApi)

-- | The API\'s identifier. This identifier is unique across all of your APIs
-- in API Gateway.
restApi_id :: Lens.Lens' RestApi (Prelude.Maybe Prelude.Text)
restApi_id :: Lens' RestApi (Maybe Text)
restApi_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe Text
id :: Maybe Text
$sel:id:RestApi' :: RestApi -> Maybe Text
id} -> Maybe Text
id) (\s :: RestApi
s@RestApi' {} Maybe Text
a -> RestApi
s {$sel:id:RestApi' :: Maybe Text
id = Maybe Text
a} :: RestApi)

-- | A nullable integer that is used to enable compression (with non-negative
-- between 0 and 10485760 (10M) bytes, inclusive) or disable compression
-- (with a null value) on an API. When compression is enabled, compression
-- or decompression is not applied on the payload if the payload size is
-- smaller than this value. Setting it to zero allows compression for any
-- payload size.
restApi_minimumCompressionSize :: Lens.Lens' RestApi (Prelude.Maybe Prelude.Int)
restApi_minimumCompressionSize :: Lens' RestApi (Maybe Int)
restApi_minimumCompressionSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe Int
minimumCompressionSize :: Maybe Int
$sel:minimumCompressionSize:RestApi' :: RestApi -> Maybe Int
minimumCompressionSize} -> Maybe Int
minimumCompressionSize) (\s :: RestApi
s@RestApi' {} Maybe Int
a -> RestApi
s {$sel:minimumCompressionSize:RestApi' :: Maybe Int
minimumCompressionSize = Maybe Int
a} :: RestApi)

-- | The API\'s name.
restApi_name :: Lens.Lens' RestApi (Prelude.Maybe Prelude.Text)
restApi_name :: Lens' RestApi (Maybe Text)
restApi_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe Text
name :: Maybe Text
$sel:name:RestApi' :: RestApi -> Maybe Text
name} -> Maybe Text
name) (\s :: RestApi
s@RestApi' {} Maybe Text
a -> RestApi
s {$sel:name:RestApi' :: Maybe Text
name = Maybe Text
a} :: RestApi)

-- | A stringified JSON policy document that applies to this RestApi
-- regardless of the caller and Method configuration.
restApi_policy :: Lens.Lens' RestApi (Prelude.Maybe Prelude.Text)
restApi_policy :: Lens' RestApi (Maybe Text)
restApi_policy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe Text
policy :: Maybe Text
$sel:policy:RestApi' :: RestApi -> Maybe Text
policy} -> Maybe Text
policy) (\s :: RestApi
s@RestApi' {} Maybe Text
a -> RestApi
s {$sel:policy:RestApi' :: Maybe Text
policy = Maybe Text
a} :: RestApi)

-- | The collection of tags. Each tag element is associated with a given
-- resource.
restApi_tags :: Lens.Lens' RestApi (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
restApi_tags :: Lens' RestApi (Maybe (HashMap Text Text))
restApi_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:RestApi' :: RestApi -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: RestApi
s@RestApi' {} Maybe (HashMap Text Text)
a -> RestApi
s {$sel:tags:RestApi' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: RestApi) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A version identifier for the API.
restApi_version :: Lens.Lens' RestApi (Prelude.Maybe Prelude.Text)
restApi_version :: Lens' RestApi (Maybe Text)
restApi_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe Text
version :: Maybe Text
$sel:version:RestApi' :: RestApi -> Maybe Text
version} -> Maybe Text
version) (\s :: RestApi
s@RestApi' {} Maybe Text
a -> RestApi
s {$sel:version:RestApi' :: Maybe Text
version = Maybe Text
a} :: RestApi)

-- | The warning messages reported when @failonwarnings@ is turned on during
-- API import.
restApi_warnings :: Lens.Lens' RestApi (Prelude.Maybe [Prelude.Text])
restApi_warnings :: Lens' RestApi (Maybe [Text])
restApi_warnings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestApi' {Maybe [Text]
warnings :: Maybe [Text]
$sel:warnings:RestApi' :: RestApi -> Maybe [Text]
warnings} -> Maybe [Text]
warnings) (\s :: RestApi
s@RestApi' {} Maybe [Text]
a -> RestApi
s {$sel:warnings:RestApi' :: Maybe [Text]
warnings = Maybe [Text]
a} :: RestApi) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON RestApi where
  parseJSON :: Value -> Parser RestApi
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RestApi"
      ( \Object
x ->
          Maybe ApiKeySourceType
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe EndpointConfiguration
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe [Text]
-> RestApi
RestApi'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"apiKeySource")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"binaryMediaTypes"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"disableExecuteApiEndpoint")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"endpointConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"minimumCompressionSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"policy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"version")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"warnings" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable RestApi where
  hashWithSalt :: Int -> RestApi -> Int
hashWithSalt Int
_salt RestApi' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe ApiKeySourceType
Maybe EndpointConfiguration
warnings :: Maybe [Text]
version :: Maybe Text
tags :: Maybe (HashMap Text Text)
policy :: Maybe Text
name :: Maybe Text
minimumCompressionSize :: Maybe Int
id :: Maybe Text
endpointConfiguration :: Maybe EndpointConfiguration
disableExecuteApiEndpoint :: Maybe Bool
description :: Maybe Text
createdDate :: Maybe POSIX
binaryMediaTypes :: Maybe [Text]
apiKeySource :: Maybe ApiKeySourceType
$sel:warnings:RestApi' :: RestApi -> Maybe [Text]
$sel:version:RestApi' :: RestApi -> Maybe Text
$sel:tags:RestApi' :: RestApi -> Maybe (HashMap Text Text)
$sel:policy:RestApi' :: RestApi -> Maybe Text
$sel:name:RestApi' :: RestApi -> Maybe Text
$sel:minimumCompressionSize:RestApi' :: RestApi -> Maybe Int
$sel:id:RestApi' :: RestApi -> Maybe Text
$sel:endpointConfiguration:RestApi' :: RestApi -> Maybe EndpointConfiguration
$sel:disableExecuteApiEndpoint:RestApi' :: RestApi -> Maybe Bool
$sel:description:RestApi' :: RestApi -> Maybe Text
$sel:createdDate:RestApi' :: RestApi -> Maybe POSIX
$sel:binaryMediaTypes:RestApi' :: RestApi -> Maybe [Text]
$sel:apiKeySource:RestApi' :: RestApi -> Maybe ApiKeySourceType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApiKeySourceType
apiKeySource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
binaryMediaTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableExecuteApiEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointConfiguration
endpointConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
minimumCompressionSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
warnings

instance Prelude.NFData RestApi where
  rnf :: RestApi -> ()
rnf RestApi' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe ApiKeySourceType
Maybe EndpointConfiguration
warnings :: Maybe [Text]
version :: Maybe Text
tags :: Maybe (HashMap Text Text)
policy :: Maybe Text
name :: Maybe Text
minimumCompressionSize :: Maybe Int
id :: Maybe Text
endpointConfiguration :: Maybe EndpointConfiguration
disableExecuteApiEndpoint :: Maybe Bool
description :: Maybe Text
createdDate :: Maybe POSIX
binaryMediaTypes :: Maybe [Text]
apiKeySource :: Maybe ApiKeySourceType
$sel:warnings:RestApi' :: RestApi -> Maybe [Text]
$sel:version:RestApi' :: RestApi -> Maybe Text
$sel:tags:RestApi' :: RestApi -> Maybe (HashMap Text Text)
$sel:policy:RestApi' :: RestApi -> Maybe Text
$sel:name:RestApi' :: RestApi -> Maybe Text
$sel:minimumCompressionSize:RestApi' :: RestApi -> Maybe Int
$sel:id:RestApi' :: RestApi -> Maybe Text
$sel:endpointConfiguration:RestApi' :: RestApi -> Maybe EndpointConfiguration
$sel:disableExecuteApiEndpoint:RestApi' :: RestApi -> Maybe Bool
$sel:description:RestApi' :: RestApi -> Maybe Text
$sel:createdDate:RestApi' :: RestApi -> Maybe POSIX
$sel:binaryMediaTypes:RestApi' :: RestApi -> Maybe [Text]
$sel:apiKeySource:RestApi' :: RestApi -> Maybe ApiKeySourceType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ApiKeySourceType
apiKeySource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
binaryMediaTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableExecuteApiEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointConfiguration
endpointConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
minimumCompressionSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
warnings