{-# 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.CustomerProfiles.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)
--
-- Adds an integration between the service and a third-party service, which
-- includes Amazon AppFlow and Amazon Connect.
--
-- An integration can belong to only one domain.
module Amazonka.CustomerProfiles.PutIntegration
  ( -- * Creating a Request
    PutIntegration (..),
    newPutIntegration,

    -- * Request Lenses
    putIntegration_flowDefinition,
    putIntegration_uri,
    putIntegration_tags,
    putIntegration_domainName,
    putIntegration_objectTypeName,

    -- * Destructuring the Response
    PutIntegrationResponse (..),
    newPutIntegrationResponse,

    -- * Response Lenses
    putIntegrationResponse_tags,
    putIntegrationResponse_httpStatus,
    putIntegrationResponse_domainName,
    putIntegrationResponse_uri,
    putIntegrationResponse_objectTypeName,
    putIntegrationResponse_createdAt,
    putIntegrationResponse_lastUpdatedAt,
  )
where

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

-- | /See:/ 'newPutIntegration' smart constructor.
data PutIntegration = PutIntegration'
  { -- | The configuration that controls how Customer Profiles retrieves data
    -- from the source.
    PutIntegration -> Maybe FlowDefinition
flowDefinition :: Prelude.Maybe FlowDefinition,
    -- | The URI of the S3 bucket or any other type of data source.
    PutIntegration -> Maybe Text
uri :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for this resource.
    PutIntegration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique name of the domain.
    PutIntegration -> Text
domainName :: Prelude.Text,
    -- | The name of the profile object type.
    PutIntegration -> Text
objectTypeName :: Prelude.Text
  }
  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:
--
-- 'flowDefinition', 'putIntegration_flowDefinition' - The configuration that controls how Customer Profiles retrieves data
-- from the source.
--
-- 'uri', 'putIntegration_uri' - The URI of the S3 bucket or any other type of data source.
--
-- 'tags', 'putIntegration_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'domainName', 'putIntegration_domainName' - The unique name of the domain.
--
-- 'objectTypeName', 'putIntegration_objectTypeName' - The name of the profile object type.
newPutIntegration ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'objectTypeName'
  Prelude.Text ->
  PutIntegration
newPutIntegration :: Text -> Text -> PutIntegration
newPutIntegration Text
pDomainName_ Text
pObjectTypeName_ =
  PutIntegration' :: Maybe FlowDefinition
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> PutIntegration
PutIntegration'
    { $sel:flowDefinition:PutIntegration' :: Maybe FlowDefinition
flowDefinition = Maybe FlowDefinition
forall a. Maybe a
Prelude.Nothing,
      $sel:uri:PutIntegration' :: Maybe Text
uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PutIntegration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:PutIntegration' :: Text
domainName = Text
pDomainName_,
      $sel:objectTypeName:PutIntegration' :: Text
objectTypeName = Text
pObjectTypeName_
    }

-- | The configuration that controls how Customer Profiles retrieves data
-- from the source.
putIntegration_flowDefinition :: Lens.Lens' PutIntegration (Prelude.Maybe FlowDefinition)
putIntegration_flowDefinition :: (Maybe FlowDefinition -> f (Maybe FlowDefinition))
-> PutIntegration -> f PutIntegration
putIntegration_flowDefinition = (PutIntegration -> Maybe FlowDefinition)
-> (PutIntegration -> Maybe FlowDefinition -> PutIntegration)
-> Lens
     PutIntegration
     PutIntegration
     (Maybe FlowDefinition)
     (Maybe FlowDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegration' {Maybe FlowDefinition
flowDefinition :: Maybe FlowDefinition
$sel:flowDefinition:PutIntegration' :: PutIntegration -> Maybe FlowDefinition
flowDefinition} -> Maybe FlowDefinition
flowDefinition) (\s :: PutIntegration
s@PutIntegration' {} Maybe FlowDefinition
a -> PutIntegration
s {$sel:flowDefinition:PutIntegration' :: Maybe FlowDefinition
flowDefinition = Maybe FlowDefinition
a} :: PutIntegration)

-- | The URI of the S3 bucket or any other type of data source.
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)

