{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.PutIntegration
-- 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)
--
-- Sets up a method\'s integration.
module Amazonka.APIGateway.PutIntegration
  ( -- * Creating a Request
    PutIntegration (..),
    newPutIntegration,

    -- * Request Lenses
    putIntegration_requestTemplates,
    putIntegration_credentials,
    putIntegration_connectionId,
    putIntegration_requestParameters,
    putIntegration_contentHandling,
    putIntegration_passthroughBehavior,
    putIntegration_uri,
    putIntegration_tlsConfig,
    putIntegration_cacheNamespace,
    putIntegration_timeoutInMillis,
    putIntegration_connectionType,
    putIntegration_integrationHttpMethod,
    putIntegration_cacheKeyParameters,
    putIntegration_restApiId,
    putIntegration_resourceId,
    putIntegration_httpMethod,
    putIntegration_type,

    -- * Destructuring the Response
    Integration (..),
    newIntegration,

    -- * Response Lenses
    integration_httpMethod,
    integration_requestTemplates,
    integration_credentials,
    integration_connectionId,
    integration_requestParameters,
    integration_contentHandling,
    integration_passthroughBehavior,
    integration_uri,
    integration_integrationResponses,
    integration_tlsConfig,
    integration_cacheNamespace,
    integration_timeoutInMillis,
    integration_type,
    integration_connectionType,
    integration_cacheKeyParameters,
  )
where

