{-# 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.SecurityHub.Types.AwsApiGatewayRestApiDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsApiGatewayRestApiDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsApiGatewayEndpointConfiguration

-- | Contains information about a REST API in version 1 of Amazon API
-- Gateway.
--
-- /See:/ 'newAwsApiGatewayRestApiDetails' smart constructor.
data AwsApiGatewayRestApiDetails = AwsApiGatewayRestApiDetails'
  { -- | The minimum size in bytes of a payload before compression is enabled.
    --
    -- If @null@, then compression is disabled.
    --
    -- If 0, then all payloads are compressed.
    AwsApiGatewayRestApiDetails -> Maybe Int
minimumCompressionSize :: Prelude.Maybe Prelude.Int,
    -- | The list of binary media types supported by the REST API.
    AwsApiGatewayRestApiDetails -> Maybe [Text]
binaryMediaTypes :: Prelude.Maybe [Prelude.Text],
    -- | Indicates when the API was created.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsApiGatewayRestApiDetails -> Maybe Text
createdDate :: Prelude.Maybe Prelude.Text,
    -- | The name of the REST API.
    AwsApiGatewayRestApiDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The source of the API key for metering requests according to a usage
    -- plan.
    --
    -- @HEADER@ indicates whether to read the API key from the X-API-Key header
    -- of a request.
    --
    -- @AUTHORIZER@ indicates whether to read the API key from the
    -- @UsageIdentifierKey@ from a custom authorizer.
    AwsApiGatewayRestApiDetails -> Maybe Text
apiKeySource :: Prelude.Maybe Prelude.Text,
    -- | The version identifier for the REST API.
    AwsApiGatewayRestApiDetails -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the REST API.
    AwsApiGatewayRestApiDetails -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The endpoint configuration of the REST API.
    AwsApiGatewayRestApiDetails
-> Maybe AwsApiGatewayEndpointConfiguration
endpointConfiguration :: Prelude.Maybe AwsApiGatewayEndpointConfiguration,
    -- | A description of the REST API.
    AwsApiGatewayRestApiDetails -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsApiGatewayRestApiDetails -> AwsApiGatewayRestApiDetails -> Bool
(AwsApiGatewayRestApiDetails
 -> AwsApiGatewayRestApiDetails -> Bool)
-> (AwsApiGatewayRestApiDetails
    -> AwsApiGatewayRestApiDetails -> Bool)
-> Eq AwsApiGatewayRestApiDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsApiGatewayRestApiDetails -> AwsApiGatewayRestApiDetails -> Bool
$c/= :: AwsApiGatewayRestApiDetails -> AwsApiGatewayRestApiDetails -> Bool
== :: AwsApiGatewayRestApiDetails -> AwsApiGatewayRestApiDetails -> Bool
$c== :: AwsApiGatewayRestApiDetails -> AwsApiGatewayRestApiDetails -> Bool
Prelude.Eq, ReadPrec [AwsApiGatewayRestApiDetails]
ReadPrec AwsApiGatewayRestApiDetails
Int -> ReadS AwsApiGatewayRestApiDetails
ReadS [AwsApiGatewayRestApiDetails]
(Int -> ReadS AwsApiGatewayRestApiDetails)
-> ReadS [AwsApiGatewayRestApiDetails]
-> ReadPrec AwsApiGatewayRestApiDetails
-> ReadPrec [AwsApiGatewayRestApiDetails]
-> Read AwsApiGatewayRestApiDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsApiGatewayRestApiDetails]
$creadListPrec :: ReadPrec [AwsApiGatewayRestApiDetails]
readPrec :: ReadPrec AwsApiGatewayRestApiDetails
$creadPrec :: ReadPrec AwsApiGatewayRestApiDetails
readList :: ReadS [AwsApiGatewayRestApiDetails]
$creadList :: ReadS [AwsApiGatewayRestApiDetails]
readsPrec :: Int -> ReadS AwsApiGatewayRestApiDetails
$creadsPrec :: Int -> ReadS AwsApiGatewayRestApiDetails
Prelude.Read, Int -> AwsApiGatewayRestApiDetails -> ShowS
[AwsApiGatewayRestApiDetails] -> ShowS
AwsApiGatewayRestApiDetails -> String
(Int -> AwsApiGatewayRestApiDetails -> ShowS)
-> (AwsApiGatewayRestApiDetails -> String)
-> ([AwsApiGatewayRestApiDetails] -> ShowS)
-> Show AwsApiGatewayRestApiDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsApiGatewayRestApiDetails] -> ShowS
$cshowList :: [AwsApiGatewayRestApiDetails] -> ShowS
show :: AwsApiGatewayRestApiDetails -> String
$cshow :: AwsApiGatewayRestApiDetails -> String
showsPrec :: Int -> AwsApiGatewayRestApiDetails -> ShowS
$cshowsPrec :: Int -> AwsApiGatewayRestApiDetails -> ShowS
Prelude.Show, (forall x.
 AwsApiGatewayRestApiDetails -> Rep AwsApiGatewayRestApiDetails x)