-- | The tags used to organize, track, or control access for this resource.
putIntegration_tags :: Lens.Lens' PutIntegration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
putIntegration_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutIntegration -> f PutIntegration
putIntegration_tags = (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)
tags :: Maybe (HashMap Text Text)
$sel:tags:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PutIntegration
s@PutIntegration' {} Maybe (HashMap Text Text)
a -> PutIntegration
s {$sel:tags:PutIntegration' :: Maybe (HashMap Text Text)
tags = 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

-- | The unique name of the domain.
putIntegration_domainName :: Lens.Lens' PutIntegration Prelude.Text
putIntegration_domainName :: (Text -> f Text) -> PutIntegration -> f PutIntegration
putIntegration_domainName = (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
domainName :: Text
$sel:domainName:PutIntegration' :: PutIntegration -> Text
domainName} -> Text
domainName) (\s :: PutIntegration
s@PutIntegration' {} Text
a -> PutIntegration
s {$sel:domainName:PutIntegration' :: Text
domainName = Text
a} :: PutIntegration)

-- | The name of the profile object type.
putIntegration_objectTypeName :: Lens.Lens' PutIntegration Prelude.Text
putIntegration_objectTypeName :: (Text -> f Text) -> PutIntegration -> f PutIntegration
putIntegration_objectTypeName = (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
objectTypeName :: Text
$sel:objectTypeName:PutIntegration' :: PutIntegration -> Text
objectTypeName} -> Text
objectTypeName) (\s :: PutIntegration
s@PutIntegration' {} Text
a -> PutIntegration
s {$sel:objectTypeName:PutIntegration' :: Text
objectTypeName = Text
a} :: PutIntegration)

instance Core.AWSRequest PutIntegration where
  type
    AWSResponse PutIntegration =
      PutIntegrationResponse
  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 ->
          Maybe (HashMap Text Text)
-> Int
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> PutIntegrationResponse
PutIntegrationResponse'
            (Maybe (HashMap Text Text)
 -> Int
 -> Text
 -> Text
 -> Text
 -> POSIX
 -> POSIX
 -> PutIntegrationResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Int
      -> Text
      -> Text
      -> Text
      -> POSIX
      -> POSIX
      -> PutIntegrationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Int
   -> Text
   -> Text
   -> Text
   -> POSIX
   -> POSIX
   -> PutIntegrationResponse)
-> Either String Int
-> Either
     String
     (Text -> Text -> Text -> POSIX -> POSIX -> PutIntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  (Text -> Text -> Text -> POSIX -> POSIX -> PutIntegrationResponse)
-> Either String Text
-> Either
     String (Text -> Text -> POSIX -> POSIX -> PutIntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DomainName")
            Either
  String (Text -> Text -> POSIX -> POSIX -> PutIntegrationResponse)
-> Either String Text
-> Either String (Text -> POSIX -> POSIX -> PutIntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Uri")
            Either String (Text -> POSIX -> POSIX -> PutIntegrationResponse)
-> Either String Text
-> Either String (POSIX -> POSIX -> PutIntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ObjectTypeName")
            Either String (POSIX -> POSIX -> PutIntegrationResponse)
-> Either String POSIX
-> Either String (POSIX -> PutIntegrationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"CreatedAt")
            Either String (POSIX -> PutIntegrationResponse)
-> Either String POSIX -> Either String PutIntegrationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"LastUpdatedAt")
      )

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
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PutIntegration where
  toJSON :: PutIntegration -> Value
toJSON PutIntegration' {Maybe Text
Maybe (HashMap Text Text)
Maybe FlowDefinition
Text
objectTypeName :: Text
domainName :: Text
tags :: Maybe (HashMap Text Text)
uri :: Maybe Text
flowDefinition :: Maybe FlowDefinition
$sel:objectTypeName:PutIntegration' :: PutIntegration -> Text
$sel:domainName:PutIntegration' :: PutIntegration -> Text
$sel:tags:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
$sel:uri:PutIntegration' :: PutIntegration -> Maybe Text
$sel:flowDefinition:PutIntegration' :: PutIntegration -> Maybe FlowDefinition
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FlowDefinition" Text -> FlowDefinition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (FlowDefinition -> Pair) -> Maybe FlowDefinition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FlowDefinition
flowDefinition,
            (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
"Tags" 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)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ObjectTypeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
objectTypeName)
          ]
      )

instance Core.ToPath PutIntegration where
  toPath :: PutIntegration -> ByteString