import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Sets up a method\'s integration.
--
-- /See:/ 'newPutIntegration' smart constructor.
data PutIntegration = PutIntegration'
  { -- | Represents a map of Velocity templates that are applied on the request
    -- payload based on the value of the Content-Type header sent by the
    -- client. The content type value is the key in this map, and the template
    -- (as a String) is the value.
    PutIntegration -> Maybe (HashMap Text Text)
requestTemplates :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies whether credentials are required for a put integration.
    PutIntegration -> Maybe Text
credentials :: Prelude.Maybe Prelude.Text,
    -- | The
    -- (<https://docs.aws.amazon.com/apigateway/api-reference/resource/vpc-link/#id id>)
    -- of the VpcLink used for the integration when @connectionType=VPC_LINK@
    -- and undefined, otherwise.
    PutIntegration -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
    -- | A key-value map specifying request parameters that are passed from the
    -- method request to the back end. The key is an integration request
    -- parameter name and the associated value is a method request parameter
    -- value or static value that must be enclosed within single quotes and
    -- pre-encoded as required by the back end. The method request parameter
    -- value must match the pattern of @method.request.{location}.{name}@,
    -- where @location@ is @querystring@, @path@, or @header@ and @name@ must
    -- be a valid and unique method request parameter name.
    PutIntegration -> Maybe (HashMap Text Text)
requestParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies how to handle request payload content type conversions.
    -- Supported values are @CONVERT_TO_BINARY@ and @CONVERT_TO_TEXT@, with the
    -- following behaviors:
    --
    -- -   @CONVERT_TO_BINARY@: Converts a request payload from a
    --     Base64-encoded string to the corresponding binary blob.
    --
    -- -   @CONVERT_TO_TEXT@: Converts a request payload from a binary blob to
    --     a Base64-encoded string.
    --
    -- If this property is not defined, the request payload will be passed
    -- through from the method request to integration request without
    -- modification, provided that the @passthroughBehavior@ is configured to
    -- support payload pass-through.
    PutIntegration -> Maybe ContentHandlingStrategy
contentHandling :: Prelude.Maybe ContentHandlingStrategy,
    -- | Specifies the pass-through behavior for incoming requests based on the
    -- Content-Type header in the request, and the available mapping templates
    -- specified as the @requestTemplates@ property on the Integration
    -- resource. There are three valid values: @WHEN_NO_MATCH@,
    -- @WHEN_NO_TEMPLATES@, and @NEVER@.
    --
    -- -   @WHEN_NO_MATCH@ passes the request body for unmapped content types
    --     through to the integration back end without transformation.
    --
    -- -   @NEVER@ rejects unmapped content types with an HTTP 415
    --     \'Unsupported Media Type\' response.
    --
    -- -   @WHEN_NO_TEMPLATES@ allows pass-through when the integration has NO
    --     content types mapped to templates. However if there is at least one
    --     content type defined, unmapped content types will be rejected with
    --     the same 415 response.
    PutIntegration -> Maybe Text
passthroughBehavior :: Prelude.Maybe Prelude.Text,
    -- | Specifies Uniform Resource Identifier (URI) of the integration endpoint.
    --
    -- -   For @HTTP@ or @HTTP_PROXY@ integrations, the URI must be a fully
    --     formed, encoded HTTP(S) URL according to the
    --     <https://en.wikipedia.org/wiki/Uniform_Resource_Identifier RFC-3986 specification>,
    --     for either standard integration, where @connectionType@ is not
    --     @VPC_LINK@, or private integration, where @connectionType@ is
    --     @VPC_LINK@. For a private HTTP integration, the URI is not used for
    --     routing.
    --
    -- -   For @AWS@ or @AWS_PROXY@ integrations, the URI is of the form
    --     @arn:aws:apigateway:{region}:{subdomain.service|service}:path|action\/{service_api}@.
    --     Here, @{Region}@ is the API Gateway region (e.g., @us-east-1@);
    --     @{service}@ is the name of the integrated AWS service (e.g., @s3@);
    --     and @{subdomain}@ is a designated subdomain supported by certain AWS
    --     service for fast host-name lookup. @action@ can be used for an AWS
    --     service action-based API, using an
    --     @Action={name}&{p1}={v1}&p2={v2}...@ query string. The ensuing
    --     @{service_api}@ refers to a supported action @{name}@ plus any
    --     required input parameters. Alternatively, @path@ can be used for an
    --     AWS service path-based API. The ensuing @service_api@ refers to the
    --     path to an AWS service resource, including the region of the
    --     integrated AWS service, if applicable. For example, for integration
    --     with the S3 API of @GetObject@, the @uri@ can be either
    --     @arn:aws:apigateway:us-west-2:s3:action\/GetObject&Bucket={bucket}&Key={key}@
    --     or @arn:aws:apigateway:us-west-2:s3:path\/{bucket}\/{key}@
    PutIntegration -> Maybe Text
uri :: Prelude.Maybe Prelude.Text,
    PutIntegration -> Maybe TlsConfig
tlsConfig :: Prelude.Maybe TlsConfig,
    -- | Specifies a group of related cached parameters. By default, API Gateway
    -- uses the resource ID as the @cacheNamespace@. You can specify the same
    -- @cacheNamespace@ across resources to return the same cached data for
    -- requests to different resources.
    PutIntegration -> Maybe Text
cacheNamespace :: Prelude.Maybe Prelude.Text,
    -- | Custom timeout between 50 and 29,000 milliseconds. The default value is
    -- 29,000 milliseconds or 29 seconds.
    PutIntegration -> Maybe Int
timeoutInMillis :: Prelude.Maybe Prelude.Int,
    -- | The type of the network connection to the integration endpoint. The
    -- valid value is @INTERNET@ for connections through the public routable
    -- internet or @VPC_LINK@ for private connections between API Gateway and a
    -- network load balancer in a VPC. The default value is @INTERNET@.
    PutIntegration -> Maybe ConnectionType
connectionType :: Prelude.Maybe ConnectionType,
    -- | Specifies a put integration HTTP method. When the integration type is
    -- HTTP or AWS, this field is required.
    PutIntegration -> Maybe Text
integrationHttpMethod :: Prelude.Maybe Prelude.Text,
    -- | A list of request parameters whose values API Gateway caches. To be
    -- valid values for @cacheKeyParameters@, these parameters must also be
    -- specified for Method @requestParameters@.
    PutIntegration -> Maybe [Text]
cacheKeyParameters :: Prelude.Maybe [Prelude.Text],
    -- | [Required] The string identifier of the associated RestApi.
    PutIntegration -> Text
restApiId :: Prelude.Text,
    -- | [Required] Specifies a put integration request\'s resource ID.
    PutIntegration -> Text
resourceId :: Prelude.Text,
    -- | [Required] Specifies a put integration request\'s HTTP method.
    PutIntegration -> Text
httpMethod :: Prelude.Text,
    -- | [Required] Specifies a put integration input\'s type.
    PutIntegration -> IntegrationType
type' :: IntegrationType
  }
  deriving (PutIntegration -> PutIntegration -> Bool
(PutIntegration -> PutIntegration -> Bool)
-> (PutIntegration -> PutIntegration -> Bool) -> Eq PutIntegration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutIntegration -> PutIntegration -> Bool
$c/= :: PutIntegration -> PutIntegration -> Bool
== :: PutIntegration -> PutIntegration -> Bool
$c== :: PutIntegration -> PutIntegration -> Bool
Prelude.Eq, ReadPrec [PutIntegration]
ReadPrec PutIntegration
Int -> ReadS PutIntegration
ReadS [PutIntegration]
(Int -> ReadS PutIntegration)
-> ReadS [PutIntegration]
-> ReadPrec PutIntegration
-> ReadPrec [PutIntegration]
-> Read PutIntegration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutIntegration]
$creadListPrec :: ReadPrec [PutIntegration]
readPrec :: ReadPrec PutIntegration
$creadPrec :: ReadPrec PutIntegration
readList :: ReadS [PutIntegration]
$creadList :: ReadS [PutIntegration]
readsPrec :: Int -> ReadS PutIntegration
$creadsPrec :: Int -> ReadS PutIntegration
Prelude.Read, Int -> PutIntegration -> ShowS
[PutIntegration] -> ShowS
PutIntegration -> String
(Int -> PutIntegration -> ShowS)
-> (PutIntegration -> String)
-> ([PutIntegration] -> ShowS)
-> Show PutIntegration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutIntegration] -> ShowS
$cshowList :: [PutIntegration] -> ShowS
show :: PutIntegration -> String
$cshow :: PutIntegration -> String
showsPrec :: Int -> PutIntegration -> ShowS
$cshowsPrec :: Int -> PutIntegration -> ShowS
Prelude.Show, (forall x. PutIntegration -> Rep PutIntegration x)
-> (forall x. Rep PutIntegration x -> PutIntegration)
-> Generic PutIntegration
forall x. Rep PutIntegration x -> PutIntegration
forall x. PutIntegration -> Rep PutIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutIntegration x -> PutIntegration
$cfrom :: forall x. PutIntegration -> Rep PutIntegration x
Prelude.Generic)