-> (forall x.
    Rep AwsApiGatewayRestApiDetails x -> AwsApiGatewayRestApiDetails)
-> Generic AwsApiGatewayRestApiDetails
forall x.
Rep AwsApiGatewayRestApiDetails x -> AwsApiGatewayRestApiDetails
forall x.
AwsApiGatewayRestApiDetails -> Rep AwsApiGatewayRestApiDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsApiGatewayRestApiDetails x -> AwsApiGatewayRestApiDetails
$cfrom :: forall x.
AwsApiGatewayRestApiDetails -> Rep AwsApiGatewayRestApiDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsApiGatewayRestApiDetails' 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:
--
-- 'minimumCompressionSize', 'awsApiGatewayRestApiDetails_minimumCompressionSize' - The minimum size in bytes of a payload before compression is enabled.
--
-- If @null@, then compression is disabled.
--
-- If 0, then all payloads are compressed.
--
-- 'binaryMediaTypes', 'awsApiGatewayRestApiDetails_binaryMediaTypes' - The list of binary media types supported by the REST API.
--
-- 'createdDate', 'awsApiGatewayRestApiDetails_createdDate' - Indicates when the API was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'name', 'awsApiGatewayRestApiDetails_name' - The name of the REST API.
--
-- 'apiKeySource', 'awsApiGatewayRestApiDetails_apiKeySource' - The source of the API key for metering requests according to a usage
-- plan.
--
-- @HEADER@ indicates whether to read the API key from the X-API-Key header
-- of a request.
--
-- @AUTHORIZER@ indicates whether to read the API key from the
-- @UsageIdentifierKey@ from a custom authorizer.
--
-- 'version', 'awsApiGatewayRestApiDetails_version' - The version identifier for the REST API.
--
-- 'id', 'awsApiGatewayRestApiDetails_id' - The identifier of the REST API.
--
-- 'endpointConfiguration', 'awsApiGatewayRestApiDetails_endpointConfiguration' - The endpoint configuration of the REST API.
--
-- 'description', 'awsApiGatewayRestApiDetails_description' - A description of the REST API.
newAwsApiGatewayRestApiDetails ::
  AwsApiGatewayRestApiDetails
newAwsApiGatewayRestApiDetails :: AwsApiGatewayRestApiDetails
newAwsApiGatewayRestApiDetails =
  AwsApiGatewayRestApiDetails' :: Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsApiGatewayEndpointConfiguration
-> Maybe Text
-> AwsApiGatewayRestApiDetails
AwsApiGatewayRestApiDetails'
    { $sel:minimumCompressionSize:AwsApiGatewayRestApiDetails' :: Maybe Int
minimumCompressionSize =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:binaryMediaTypes:AwsApiGatewayRestApiDetails' :: Maybe [Text]
binaryMediaTypes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:AwsApiGatewayRestApiDetails' :: Maybe Text
createdDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AwsApiGatewayRestApiDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiKeySource:AwsApiGatewayRestApiDetails' :: Maybe Text
apiKeySource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:AwsApiGatewayRestApiDetails' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:AwsApiGatewayRestApiDetails' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointConfiguration:AwsApiGatewayRestApiDetails' :: Maybe AwsApiGatewayEndpointConfiguration
endpointConfiguration = Maybe AwsApiGatewayEndpointConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AwsApiGatewayRestApiDetails' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The minimum size in bytes of a payload before compression is enabled.
--
-- If @null@, then compression is disabled.
--
-- If 0, then all payloads are compressed.
awsApiGatewayRestApiDetails_minimumCompressionSize :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe Prelude.Int)
awsApiGatewayRestApiDetails_minimumCompressionSize :: (Maybe Int -> f (Maybe Int))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_minimumCompressionSize = (AwsApiGatewayRestApiDetails -> Maybe Int)
-> (AwsApiGatewayRestApiDetails
    -> Maybe Int -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe Int
minimumCompressionSize :: Maybe Int
$sel:minimumCompressionSize:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Int
minimumCompressionSize} -> Maybe Int
minimumCompressionSize) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe Int
a -> AwsApiGatewayRestApiDetails
s {$sel:minimumCompressionSize:AwsApiGatewayRestApiDetails' :: Maybe Int
minimumCompressionSize = Maybe Int
a} :: AwsApiGatewayRestApiDetails)

-- | The list of binary media types supported by the REST API.
awsApiGatewayRestApiDetails_binaryMediaTypes :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe [Prelude.Text])
awsApiGatewayRestApiDetails_binaryMediaTypes :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_binaryMediaTypes = (AwsApiGatewayRestApiDetails -> Maybe [Text])
-> (AwsApiGatewayRestApiDetails
    -> Maybe [Text] -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe [Text]
binaryMediaTypes :: Maybe [Text]
$sel:binaryMediaTypes:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe [Text]
binaryMediaTypes} -> Maybe [Text]
binaryMediaTypes) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe [Text]
a -> AwsApiGatewayRestApiDetails
s {$sel:binaryMediaTypes:AwsApiGatewayRestApiDetails' :: Maybe [Text]
binaryMediaTypes = Maybe [Text]
a} :: AwsApiGatewayRestApiDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsApiGatewayRestApiDetails
-> f AwsApiGatewayRestApiDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates when the API was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsApiGatewayRestApiDetails_createdDate :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayRestApiDetails_createdDate :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_createdDate = (AwsApiGatewayRestApiDetails -> Maybe Text)
-> (AwsApiGatewayRestApiDetails
    -> Maybe Text -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe Text
createdDate :: Maybe Text
$sel:createdDate:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
createdDate} -> Maybe Text
createdDate) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe Text
a -> AwsApiGatewayRestApiDetails
s {$sel:createdDate:AwsApiGatewayRestApiDetails' :: Maybe Text
createdDate = Maybe Text
a} :: AwsApiGatewayRestApiDetails)

-- | The name of the REST API.
awsApiGatewayRestApiDetails_name :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayRestApiDetails_name :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_name = (AwsApiGatewayRestApiDetails -> Maybe Text)
-> (AwsApiGatewayRestApiDetails
    -> Maybe Text -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe Text
name :: Maybe Text
$sel:name:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe Text
a -> AwsApiGatewayRestApiDetails
s {$sel:name:AwsApiGatewayRestApiDetails' :: Maybe Text
name = Maybe Text
a} :: AwsApiGatewayRestApiDetails)

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