toPath PutIntegration' {Maybe Text
Maybe (HashMap Text Text)
Maybe FlowDefinition
Text
objectTypeName :: Text
domainName :: Text
tags :: Maybe (HashMap Text Text)
uri :: Maybe Text
flowDefinition :: Maybe FlowDefinition
$sel:objectTypeName:PutIntegration' :: PutIntegration -> Text
$sel:domainName:PutIntegration' :: PutIntegration -> Text
$sel:tags:PutIntegration' :: PutIntegration -> Maybe (HashMap Text Text)
$sel:uri:PutIntegration' :: PutIntegration -> Maybe Text
$sel:flowDefinition:PutIntegration' :: PutIntegration -> Maybe FlowDefinition
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/domains/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName, ByteString
"/integrations"]

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

-- | /See:/ 'newPutIntegrationResponse' smart constructor.
data PutIntegrationResponse = PutIntegrationResponse'
  { -- | The tags used to organize, track, or control access for this resource.
    PutIntegrationResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    PutIntegrationResponse -> Int
httpStatus :: Prelude.Int,
    -- | The unique name of the domain.
    PutIntegrationResponse -> Text
domainName :: Prelude.Text,
    -- | The URI of the S3 bucket or any other type of data source.
    PutIntegrationResponse -> Text
uri :: Prelude.Text,
    -- | The name of the profile object type.
    PutIntegrationResponse -> Text
objectTypeName :: Prelude.Text,
    -- | The timestamp of when the domain was created.
    PutIntegrationResponse -> POSIX
createdAt :: Core.POSIX,
    -- | The timestamp of when the domain was most recently edited.
    PutIntegrationResponse -> POSIX
lastUpdatedAt :: Core.POSIX
  }
  deriving (PutIntegrationResponse -> PutIntegrationResponse -> Bool
(PutIntegrationResponse -> PutIntegrationResponse -> Bool)
-> (PutIntegrationResponse -> PutIntegrationResponse -> Bool)
-> Eq PutIntegrationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutIntegrationResponse -> PutIntegrationResponse -> Bool
$c/= :: PutIntegrationResponse -> PutIntegrationResponse -> Bool
== :: PutIntegrationResponse -> PutIntegrationResponse -> Bool
$c== :: PutIntegrationResponse -> PutIntegrationResponse -> Bool
Prelude.Eq, ReadPrec [PutIntegrationResponse]
ReadPrec PutIntegrationResponse
Int -> ReadS PutIntegrationResponse
ReadS [PutIntegrationResponse]
(Int -> ReadS PutIntegrationResponse)
-> ReadS [PutIntegrationResponse]
-> ReadPrec PutIntegrationResponse
-> ReadPrec [PutIntegrationResponse]
-> Read PutIntegrationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutIntegrationResponse]
$creadListPrec :: ReadPrec [PutIntegrationResponse]
readPrec :: ReadPrec PutIntegrationResponse
$creadPrec :: ReadPrec PutIntegrationResponse
readList :: ReadS [PutIntegrationResponse]
$creadList :: ReadS [PutIntegrationResponse]
readsPrec :: Int -> ReadS PutIntegrationResponse
$creadsPrec :: Int -> ReadS PutIntegrationResponse
Prelude.Read, Int -> PutIntegrationResponse -> ShowS
[PutIntegrationResponse] -> ShowS
PutIntegrationResponse -> String
(Int -> PutIntegrationResponse -> ShowS)
-> (PutIntegrationResponse -> String)
-> ([PutIntegrationResponse] -> ShowS)
-> Show PutIntegrationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutIntegrationResponse] -> ShowS
$cshowList :: [PutIntegrationResponse] -> ShowS
show :: PutIntegrationResponse -> String
$cshow :: PutIntegrationResponse -> String
showsPrec :: Int -> PutIntegrationResponse -> ShowS
$cshowsPrec :: Int -> PutIntegrationResponse -> ShowS
Prelude.Show, (forall x. PutIntegrationResponse -> Rep PutIntegrationResponse x)
-> (forall x.
    Rep PutIntegrationResponse x -> PutIntegrationResponse)