-- |
-- Create a value of 'PutIntegration' 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:
--
-- 'requestTemplates', 'putIntegration_requestTemplates' - Represents a map of Velocity templates that are applied on the request
-- payload based on the value of the Content-Type header sent by the
-- client. The content type value is the key in this map, and the template
-- (as a String) is the value.
--
-- 'credentials', 'putIntegration_credentials' - Specifies whether credentials are required for a put integration.
--
-- 'connectionId', 'putIntegration_connectionId' - The
-- (<https://docs.aws.amazon.com/apigateway/api-reference/resource/vpc-link/#id id>)
-- of the VpcLink used for the integration when @connectionType=VPC_LINK@
-- and undefined, otherwise.
--
-- 'requestParameters', 'putIntegration_requestParameters' - A key-value map specifying request parameters that are passed from the
-- method request to the back end. The key is an integration request
-- parameter name and the associated value is a method request parameter
-- value or static value that must be enclosed within single quotes and
-- pre-encoded as required by the back end. The method request parameter
-- value must match the pattern of @method.request.{location}.{name}@,
-- where @location@ is @querystring@, @path@, or @header@ and @name@ must
-- be a valid and unique method request parameter name.
--
-- 'contentHandling', 'putIntegration_contentHandling' - Specifies how to handle request payload content type conversions.
-- Supported values are @CONVERT_TO_BINARY@ and @CONVERT_TO_TEXT@, with the
-- following behaviors:
--
-- -   @CONVERT_TO_BINARY@: Converts a request payload from a
--     Base64-encoded string to the corresponding binary blob.
--
-- -   @CONVERT_TO_TEXT@: Converts a request payload from a binary blob to
--     a Base64-encoded string.
--
-- If this property is not defined, the request payload will be passed
-- through from the method request to integration request without
-- modification, provided that the @passthroughBehavior@ is configured to
-- support payload pass-through.
--
-- 'passthroughBehavior', 'putIntegration_passthroughBehavior' - Specifies the pass-through behavior for incoming requests based on the
-- Content-Type header in the request, and the available mapping templates
-- specified as the @requestTemplates@ property on the Integration
-- resource. There are three valid values: @WHEN_NO_MATCH@,
-- @WHEN_NO_TEMPLATES@, and @NEVER@.
--
-- -   @WHEN_NO_MATCH@ passes the request body for unmapped content types
--     through to the integration back end without transformation.
--
-- -   @NEVER@ rejects unmapped content types with an HTTP 415
--     \'Unsupported Media Type\' response.
--
-- -   @WHEN_NO_TEMPLATES@ allows pass-through when the integration has NO
--     content types mapped to templates. However if there is at least one
--     content type defined, unmapped content types will be rejected with
--     the same 415 response.
--
-- 'uri', 'putIntegration_uri' - Specifies Uniform Resource Identifier (URI) of the integration endpoint.
--
-- -   For @HTTP@ or @HTTP_PROXY@ integrations, the URI must be a fully
--     formed, encoded HTTP(S) URL according to the
--     <https://en.wikipedia.org/wiki/Uniform_Resource_Identifier RFC-3986 specification>,
--     for either standard integration, where @connectionType@ is not
--     @VPC_LINK@, or private integration, where @connectionType@ is
--     @VPC_LINK@. For a private HTTP integration, the URI is not used for
--     routing.
--
-- -   For @AWS@ or @AWS_PROXY@ integrations, the URI is of the form
--     @arn:aws:apigateway:{region}:{subdomain.service|service}:path|action\/{service_api}@.
--     Here, @{Region}@ is the API Gateway region (e.g., @us-east-1@);
--     @{service}@ is the name of the integrated AWS service (e.g., @s3@);
--     and @{subdomain}@ is a designated subdomain supported by certain AWS
--     service for fast host-name lookup. @action@ can be used for an AWS
--     service action-based API, using an
--     @Action={name}&{p1}={v1}&p2={v2}...@ query string. The ensuing
--     @{service_api}@ refers to a supported action @{name}@ plus any
--     required input parameters. Alternatively, @path@ can be used for an
--     AWS service path-based API. The ensuing @service_api@ refers to the
--     path to an AWS service resource, including the region of the
--     integrated AWS service, if applicable. For example, for integration
--     with the S3 API of @GetObject@, the @uri@ can be either
--     @arn:aws:apigateway:us-west-2:s3:action\/GetObject&Bucket={bucket}&Key={key}@
--     or @arn:aws:apigateway:us-west-2:s3:path\/{bucket}\/{key}@
--
-- 'tlsConfig', 'putIntegration_tlsConfig' - Undocumented member.
--
-- 'cacheNamespace', 'putIntegration_cacheNamespace' - Specifies a group of related cached parameters. By default, API Gateway
-- uses the resource ID as the @cacheNamespace@. You can specify the same
-- @cacheNamespace@ across resources to return the same cached data for
-- requests to different resources.
--
-- 'timeoutInMillis', 'putIntegration_timeoutInMillis' - Custom timeout between 50 and 29,000 milliseconds. The default value is
-- 29,000 milliseconds or 29 seconds.
--
-- 'connectionType', 'putIntegration_connectionType' - The type of the network connection to the integration endpoint. The
-- valid value is @INTERNET@ for connections through the public routable
-- internet or @VPC_LINK@ for private connections between API Gateway and a
-- network load balancer in a VPC. The default value is @INTERNET@.
--
-- 'integrationHttpMethod', 'putIntegration_integrationHttpMethod' - Specifies a put integration HTTP method. When the integration type is
-- HTTP or AWS, this field is required.
--
-- 'cacheKeyParameters', 'putIntegration_cacheKeyParameters' - A list of request parameters whose values API Gateway caches. To be
-- valid values for @cacheKeyParameters@, these parameters must also be
-- specified for Method @requestParameters@.
--
-- 'restApiId', 'putIntegration_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'resourceId', 'putIntegration_resourceId' - [Required] Specifies a put integration request\'s resource ID.
--
-- 'httpMethod', 'putIntegration_httpMethod' - [Required] Specifies a put integration request\'s HTTP method.
--
-- 'type'', 'putIntegration_type' - [Required] Specifies a put integration input\'s type.
newPutIntegration ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'httpMethod'
  Prelude.Text ->
  -- | 'type''
  IntegrationType ->
  PutIntegration
newPutIntegration :: Text -> Text -> Text -> IntegrationType -> PutIntegration
newPutIntegration
  Text
pRestApiId_
  Text
pResourceId_
  Text
pHttpMethod_
  IntegrationType
pType_ =
    PutIntegration' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe ContentHandlingStrategy
-> Maybe Text
-> Maybe Text
-> Maybe TlsConfig
-> Maybe Text
-> Maybe Int
-> Maybe ConnectionType
-> Maybe Text
-> Maybe [Text]
-> Text
-> Text
-> Text
-> IntegrationType
-> PutIntegration
PutIntegration'
      { $sel:requestTemplates:PutIntegration' :: Maybe (HashMap Text Text)
requestTemplates = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:credentials:PutIntegration' :: Maybe Text
credentials = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:connectionId:PutIntegration' :: Maybe Text
connectionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:requestParameters:PutIntegration' :: Maybe (HashMap Text Text)
requestParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:contentHandling:PutIntegration' :: Maybe ContentHandlingStrategy
contentHandling = Maybe ContentHandlingStrategy
forall a. Maybe a
Prelude.Nothing,
        $sel:passthroughBehavior:PutIntegration' :: Maybe Text
passthroughBehavior = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:uri:PutIntegration' :: Maybe Text
uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tlsConfig:PutIntegration' :: Maybe TlsConfig
tlsConfig = Maybe TlsConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:cacheNamespace:PutIntegration' :: Maybe Text
cacheNamespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:timeoutInMillis:PutIntegration' :: Maybe Int
timeoutInMillis = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:connectionType:PutIntegration' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
forall a. Maybe a
Prelude.Nothing,
        $sel:integrationHttpMethod:PutIntegration' :: Maybe Text
integrationHttpMethod = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:cacheKeyParameters:PutIntegration' :: Maybe [Text]
cacheKeyParameters = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:restApiId:PutIntegration' :: Text
restApiId = Text
pRestApiId_,
        $sel:resourceId:PutIntegration' :: Text
resourceId = Text
pResourceId_,
        $sel:httpMethod:PutIntegration' :: Text
httpMethod = Text
pHttpMethod_,
        $sel:type':PutIntegration' :: IntegrationType
type' = IntegrationType
pType_
      }

-- | Represents a map of Velocity templates that are applied on the request
-- payload based on the value of the Content-Type header sent by the
-- client. The content type value is the key in this map, and the template
-- (as a String) is the value.
putIntegration_requestTemplates :: Lens.Lens' PutIntegration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
putIntegration_requestTemplates :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutIntegration -> f PutIntegration
putIntegration_requestTemplates = (PutIntegration -> Maybe (HashMap Text Text))
-> (PutIntegration -> Maybe (HashMap Text Text) -> PutIntegration)
-> Lens
     PutIntegration
     PutIntegration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe (HashMap Text Text)
requestTemplates :: Maybe (HashMap Text Text)
$sel:requestTemplates:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
requestTemplates} -> Maybe (HashMap Text Text)
requestTemplates) (\s :: PutIntegration
s@PutIntegration' {} Maybe (HashMap Text Text)
a -> PutIntegration
s {$sel:requestTemplates:PutIntegration' :: Maybe (HashMap Text Text)
requestTemplates = Maybe (HashMap Text Text)
a} :: PutIntegration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PutIntegration -> f PutIntegration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutIntegration
-> f PutIntegration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies whether credentials are required for a put integration.
putIntegration_credentials :: Lens.Lens' PutIntegration (Prelude.Maybe Prelude.Text)
putIntegration_credentials :: (Maybe Text -> f (Maybe Text))
-> PutIntegration -> f PutIntegration
putIntegration_credentials = (PutIntegration -> Maybe Text)
-> (PutIntegration -> Maybe Text -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe Text
credentials :: Maybe Text
$sel:credentials:PutIntegration' :: PutIntegration -> Maybe Text
credentials} -> Maybe Text
credentials) (\s :: PutIntegration
s@PutIntegration' {} Maybe Text
a -> PutIntegration
s {$sel:credentials:PutIntegration' :: Maybe Text
credentials = Maybe Text
a} :: PutIntegration)