-- | The version identifier for the REST API.
awsApiGatewayRestApiDetails_version :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayRestApiDetails_version :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_version = (AwsApiGatewayRestApiDetails -> Maybe Text)
-> (AwsApiGatewayRestApiDetails
    -> Maybe Text -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe Text
version :: Maybe Text
$sel:version:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
version} -> Maybe Text
version) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe Text
a -> AwsApiGatewayRestApiDetails
s {$sel:version:AwsApiGatewayRestApiDetails' :: Maybe Text
version = Maybe Text
a} :: AwsApiGatewayRestApiDetails)

-- | The identifier of the REST API.
awsApiGatewayRestApiDetails_id :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayRestApiDetails_id :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_id = (AwsApiGatewayRestApiDetails -> Maybe Text)
-> (AwsApiGatewayRestApiDetails
    -> Maybe Text -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe Text
id :: Maybe Text
$sel:id:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
id} -> Maybe Text
id) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe Text
a -> AwsApiGatewayRestApiDetails
s {$sel:id:AwsApiGatewayRestApiDetails' :: Maybe Text
id = Maybe Text
a} :: AwsApiGatewayRestApiDetails)

-- | The endpoint configuration of the REST API.
awsApiGatewayRestApiDetails_endpointConfiguration :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe AwsApiGatewayEndpointConfiguration)
awsApiGatewayRestApiDetails_endpointConfiguration :: (Maybe AwsApiGatewayEndpointConfiguration
 -> f (Maybe AwsApiGatewayEndpointConfiguration))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_endpointConfiguration = (AwsApiGatewayRestApiDetails
 -> Maybe AwsApiGatewayEndpointConfiguration)
-> (AwsApiGatewayRestApiDetails
    -> Maybe AwsApiGatewayEndpointConfiguration
    -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe AwsApiGatewayEndpointConfiguration)
     (Maybe AwsApiGatewayEndpointConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe AwsApiGatewayEndpointConfiguration
endpointConfiguration :: Maybe AwsApiGatewayEndpointConfiguration
$sel:endpointConfiguration:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails
-> Maybe AwsApiGatewayEndpointConfiguration
endpointConfiguration} -> Maybe AwsApiGatewayEndpointConfiguration
endpointConfiguration) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe AwsApiGatewayEndpointConfiguration
a -> AwsApiGatewayRestApiDetails
s {$sel:endpointConfiguration:AwsApiGatewayRestApiDetails' :: Maybe AwsApiGatewayEndpointConfiguration
endpointConfiguration = Maybe AwsApiGatewayEndpointConfiguration
a} :: AwsApiGatewayRestApiDetails)

-- | A description of the REST API.
awsApiGatewayRestApiDetails_description :: Lens.Lens' AwsApiGatewayRestApiDetails (Prelude.Maybe Prelude.Text)
awsApiGatewayRestApiDetails_description :: (Maybe Text -> f (Maybe Text))
-> AwsApiGatewayRestApiDetails -> f AwsApiGatewayRestApiDetails
awsApiGatewayRestApiDetails_description = (AwsApiGatewayRestApiDetails -> Maybe Text)
-> (AwsApiGatewayRestApiDetails
    -> Maybe Text -> AwsApiGatewayRestApiDetails)
-> Lens
     AwsApiGatewayRestApiDetails
     AwsApiGatewayRestApiDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsApiGatewayRestApiDetails' {Maybe Text
description :: Maybe Text
$sel:description:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
description} -> Maybe Text
description) (\s :: AwsApiGatewayRestApiDetails
s@AwsApiGatewayRestApiDetails' {} Maybe Text
a -> AwsApiGatewayRestApiDetails
s {$sel:description:AwsApiGatewayRestApiDetails' :: Maybe Text
description = Maybe Text
a} :: AwsApiGatewayRestApiDetails)

instance Core.FromJSON AwsApiGatewayRestApiDetails where
  parseJSON :: Value -> Parser AwsApiGatewayRestApiDetails
parseJSON =
    String