-> Generic PutIntegrationResponse
forall x. Rep PutIntegrationResponse x -> PutIntegrationResponse
forall x. PutIntegrationResponse -> Rep PutIntegrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutIntegrationResponse x -> PutIntegrationResponse
$cfrom :: forall x. PutIntegrationResponse -> Rep PutIntegrationResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutIntegrationResponse' 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:
--
-- 'tags', 'putIntegrationResponse_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'httpStatus', 'putIntegrationResponse_httpStatus' - The response's http status code.
--
-- 'domainName', 'putIntegrationResponse_domainName' - The unique name of the domain.
--
-- 'uri', 'putIntegrationResponse_uri' - The URI of the S3 bucket or any other type of data source.
--
-- 'objectTypeName', 'putIntegrationResponse_objectTypeName' - The name of the profile object type.
--
-- 'createdAt', 'putIntegrationResponse_createdAt' - The timestamp of when the domain was created.
--
-- 'lastUpdatedAt', 'putIntegrationResponse_lastUpdatedAt' - The timestamp of when the domain was most recently edited.
newPutIntegrationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'domainName'
  Prelude.Text ->
  -- | 'uri'
  Prelude.Text ->
  -- | 'objectTypeName'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'lastUpdatedAt'
  Prelude.UTCTime ->
  PutIntegrationResponse
newPutIntegrationResponse :: Int
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> PutIntegrationResponse
newPutIntegrationResponse
  Int
pHttpStatus_
  Text
pDomainName_
  Text
pUri_
  Text
pObjectTypeName_
  UTCTime
pCreatedAt_
  UTCTime
pLastUpdatedAt_ =
    PutIntegrationResponse' :: Maybe (HashMap Text Text)
-> Int
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> PutIntegrationResponse
PutIntegrationResponse'
      { $sel:tags:PutIntegrationResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:PutIntegrationResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:domainName:PutIntegrationResponse' :: Text
domainName = Text
pDomainName_,
        $sel:uri:PutIntegrationResponse' :: Text
uri = Text
pUri_,
        $sel:objectTypeName:PutIntegrationResponse' :: Text
objectTypeName = Text
pObjectTypeName_,
        $sel:createdAt:PutIntegrationResponse' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:lastUpdatedAt:PutIntegrationResponse' :: POSIX
lastUpdatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdatedAt_
      }

-- | The tags used to organize, track, or control access for this resource.
putIntegrationResponse_tags :: Lens.Lens' PutIntegrationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
putIntegrationResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutIntegrationResponse -> f PutIntegrationResponse
putIntegrationResponse_tags = (PutIntegrationResponse -> Maybe (HashMap Text Text))
-> (PutIntegrationResponse
    -> Maybe (HashMap Text Text) -> PutIntegrationResponse)
-> Lens
     PutIntegrationResponse
     PutIntegrationResponse
     (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 (\PutIntegrationResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:PutIntegrationResponse' :: PutIntegrationResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PutIntegrationResponse
s@PutIntegrationResponse' {} Maybe (HashMap Text Text)
a -> PutIntegrationResponse
s {$sel:tags:PutIntegrationResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: PutIntegrationResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PutIntegrationResponse -> f PutIntegrationResponse)
-> ((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)))
-> PutIntegrationResponse
-> f PutIntegrationResponse
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

-- | The response's http status code.
putIntegrationResponse_httpStatus :: Lens.Lens' PutIntegrationResponse Prelude.Int
putIntegrationResponse_httpStatus :: (Int -> f Int)
-> PutIntegrationResponse -> f PutIntegrationResponse
putIntegrationResponse_httpStatus = (PutIntegrationResponse -> Int)
-> (PutIntegrationResponse -> Int -> PutIntegrationResponse)
-> Lens PutIntegrationResponse PutIntegrationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegrationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutIntegrationResponse' :: PutIntegrationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutIntegrationResponse
s@PutIntegrationResponse' {} Int
a -> PutIntegrationResponse
s {$sel:httpStatus:PutIntegrationResponse' :: Int
httpStatus = Int
a} :: PutIntegrationResponse)

-- | The unique name of the domain.
putIntegrationResponse_domainName :: Lens.Lens' PutIntegrationResponse Prelude.Text
putIntegrationResponse_domainName :: (Text -> f Text)
-> PutIntegrationResponse -> f PutIntegrationResponse
putIntegrationResponse_domainName = (PutIntegrationResponse -> Text)
-> (PutIntegrationResponse -> Text -> PutIntegrationResponse)
-> Lens PutIntegrationResponse PutIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegrationResponse' {Text
domainName :: Text
$sel:domainName:PutIntegrationResponse' :: PutIntegrationResponse -> Text
domainName} -> Text
domainName) (\s :: PutIntegrationResponse
s@PutIntegrationResponse' {} Text
a -> PutIntegrationResponse
s {$sel:domainName:PutIntegrationResponse' :: Text
domainName = Text
a} :: PutIntegrationResponse)