-- | The
-- (<https://docs.aws.amazon.com/apigateway/api-reference/resource/vpc-link/#id id>)
-- of the VpcLink used for the integration when @connectionType=VPC_LINK@
-- and undefined, otherwise.
putIntegration_connectionId :: Lens.Lens' PutIntegration (Prelude.Maybe Prelude.Text)
putIntegration_connectionId :: (Maybe Text -> f (Maybe Text))
-> PutIntegration -> f PutIntegration
putIntegration_connectionId = (PutIntegration -> Maybe Text)
-> (PutIntegration -> Maybe Text -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe Text
connectionId :: Maybe Text
$sel:connectionId:PutIntegration' :: PutIntegration -> Maybe Text
connectionId} -> Maybe Text
connectionId) (\s :: PutIntegration
s@PutIntegration' {} Maybe Text
a -> PutIntegration
s {$sel:connectionId:PutIntegration' :: Maybe Text
connectionId = Maybe Text
a} :: PutIntegration)

-- | A key-value map specifying request parameters that are passed from the
-- method request to the back end. The key is an integration request
-- parameter name and the associated value is a method request parameter
-- value or static value that must be enclosed within single quotes and
-- pre-encoded as required by the back end. The method request parameter
-- value must match the pattern of @method.request.{location}.{name}@,
-- where @location@ is @querystring@, @path@, or @header@ and @name@ must
-- be a valid and unique method request parameter name.
putIntegration_requestParameters :: Lens.Lens' PutIntegration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
putIntegration_requestParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutIntegration -> f PutIntegration
putIntegration_requestParameters = (PutIntegration -> Maybe (HashMap Text Text))
-> (PutIntegration -> Maybe (HashMap Text Text) -> PutIntegration)
-> Lens
     PutIntegration
     PutIntegration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe (HashMap Text Text)