-> (Object -> Parser AwsApiGatewayRestApiDetails)
-> Value
-> Parser AwsApiGatewayRestApiDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsApiGatewayRestApiDetails"
      ( \Object
x ->
          Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsApiGatewayEndpointConfiguration
-> Maybe Text
-> AwsApiGatewayRestApiDetails
AwsApiGatewayRestApiDetails'
            (Maybe Int
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AwsApiGatewayEndpointConfiguration
 -> Maybe Text
 -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe Int)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsApiGatewayEndpointConfiguration
      -> Maybe Text
      -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MinimumCompressionSize")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsApiGatewayEndpointConfiguration
   -> Maybe Text
   -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsApiGatewayEndpointConfiguration
      -> Maybe Text
      -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BinaryMediaTypes"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsApiGatewayEndpointConfiguration
   -> Maybe Text
   -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsApiGatewayEndpointConfiguration
      -> Maybe Text
      -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsApiGatewayEndpointConfiguration
   -> Maybe Text
   -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsApiGatewayEndpointConfiguration
      -> Maybe Text
      -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsApiGatewayEndpointConfiguration
   -> Maybe Text
   -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AwsApiGatewayEndpointConfiguration
      -> Maybe Text
      -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApiKeySource")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AwsApiGatewayEndpointConfiguration
   -> Maybe Text
   -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AwsApiGatewayEndpointConfiguration
      -> Maybe Text
      -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser
  (Maybe Text
   -> Maybe AwsApiGatewayEndpointConfiguration
   -> Maybe Text
   -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe AwsApiGatewayEndpointConfiguration
      -> Maybe Text -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser
  (Maybe AwsApiGatewayEndpointConfiguration
   -> Maybe Text -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe AwsApiGatewayEndpointConfiguration)
-> Parser (Maybe Text -> AwsApiGatewayRestApiDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsApiGatewayEndpointConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointConfiguration")
            Parser (Maybe Text -> AwsApiGatewayRestApiDetails)
-> Parser (Maybe Text) -> Parser AwsApiGatewayRestApiDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
      )

instance Prelude.Hashable AwsApiGatewayRestApiDetails

instance Prelude.NFData AwsApiGatewayRestApiDetails

instance Core.ToJSON AwsApiGatewayRestApiDetails where
  toJSON :: AwsApiGatewayRestApiDetails -> Value
toJSON AwsApiGatewayRestApiDetails' {Maybe Int
Maybe [Text]
Maybe Text
Maybe AwsApiGatewayEndpointConfiguration
description :: Maybe Text
endpointConfiguration :: Maybe AwsApiGatewayEndpointConfiguration
id :: Maybe Text
version :: Maybe Text
apiKeySource :: Maybe Text
name :: Maybe Text
createdDate :: Maybe Text
binaryMediaTypes :: Maybe [Text]
minimumCompressionSize :: Maybe Int
$sel:description:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
$sel:endpointConfiguration:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails
-> Maybe AwsApiGatewayEndpointConfiguration
$sel:id:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
$sel:version:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
$sel:apiKeySource:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
$sel:name:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
$sel:createdDate:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Text
$sel:binaryMediaTypes:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe [Text]
$sel:minimumCompressionSize:AwsApiGatewayRestApiDetails' :: AwsApiGatewayRestApiDetails -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MinimumCompressionSize" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
minimumCompressionSize,
            (Text
"BinaryMediaTypes" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
binaryMediaTypes,
            (Text
"CreatedDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
createdDate,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"ApiKeySource" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
apiKeySource,
            (Text
"Version" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version,
            (Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id,
            (Text
"EndpointConfiguration" Text -> AwsApiGatewayEndpointConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsApiGatewayEndpointConfiguration -> Pair)
-> Maybe AwsApiGatewayEndpointConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsApiGatewayEndpointConfiguration
endpointConfiguration,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
          ]
      )