-- | The URI of the S3 bucket or any other type of data source.
putIntegrationResponse_uri :: Lens.Lens' PutIntegrationResponse Prelude.Text
putIntegrationResponse_uri :: (Text -> f Text)
-> PutIntegrationResponse -> f PutIntegrationResponse
putIntegrationResponse_uri = (PutIntegrationResponse -> Text)
-> (PutIntegrationResponse -> Text -> PutIntegrationResponse)
-> Lens PutIntegrationResponse PutIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegrationResponse' {Text
uri :: Text
$sel:uri:PutIntegrationResponse' :: PutIntegrationResponse -> Text
uri} -> Text
uri) (\s :: PutIntegrationResponse
s@PutIntegrationResponse' {} Text
a -> PutIntegrationResponse
s {$sel:uri:PutIntegrationResponse' :: Text
uri = Text
a} :: PutIntegrationResponse)

-- | The name of the profile object type.
putIntegrationResponse_objectTypeName :: Lens.Lens' PutIntegrationResponse Prelude.Text
putIntegrationResponse_objectTypeName :: (Text -> f Text)
-> PutIntegrationResponse -> f PutIntegrationResponse
putIntegrationResponse_objectTypeName = (PutIntegrationResponse -> Text)
-> (PutIntegrationResponse -> Text -> PutIntegrationResponse)
-> Lens PutIntegrationResponse PutIntegrationResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegrationResponse' {Text
objectTypeName :: Text
$sel:objectTypeName:PutIntegrationResponse' :: PutIntegrationResponse -> Text
objectTypeName} -> Text
objectTypeName) (\s :: PutIntegrationResponse
s@PutIntegrationResponse' {} Text
a -> PutIntegrationResponse
s {$sel:objectTypeName:PutIntegrationResponse' :: Text
objectTypeName = Text
a} :: PutIntegrationResponse)

-- | The timestamp of when the domain was created.
putIntegrationResponse_createdAt :: Lens.Lens' PutIntegrationResponse Prelude.UTCTime
putIntegrationResponse_createdAt :: (UTCTime -> f UTCTime)
-> PutIntegrationResponse -> f PutIntegrationResponse
putIntegrationResponse_createdAt = (PutIntegrationResponse -> POSIX)
-> (PutIntegrationResponse -> POSIX -> PutIntegrationResponse)
-> Lens PutIntegrationResponse PutIntegrationResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegrationResponse' {POSIX
createdAt :: POSIX
$sel:createdAt:PutIntegrationResponse' :: PutIntegrationResponse -> POSIX
createdAt} -> POSIX
createdAt) (\s :: PutIntegrationResponse
s@PutIntegrationResponse' {} POSIX
a -> PutIntegrationResponse
s {$sel:createdAt:PutIntegrationResponse' :: POSIX
createdAt = POSIX
a} :: PutIntegrationResponse) ((POSIX -> f POSIX)
 -> PutIntegrationResponse -> f PutIntegrationResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> PutIntegrationResponse
-> f PutIntegrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The timestamp of when the domain was most recently edited.
putIntegrationResponse_lastUpdatedAt :: Lens.Lens' PutIntegrationResponse Prelude.UTCTime
putIntegrationResponse_lastUpdatedAt :: (UTCTime -> f UTCTime)
-> PutIntegrationResponse -> f PutIntegrationResponse
putIntegrationResponse_lastUpdatedAt = (PutIntegrationResponse -> POSIX)
-> (PutIntegrationResponse -> POSIX -> PutIntegrationResponse)
-> Lens PutIntegrationResponse PutIntegrationResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutIntegrationResponse' {POSIX
lastUpdatedAt :: POSIX
$sel:lastUpdatedAt:PutIntegrationResponse' :: PutIntegrationResponse -> POSIX
lastUpdatedAt} -> POSIX
lastUpdatedAt) (\s :: PutIntegrationResponse
s@PutIntegrationResponse' {} POSIX
a -> PutIntegrationResponse
s {$sel:lastUpdatedAt:PutIntegrationResponse' :: POSIX
lastUpdatedAt = POSIX
a} :: PutIntegrationResponse) ((POSIX -> f POSIX)
 -> PutIntegrationResponse -> f PutIntegrationResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> PutIntegrationResponse
-> f PutIntegrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Prelude.NFData PutIntegrationResponse