requestParameters :: Maybe (HashMap Text Text)
$sel:requestParameters:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
requestParameters} -> Maybe (HashMap Text Text)
requestParameters) (\s :: PutIntegration
s@PutIntegration' {} Maybe (HashMap Text Text)
a -> PutIntegration
s {$sel:requestParameters:PutIntegration' :: Maybe (HashMap Text Text)
requestParameters = Maybe (HashMap Text Text)
a} :: PutIntegration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PutIntegration -> f PutIntegration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutIntegration
-> f PutIntegration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies how to handle request payload content type conversions.
-- Supported values are @CONVERT_TO_BINARY@ and @CONVERT_TO_TEXT@, with the
-- following behaviors:
--
-- -   @CONVERT_TO_BINARY@: Converts a request payload from a
--     Base64-encoded string to the corresponding binary blob.
--
-- -   @CONVERT_TO_TEXT@: Converts a request payload from a binary blob to
--     a Base64-encoded string.
--
-- If this property is not defined, the request payload will be passed
-- through from the method request to integration request without
-- modification, provided that the @passthroughBehavior@ is configured to
-- support payload pass-through.
putIntegration_contentHandling :: Lens.Lens' PutIntegration (Prelude.Maybe ContentHandlingStrategy)
putIntegration_contentHandling :: (Maybe ContentHandlingStrategy
 -> f (Maybe ContentHandlingStrategy))
-> PutIntegration -> f PutIntegration
putIntegration_contentHandling = (PutIntegration -> Maybe ContentHandlingStrategy)
-> (PutIntegration
    -> Maybe ContentHandlingStrategy -> PutIntegration)
-> Lens
     PutIntegration
     PutIntegration
     (Maybe ContentHandlingStrategy)
     (Maybe ContentHandlingStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe ContentHandlingStrategy
contentHandling :: Maybe ContentHandlingStrategy
$sel:contentHandling:PutIntegration' :: PutIntegration -> Maybe ContentHandlingStrategy
contentHandling} -> Maybe ContentHandlingStrategy
contentHandling) (\s :: PutIntegration
s@PutIntegration' {} Maybe ContentHandlingStrategy
a -> PutIntegration
s {$sel:contentHandling:PutIntegration' :: Maybe ContentHandlingStrategy
contentHandling = Maybe ContentHandlingStrategy
a} :: PutIntegration)

-- | Specifies the pass-through behavior for incoming requests based on the
-- Content-Type header in the request, and the available mapping templates
-- specified as the @requestTemplates@ property on the Integration
-- resource. There are three valid values: @WHEN_NO_MATCH@,
-- @WHEN_NO_TEMPLATES@, and @NEVER@.
--
-- -   @WHEN_NO_MATCH@ passes the request body for unmapped content types
--     through to the integration back end without transformation.
--
-- -   @NEVER@ rejects unmapped content types with an HTTP 415
--     \'Unsupported Media Type\' response.
--
-- -   @WHEN_NO_TEMPLATES@ allows pass-through when the integration has NO
--     content types mapped to templates. However if there is at least one
--     content type defined, unmapped content types will be rejected with
--     the same 415 response.
putIntegration_passthroughBehavior :: Lens.Lens' PutIntegration (Prelude.Maybe Prelude.Text)
putIntegration_passthroughBehavior :: (Maybe Text -> f (Maybe Text))
-> PutIntegration -> f PutIntegration
putIntegration_passthroughBehavior = (PutIntegration -> Maybe Text)
-> (PutIntegration -> Maybe Text -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe Text
passthroughBehavior :: Maybe Text
$sel:passthroughBehavior:PutIntegration' :: PutIntegration -> Maybe Text
passthroughBehavior} -> Maybe Text
passthroughBehavior) (\s :: PutIntegration
s@PutIntegration' {} Maybe Text
a -> PutIntegration
s {$sel:passthroughBehavior:PutIntegration' :: Maybe Text
passthroughBehavior = Maybe Text
a} :: PutIntegration)

-- | Specifies Uniform Resource Identifier (URI) of the integration endpoint.
--
-- -   For @HTTP@ or @HTTP_PROXY@ integrations, the URI must be a fully
--     formed, encoded HTTP(S) URL according to the
--     <https://en.wikipedia.org/wiki/Uniform_Resource_Identifier RFC-3986 specification>,
--     for either standard integration, where @connectionType@ is not
--     @VPC_LINK@, or private integration, where @connectionType@ is
--     @VPC_LINK@. For a private HTTP integration, the URI is not used for
--     routing.
--
-- -   For @AWS@ or @AWS_PROXY@ integrations, the URI is of the form
--     @arn:aws:apigateway:{region}:{subdomain.service|service}:path|action\/{service_api}@.
--     Here, @{Region}@ is the API Gateway region (e.g., @us-east-1@);
--     @{service}@ is the name of the integrated AWS service (e.g., @s3@);
--     and @{subdomain}@ is a designated subdomain supported by certain AWS
--     service for fast host-name lookup. @action@ can be used for an AWS
--     service action-based API, using an
--     @Action={name}&{p1}={v1}&p2={v2}...@ query string. The ensuing
--     @{service_api}@ refers to a supported action @{name}@ plus any
--     required input parameters. Alternatively, @path@ can be used for an
--     AWS service path-based API. The ensuing @service_api@ refers to the
--     path to an AWS service resource, including the region of the
--     integrated AWS service, if applicable. For example, for integration
--     with the S3 API of @GetObject@, the @uri@ can be either
--     @arn:aws:apigateway:us-west-2:s3:action\/GetObject&Bucket={bucket}&Key={key}@
--     or @arn:aws:apigateway:us-west-2:s3:path\/{bucket}\/{key}@
putIntegration_uri :: Lens.Lens' PutIntegration (Prelude.Maybe Prelude.Text)
putIntegration_uri :: (Maybe Text -> f (Maybe Text))
-> PutIntegration -> f PutIntegration
putIntegration_uri = (PutIntegration -> Maybe Text)
-> (PutIntegration -> Maybe Text -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe Text
uri :: Maybe Text
$sel:uri:PutIntegration' :: PutIntegration -> Maybe Text
uri} -> Maybe Text
uri) (\s :: PutIntegration
s@PutIntegration' {} Maybe Text
a -> PutIntegration
s {$sel:uri:PutIntegration' :: Maybe Text
uri = Maybe Text
a} :: PutIntegration)

-- | Undocumented member.
putIntegration_tlsConfig :: Lens.Lens' PutIntegration (Prelude.Maybe TlsConfig)
putIntegration_tlsConfig :: (Maybe TlsConfig -> f (Maybe TlsConfig))
-> PutIntegration -> f PutIntegration
putIntegration_tlsConfig = (PutIntegration -> Maybe TlsConfig)
-> (PutIntegration -> Maybe TlsConfig -> PutIntegration)
-> Lens
     PutIntegration PutIntegration (Maybe TlsConfig) (Maybe TlsConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe TlsConfig
tlsConfig :: Maybe TlsConfig
$sel:tlsConfig:PutIntegration' :: PutIntegration -> Maybe TlsConfig
tlsConfig} -> Maybe TlsConfig
tlsConfig) (\s :: PutIntegration
s@PutIntegration' {} Maybe TlsConfig
a -> PutIntegration
s {$sel:tlsConfig:PutIntegration' :: Maybe TlsConfig
tlsConfig = Maybe TlsConfig
a} :: PutIntegration)

-- | Specifies a group of related cached parameters. By default, API Gateway
-- uses the resource ID as the @cacheNamespace@. You can specify the same
-- @cacheNamespace@ across resources to return the same cached data for
-- requests to different resources.
putIntegration_cacheNamespace :: Lens.Lens' PutIntegration (Prelude.Maybe Prelude.Text)
putIntegration_cacheNamespace :: (Maybe Text -> f (Maybe Text))
-> PutIntegration -> f PutIntegration
putIntegration_cacheNamespace = (PutIntegration -> Maybe Text)
-> (PutIntegration -> Maybe Text -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe Text
cacheNamespace :: Maybe Text
$sel:cacheNamespace:PutIntegration' :: PutIntegration -> Maybe Text
cacheNamespace} -> Maybe Text
cacheNamespace) (\s :: PutIntegration
s@PutIntegration' {} Maybe Text
a -> PutIntegration
s {$sel:cacheNamespace:PutIntegration' :: Maybe Text
cacheNamespace = Maybe Text
a} :: PutIntegration)

-- | Custom timeout between 50 and 29,000 milliseconds. The default value is
-- 29,000 milliseconds or 29 seconds.
putIntegration_timeoutInMillis :: Lens.Lens' PutIntegration (Prelude.Maybe Prelude.Int)
putIntegration_timeoutInMillis :: (Maybe Int -> f (Maybe Int)) -> PutIntegration -> f PutIntegration
putIntegration_timeoutInMillis = (PutIntegration -> Maybe Int)
-> (PutIntegration -> Maybe Int -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe Int
timeoutInMillis :: Maybe Int
$sel:timeoutInMillis:PutIntegration' :: PutIntegration -> Maybe Int
timeoutInMillis} -> Maybe Int
timeoutInMillis) (\s :: PutIntegration
s@PutIntegration' {} Maybe Int
a -> PutIntegration
s {$sel:timeoutInMillis:PutIntegration' :: Maybe Int
timeoutInMillis = Maybe Int
a} :: PutIntegration)

-- | The type of the network connection to the integration endpoint. The
-- valid value is @INTERNET@ for connections through the public routable
-- internet or @VPC_LINK@ for private connections between API Gateway and a
-- network load balancer in a VPC. The default value is @INTERNET@.
putIntegration_connectionType :: Lens.Lens' PutIntegration (Prelude.Maybe ConnectionType)
putIntegration_connectionType :: (Maybe ConnectionType -> f (Maybe ConnectionType))
-> PutIntegration -> f PutIntegration
putIntegration_connectionType = (PutIntegration -> Maybe ConnectionType)
-> (PutIntegration -> Maybe ConnectionType -> PutIntegration)
-> Lens
     PutIntegration
     PutIntegration
     (Maybe ConnectionType)
     (Maybe ConnectionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe ConnectionType
connectionType :: Maybe ConnectionType
$sel:connectionType:PutIntegration' :: PutIntegration -> Maybe ConnectionType
connectionType} -> Maybe ConnectionType
connectionType) (\s :: PutIntegration
s@PutIntegration' {} Maybe ConnectionType
a -> PutIntegration
s {$sel:connectionType:PutIntegration' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
a} :: PutIntegration)

-- | Specifies a put integration HTTP method. When the integration type is
-- HTTP or AWS, this field is required.
putIntegration_integrationHttpMethod :: Lens.Lens' PutIntegration (Prelude.Maybe Prelude.Text)
putIntegration_integrationHttpMethod :: (Maybe Text -> f (Maybe Text))
-> PutIntegration -> f PutIntegration
putIntegration_integrationHttpMethod = (PutIntegration -> Maybe Text)
-> (PutIntegration -> Maybe Text -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe Text
integrationHttpMethod :: Maybe Text
$sel:integrationHttpMethod:PutIntegration' :: PutIntegration -> Maybe Text
integrationHttpMethod} -> Maybe Text
integrationHttpMethod) (\s :: PutIntegration
s@PutIntegration' {} Maybe Text
a -> PutIntegration
s {$sel:integrationHttpMethod:PutIntegration' :: Maybe Text
integrationHttpMethod = Maybe Text
a} :: PutIntegration)

-- | A list of request parameters whose values API Gateway caches. To be
-- valid values for @cacheKeyParameters@, these parameters must also be
-- specified for Method @requestParameters@.
putIntegration_cacheKeyParameters :: Lens.Lens' PutIntegration (Prelude.Maybe [Prelude.Text])
putIntegration_cacheKeyParameters :: (Maybe [Text] -> f (Maybe [Text]))
-> PutIntegration -> f PutIntegration
putIntegration_cacheKeyParameters = (PutIntegration -> Maybe [Text])
-> (PutIntegration -> Maybe [Text] -> PutIntegration)
-> Lens PutIntegration PutIntegration (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe [Text]
cacheKeyParameters :: Maybe [Text]
$sel:cacheKeyParameters:PutIntegration' :: PutIntegration -> Maybe [Text]
cacheKeyParameters} -> Maybe [Text]
cacheKeyParameters) (\s :: PutIntegration
s@PutIntegration' {} Maybe [Text]
a -> PutIntegration
s {$sel:cacheKeyParameters:PutIntegration' :: Maybe [Text]
cacheKeyParameters = Maybe [Text]
a} :: PutIntegration) ((Maybe [Text] -> f (Maybe [Text]))
 -> PutIntegration -> f PutIntegration)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutIntegration
-> f PutIntegration
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

-- | [Required] The string identifier of the associated RestApi.
putIntegration_restApiId :: Lens.Lens' PutIntegration Prelude.Text
putIntegration_restApiId :: (Text -> f Text) -> PutIntegration -> f PutIntegration
putIntegration_restApiId = (PutIntegration -> Text)
-> (PutIntegration -> Text -> PutIntegration)
-> Lens PutIntegration PutIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Text
restApiId :: Text
$sel:restApiId:PutIntegration' :: PutIntegration -> Text
restApiId} -> Text
restApiId) (\s :: PutIntegration
s@PutIntegration' {} Text
a -> PutIntegration
s {$sel:restApiId:PutIntegration' :: Text
restApiId = Text
a} :: PutIntegration)

-- | [Required] Specifies a put integration request\'s resource ID.
putIntegration_resourceId :: Lens.Lens' PutIntegration Prelude.Text
putIntegration_resourceId :: (Text -> f Text) -> PutIntegration -> f PutIntegration
putIntegration_resourceId = (PutIntegration -> Text)
-> (PutIntegration -> Text -> PutIntegration)
-> Lens PutIntegration PutIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Text
resourceId :: Text
$sel:resourceId:PutIntegration' :: PutIntegration -> Text
resourceId} -> Text
resourceId) (\s :: PutIntegration
s@PutIntegration' {} Text
a -> PutIntegration
s {$sel:resourceId:PutIntegration' :: Text
resourceId = Text
a} :: PutIntegration)

-- | [Required] Specifies a put integration request\'s HTTP method.
putIntegration_httpMethod :: Lens.Lens' PutIntegration Prelude.Text
putIntegration_httpMethod :: (Text -> f Text) -> PutIntegration -> f PutIntegration
putIntegration_httpMethod = (PutIntegration -> Text)
-> (PutIntegration -> Text -> PutIntegration)
-> Lens PutIntegration PutIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Text
httpMethod :: Text
$sel:httpMethod:PutIntegration' :: PutIntegration -> Text
httpMethod} -> Text
httpMethod) (\s :: PutIntegration
s@PutIntegration' {} Text
a -> PutIntegration
s {$sel:httpMethod:PutIntegration' :: Text
httpMethod = Text
a} :: PutIntegration)

-- | [Required] Specifies a put integration input\'s type.
putIntegration_type :: Lens.Lens' PutIntegration IntegrationType
putIntegration_type :: (IntegrationType -> f IntegrationType)
-> PutIntegration -> f PutIntegration
putIntegration_type = (PutIntegration -> IntegrationType)
-> (PutIntegration -> IntegrationType -> PutIntegration)
-> Lens
     PutIntegration PutIntegration IntegrationType IntegrationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {IntegrationType
type' :: IntegrationType
$sel:type':PutIntegration' :: PutIntegration -> IntegrationType
type'} -> IntegrationType
type') (\s :: PutIntegration
s@PutIntegration' {} IntegrationType
a -> PutIntegration
s {$sel:type':PutIntegration' :: IntegrationType
type' = IntegrationType
a} :: PutIntegration)

instance Core.AWSRequest PutIntegration where
  type AWSResponse PutIntegration = Integration
  request :: PutIntegration -> Request PutIntegration
request = Service -> PutIntegration -> Request PutIntegration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutIntegration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutIntegration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutIntegration))
-> Logger
-> Service
-> Proxy PutIntegration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutIntegration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      (\Int
s ResponseHeaders
h Object
x -> Object -> Either String Integration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)

instance Prelude.Hashable PutIntegration

instance Prelude.NFData PutIntegration

instance Core.ToHeaders PutIntegration where
  toHeaders :: PutIntegration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutIntegration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToJSON PutIntegration where
  toJSON :: PutIntegration -> Value
toJSON PutIntegration' {Maybe Int
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ConnectionType
Maybe ContentHandlingStrategy
Maybe TlsConfig
Text
IntegrationType
type' :: IntegrationType
httpMethod :: Text
resourceId :: Text
restApiId :: Text
cacheKeyParameters :: Maybe [Text]
integrationHttpMethod :: Maybe Text
connectionType :: Maybe ConnectionType
timeoutInMillis :: Maybe Int
cacheNamespace :: Maybe Text
tlsConfig :: Maybe TlsConfig
uri :: Maybe Text
passthroughBehavior :: Maybe Text
contentHandling :: Maybe ContentHandlingStrategy
requestParameters :: Maybe (HashMap Text Text)
connectionId :: Maybe Text
credentials :: Maybe Text
requestTemplates :: Maybe (HashMap Text Text)
$sel:type':PutIntegration' :: PutIntegration -> IntegrationType
$sel:httpMethod:PutIntegration' :: PutIntegration -> Text
$sel:resourceId:PutIntegration' :: PutIntegration -> Text
$sel:restApiId:PutIntegration' :: PutIntegration -> Text
$sel:cacheKeyParameters:PutIntegration' :: PutIntegration -> Maybe [Text]
$sel:integrationHttpMethod:PutIntegration' :: PutIntegration -> Maybe Text
$sel:connectionType:PutIntegration' :: PutIntegration -> Maybe ConnectionType
$sel:timeoutInMillis:PutIntegration' :: PutIntegration -> Maybe Int
$sel:cacheNamespace:PutIntegration' :: PutIntegration -> Maybe Text
$sel:tlsConfig:PutIntegration' :: PutIntegration -> Maybe TlsConfig
$sel:uri:PutIntegration' :: PutIntegration -> Maybe Text
$sel:passthroughBehavior:PutIntegration' :: PutIntegration -> Maybe Text
$sel:contentHandling:PutIntegration' :: PutIntegration -> Maybe ContentHandlingStrategy
$sel:requestParameters:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
$sel:connectionId:PutIntegration' :: PutIntegration -> Maybe Text
$sel:credentials:PutIntegration' :: PutIntegration -> Maybe Text
$sel:requestTemplates:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"requestTemplates" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
requestTemplates,
            (Text
"credentials" 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
credentials,
            (Text
"connectionId" 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
connectionId,
            (Text
"requestParameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
requestParameters,
            (Text
"contentHandling" Text -> ContentHandlingStrategy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ContentHandlingStrategy -> Pair)
-> Maybe ContentHandlingStrategy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContentHandlingStrategy
contentHandling,
            (Text
"passthroughBehavior" 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
passthroughBehavior,
            (Text
"uri" 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
uri,
            (Text
"tlsConfig" Text -> TlsConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TlsConfig -> Pair) -> Maybe TlsConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TlsConfig
tlsConfig,
            (Text
"cacheNamespace" 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
cacheNamespace,
            (Text
"timeoutInMillis" 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
timeoutInMillis,
            (Text
"connectionType" Text -> ConnectionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ConnectionType -> Pair) -> Maybe ConnectionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectionType
connectionType,
            (Text
"httpMethod" 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
integrationHttpMethod,
            (Text
"cacheKeyParameters" 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]
cacheKeyParameters,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> IntegrationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= IntegrationType
type')
          ]
      )

instance Core.ToPath PutIntegration where
  toPath :: PutIntegration -> ByteString
toPath PutIntegration' {Maybe Int
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ConnectionType
Maybe ContentHandlingStrategy
Maybe TlsConfig
Text
IntegrationType
type' :: IntegrationType
httpMethod :: Text
resourceId :: Text
restApiId :: Text
cacheKeyParameters :: Maybe [Text]
integrationHttpMethod :: Maybe Text
connectionType :: Maybe ConnectionType
timeoutInMillis :: Maybe Int
cacheNamespace :: Maybe Text
tlsConfig :: Maybe TlsConfig
uri :: Maybe Text
passthroughBehavior :: Maybe Text
contentHandling :: Maybe ContentHandlingStrategy
requestParameters :: Maybe (HashMap Text Text)
connectionId :: Maybe Text
credentials :: Maybe Text
requestTemplates :: Maybe (HashMap Text Text)
$sel:type':PutIntegration' :: PutIntegration -> IntegrationType
$sel:httpMethod:PutIntegration' :: PutIntegration -> Text
$sel:resourceId:PutIntegration' :: PutIntegration -> Text
$sel:restApiId:PutIntegration' :: PutIntegration -> Text
$sel:cacheKeyParameters:PutIntegration' :: PutIntegration -> Maybe [Text]
$sel:integrationHttpMethod:PutIntegration' :: PutIntegration -> Maybe Text
$sel:connectionType:PutIntegration' :: PutIntegration -> Maybe ConnectionType
$sel:timeoutInMillis:PutIntegration' :: PutIntegration -> Maybe Int
$sel:cacheNamespace:PutIntegration' :: PutIntegration -> Maybe Text
$sel:tlsConfig:PutIntegration' :: PutIntegration -> Maybe TlsConfig
$sel:uri:PutIntegration' :: PutIntegration -> Maybe Text
$sel:passthroughBehavior:PutIntegration' :: PutIntegration -> Maybe Text
$sel:contentHandling:PutIntegration' :: PutIntegration -> Maybe ContentHandlingStrategy
$sel:requestParameters:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
$sel:connectionId:PutIntegration' :: PutIntegration -> Maybe Text
$sel:credentials:PutIntegration' :: PutIntegration -> Maybe Text
$sel:requestTemplates:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
        ByteString
"/resources/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceId,
        ByteString
"/methods/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
httpMethod,
        ByteString
"/integration"
      ]

instance Core.ToQuery PutIntegration where
  toQuery :: PutIntegration -> QueryString
toQuery = QueryString -> PutIntegration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty