{-# 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.CreateDomain
-- 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)
--
-- Creates a domain, which is a container for all customer data, such as
-- customer profile attributes, object types, profile keys, and encryption
-- keys. You can create multiple domains, and each domain can have multiple
-- third-party integrations.
--
-- Each Amazon Connect instance can be associated with only one domain.
-- Multiple Amazon Connect instances can be associated with one domain.
--
-- Use this API or
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UpdateDomain.html UpdateDomain>
-- to enable
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html identity resolution>:
-- set @Matching@ to true.
module Amazonka.CustomerProfiles.CreateDomain
  ( -- * Creating a Request
    CreateDomain (..),
    newCreateDomain,

    -- * Request Lenses
    createDomain_defaultEncryptionKey,
    createDomain_matching,
    createDomain_deadLetterQueueUrl,
    createDomain_tags,
    createDomain_domainName,
    createDomain_defaultExpirationDays,

    -- * Destructuring the Response
    CreateDomainResponse (..),
    newCreateDomainResponse,

    -- * Response Lenses
    createDomainResponse_defaultEncryptionKey,
    createDomainResponse_matching,
    createDomainResponse_deadLetterQueueUrl,
    createDomainResponse_tags,
    createDomainResponse_httpStatus,
    createDomainResponse_domainName,
    createDomainResponse_defaultExpirationDays,
    createDomainResponse_createdAt,
    createDomainResponse_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:/ 'newCreateDomain' smart constructor.
data CreateDomain = CreateDomain'
  { -- | The default encryption key, which is an AWS managed key, is used when no
    -- specific type of encryption key is specified. It is used to encrypt all
    -- data before it is placed in permanent or semi-permanent storage.
    CreateDomain -> Maybe Text
defaultEncryptionKey :: Prelude.Maybe Prelude.Text,
    -- | The process of matching duplicate profiles. If Matching = true, Amazon
    -- Connect Customer Profiles starts a weekly batch process every Saturday
    -- at 12AM UTC to detect duplicate profiles in your domains. After that
    -- batch process completes, use the
    -- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html GetMatches>
    -- API to return and review the results.
    CreateDomain -> Maybe MatchingRequest
matching :: Prelude.Maybe MatchingRequest,
    -- | The URL of the SQS dead letter queue, which is used for reporting errors
    -- associated with ingesting data from third party applications. You must
    -- set up a policy on the DeadLetterQueue for the SendMessage operation to
    -- enable Amazon Connect Customer Profiles to send messages to the
    -- DeadLetterQueue.
    CreateDomain -> Maybe Text
deadLetterQueueUrl :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for this resource.
    CreateDomain -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique name of the domain.
    CreateDomain -> Text
domainName :: Prelude.Text,
    -- | The default number of days until the data within the domain expires.
    CreateDomain -> Natural
defaultExpirationDays :: Prelude.Natural
  }
  deriving (CreateDomain -> CreateDomain -> Bool
(CreateDomain -> CreateDomain -> Bool)
-> (CreateDomain -> CreateDomain -> Bool) -> Eq CreateDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDomain -> CreateDomain -> Bool
$c/= :: CreateDomain -> CreateDomain -> Bool
== :: CreateDomain -> CreateDomain -> Bool
$c== :: CreateDomain -> CreateDomain -> Bool
Prelude.Eq, ReadPrec [CreateDomain]
ReadPrec CreateDomain
Int -> ReadS CreateDomain
ReadS [CreateDomain]
(Int -> ReadS CreateDomain)
-> ReadS [CreateDomain]
-> ReadPrec CreateDomain
-> ReadPrec [CreateDomain]
-> Read CreateDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDomain]
$creadListPrec :: ReadPrec [CreateDomain]
readPrec :: ReadPrec CreateDomain
$creadPrec :: ReadPrec CreateDomain
readList :: ReadS [CreateDomain]
$creadList :: ReadS [CreateDomain]
readsPrec :: Int -> ReadS CreateDomain
$creadsPrec :: Int -> ReadS CreateDomain
Prelude.Read, Int -> CreateDomain -> ShowS
[CreateDomain] -> ShowS
CreateDomain -> String
(Int -> CreateDomain -> ShowS)
-> (CreateDomain -> String)
-> ([CreateDomain] -> ShowS)
-> Show CreateDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDomain] -> ShowS
$cshowList :: [CreateDomain] -> ShowS
show :: CreateDomain -> String
$cshow :: CreateDomain -> String
showsPrec :: Int -> CreateDomain -> ShowS
$cshowsPrec :: Int -> CreateDomain -> ShowS
Prelude.Show, (forall x. CreateDomain -> Rep CreateDomain x)
-> (forall x. Rep CreateDomain x -> CreateDomain)
-> Generic CreateDomain
forall x. Rep CreateDomain x -> CreateDomain
forall x. CreateDomain -> Rep CreateDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDomain x -> CreateDomain
$cfrom :: forall x. CreateDomain -> Rep CreateDomain x
Prelude.Generic)

-- |
-- Create a value of 'CreateDomain' 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:
--
-- 'defaultEncryptionKey', 'createDomain_defaultEncryptionKey' - The default encryption key, which is an AWS managed key, is used when no
-- specific type of encryption key is specified. It is used to encrypt all
-- data before it is placed in permanent or semi-permanent storage.
--
-- 'matching', 'createDomain_matching' - The process of matching duplicate profiles. If Matching = true, Amazon
-- Connect Customer Profiles starts a weekly batch process every Saturday
-- at 12AM UTC to detect duplicate profiles in your domains. After that
-- batch process completes, use the
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html GetMatches>
-- API to return and review the results.
--
-- 'deadLetterQueueUrl', 'createDomain_deadLetterQueueUrl' - The URL of the SQS dead letter queue, which is used for reporting errors
-- associated with ingesting data from third party applications. You must
-- set up a policy on the DeadLetterQueue for the SendMessage operation to
-- enable Amazon Connect Customer Profiles to send messages to the
-- DeadLetterQueue.
--
-- 'tags', 'createDomain_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'domainName', 'createDomain_domainName' - The unique name of the domain.
--
-- 'defaultExpirationDays', 'createDomain_defaultExpirationDays' - The default number of days until the data within the domain expires.
newCreateDomain ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'defaultExpirationDays'
  Prelude.Natural ->
  CreateDomain
newCreateDomain :: Text -> Natural -> CreateDomain
newCreateDomain Text
pDomainName_ Natural
pDefaultExpirationDays_ =
  CreateDomain' :: Maybe Text
-> Maybe MatchingRequest
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Natural
-> CreateDomain
CreateDomain'
    { $sel:defaultEncryptionKey:CreateDomain' :: Maybe Text
defaultEncryptionKey =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:matching:CreateDomain' :: Maybe MatchingRequest
matching = Maybe MatchingRequest
forall a. Maybe a
Prelude.Nothing,
      $sel:deadLetterQueueUrl:CreateDomain' :: Maybe Text
deadLetterQueueUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateDomain' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:CreateDomain' :: Text
domainName = Text
pDomainName_,
      $sel:defaultExpirationDays:CreateDomain' :: Natural
defaultExpirationDays = Natural
pDefaultExpirationDays_
    }

-- | The default encryption key, which is an AWS managed key, is used when no
-- specific type of encryption key is specified. It is used to encrypt all
-- data before it is placed in permanent or semi-permanent storage.
createDomain_defaultEncryptionKey :: Lens.Lens' CreateDomain (Prelude.Maybe Prelude.Text)
createDomain_defaultEncryptionKey :: (Maybe Text -> f (Maybe Text)) -> CreateDomain -> f CreateDomain
createDomain_defaultEncryptionKey = (CreateDomain -> Maybe Text)
-> (CreateDomain -> Maybe Text -> CreateDomain)
-> Lens CreateDomain CreateDomain (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe Text
defaultEncryptionKey :: Maybe Text
$sel:defaultEncryptionKey:CreateDomain' :: CreateDomain -> Maybe Text
defaultEncryptionKey} -> Maybe Text
defaultEncryptionKey) (\s :: CreateDomain
s@CreateDomain' {} Maybe Text
a -> CreateDomain
s {$sel:defaultEncryptionKey:CreateDomain' :: Maybe Text
defaultEncryptionKey = Maybe Text
a} :: CreateDomain)

-- | The process of matching duplicate profiles. If Matching = true, Amazon
-- Connect Customer Profiles starts a weekly batch process every Saturday
-- at 12AM UTC to detect duplicate profiles in your domains. After that
-- batch process completes, use the
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html GetMatches>
-- API to return and review the results.
createDomain_matching :: Lens.Lens' CreateDomain (Prelude.Maybe MatchingRequest)
createDomain_matching :: (Maybe MatchingRequest -> f (Maybe MatchingRequest))
-> CreateDomain -> f CreateDomain
createDomain_matching = (CreateDomain -> Maybe MatchingRequest)
-> (CreateDomain -> Maybe MatchingRequest -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe MatchingRequest)
     (Maybe MatchingRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe MatchingRequest
matching :: Maybe MatchingRequest
$sel:matching:CreateDomain' :: CreateDomain -> Maybe MatchingRequest
matching} -> Maybe MatchingRequest
matching) (\s :: CreateDomain
s@CreateDomain' {} Maybe MatchingRequest
a -> CreateDomain
s {$sel:matching:CreateDomain' :: Maybe MatchingRequest
matching = Maybe MatchingRequest
a} :: CreateDomain)

-- | The URL of the SQS dead letter queue, which is used for reporting errors
-- associated with ingesting data from third party applications. You must
-- set up a policy on the DeadLetterQueue for the SendMessage operation to
-- enable Amazon Connect Customer Profiles to send messages to the
-- DeadLetterQueue.
createDomain_deadLetterQueueUrl :: Lens.Lens' CreateDomain (Prelude.Maybe Prelude.Text)
createDomain_deadLetterQueueUrl :: (Maybe Text -> f (Maybe Text)) -> CreateDomain -> f CreateDomain
createDomain_deadLetterQueueUrl = (CreateDomain -> Maybe Text)
-> (CreateDomain -> Maybe Text -> CreateDomain)
-> Lens CreateDomain CreateDomain (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe Text
deadLetterQueueUrl :: Maybe Text
$sel:deadLetterQueueUrl:CreateDomain' :: CreateDomain -> Maybe Text
deadLetterQueueUrl} -> Maybe Text
deadLetterQueueUrl) (\s :: CreateDomain
s@CreateDomain' {} Maybe Text
a -> CreateDomain
s {$sel:deadLetterQueueUrl:CreateDomain' :: Maybe Text
deadLetterQueueUrl = Maybe Text
a} :: CreateDomain)

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

-- | The default number of days until the data within the domain expires.
createDomain_defaultExpirationDays :: Lens.Lens' CreateDomain Prelude.Natural
createDomain_defaultExpirationDays :: (Natural -> f Natural) -> CreateDomain -> f CreateDomain
createDomain_defaultExpirationDays = (CreateDomain -> Natural)
-> (CreateDomain -> Natural -> CreateDomain)
-> Lens CreateDomain CreateDomain Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Natural
defaultExpirationDays :: Natural
$sel:defaultExpirationDays:CreateDomain' :: CreateDomain -> Natural
defaultExpirationDays} -> Natural
defaultExpirationDays) (\s :: CreateDomain
s@CreateDomain' {} Natural
a -> CreateDomain
s {$sel:defaultExpirationDays:CreateDomain' :: Natural
defaultExpirationDays = Natural
a} :: CreateDomain)

instance Core.AWSRequest CreateDomain where
  type AWSResponse CreateDomain = CreateDomainResponse
  request :: CreateDomain -> Request CreateDomain
request = Service -> CreateDomain -> Request CreateDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDomain)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDomain))
-> Logger
-> Service
-> Proxy CreateDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDomain)))
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 Text
-> Maybe MatchingResponse
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse
CreateDomainResponse'
            (Maybe Text
 -> Maybe MatchingResponse
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> Text
 -> Natural
 -> POSIX
 -> POSIX
 -> CreateDomainResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe MatchingResponse
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> Text
      -> Natural
      -> POSIX
      -> POSIX
      -> CreateDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DefaultEncryptionKey")
            Either
  String
  (Maybe MatchingResponse
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> Text
   -> Natural
   -> POSIX
   -> POSIX
   -> CreateDomainResponse)
-> Either String (Maybe MatchingResponse)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> Text
      -> Natural
      -> POSIX
      -> POSIX
      -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe MatchingResponse)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Matching")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> Text
   -> Natural
   -> POSIX
   -> POSIX
   -> CreateDomainResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Int
      -> Text
      -> Natural
      -> POSIX
      -> POSIX
      -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeadLetterQueueUrl")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Int
   -> Text
   -> Natural
   -> POSIX
   -> POSIX
   -> CreateDomainResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Int -> Text -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
-> Either String Int
-> Either
     String (Text -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
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 -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
-> Either String Text
-> Either
     String (Natural -> POSIX -> POSIX -> CreateDomainResponse)
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 (Natural -> POSIX -> POSIX -> CreateDomainResponse)
-> Either String Natural
-> Either String (POSIX -> POSIX -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Natural
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DefaultExpirationDays")
            Either String (POSIX -> POSIX -> CreateDomainResponse)
-> Either String POSIX
-> Either String (POSIX -> CreateDomainResponse)
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 -> CreateDomainResponse)
-> Either String POSIX -> Either String CreateDomainResponse
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 CreateDomain

instance Prelude.NFData CreateDomain

instance Core.ToHeaders CreateDomain where
  toHeaders :: CreateDomain -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDomain -> 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 CreateDomain where
  toJSON :: CreateDomain -> Value
toJSON CreateDomain' {Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe MatchingRequest
Text
defaultExpirationDays :: Natural
domainName :: Text
tags :: Maybe (HashMap Text Text)
deadLetterQueueUrl :: Maybe Text
matching :: Maybe MatchingRequest
defaultEncryptionKey :: Maybe Text
$sel:defaultExpirationDays:CreateDomain' :: CreateDomain -> Natural
$sel:domainName:CreateDomain' :: CreateDomain -> Text
$sel:tags:CreateDomain' :: CreateDomain -> Maybe (HashMap Text Text)
$sel:deadLetterQueueUrl:CreateDomain' :: CreateDomain -> Maybe Text
$sel:matching:CreateDomain' :: CreateDomain -> Maybe MatchingRequest
$sel:defaultEncryptionKey:CreateDomain' :: CreateDomain -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DefaultEncryptionKey" 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
defaultEncryptionKey,
            (Text
"Matching" Text -> MatchingRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MatchingRequest -> Pair) -> Maybe MatchingRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MatchingRequest
matching,
            (Text
"DeadLetterQueueUrl" 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
deadLetterQueueUrl,
            (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
"DefaultExpirationDays"
                  Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
defaultExpirationDays
              )
          ]
      )

instance Core.ToPath CreateDomain where
  toPath :: CreateDomain -> ByteString
toPath CreateDomain' {Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe MatchingRequest
Text
defaultExpirationDays :: Natural
domainName :: Text
tags :: Maybe (HashMap Text Text)
deadLetterQueueUrl :: Maybe Text
matching :: Maybe MatchingRequest
defaultEncryptionKey :: Maybe Text
$sel:defaultExpirationDays:CreateDomain' :: CreateDomain -> Natural
$sel:domainName:CreateDomain' :: CreateDomain -> Text
$sel:tags:CreateDomain' :: CreateDomain -> Maybe (HashMap Text Text)
$sel:deadLetterQueueUrl:CreateDomain' :: CreateDomain -> Maybe Text
$sel:matching:CreateDomain' :: CreateDomain -> Maybe MatchingRequest
$sel:defaultEncryptionKey:CreateDomain' :: CreateDomain -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/domains/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName]

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

-- | /See:/ 'newCreateDomainResponse' smart constructor.
data CreateDomainResponse = CreateDomainResponse'
  { -- | The default encryption key, which is an AWS managed key, is used when no
    -- specific type of encryption key is specified. It is used to encrypt all
    -- data before it is placed in permanent or semi-permanent storage.
    CreateDomainResponse -> Maybe Text
defaultEncryptionKey :: Prelude.Maybe Prelude.Text,
    -- | The process of matching duplicate profiles. If Matching = true, Amazon
    -- Connect Customer Profiles starts a weekly batch process every Saturday
    -- at 12AM UTC to detect duplicate profiles in your domains. After that
    -- batch process completes, use the
    -- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html GetMatches>
    -- API to return and review the results.
    CreateDomainResponse -> Maybe MatchingResponse
matching :: Prelude.Maybe MatchingResponse,
    -- | The URL of the SQS dead letter queue, which is used for reporting errors
    -- associated with ingesting data from third party applications.
    CreateDomainResponse -> Maybe Text
deadLetterQueueUrl :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for this resource.
    CreateDomainResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateDomainResponse -> Int
httpStatus :: Prelude.Int,
    -- | The unique name of the domain.
    CreateDomainResponse -> Text
domainName :: Prelude.Text,
    -- | The default number of days until the data within the domain expires.
    CreateDomainResponse -> Natural
defaultExpirationDays :: Prelude.Natural,
    -- | The timestamp of when the domain was created.
    CreateDomainResponse -> POSIX
createdAt :: Core.POSIX,
    -- | The timestamp of when the domain was most recently edited.
    CreateDomainResponse -> POSIX
lastUpdatedAt :: Core.POSIX
  }
  deriving (CreateDomainResponse -> CreateDomainResponse -> Bool
(CreateDomainResponse -> CreateDomainResponse -> Bool)
-> (CreateDomainResponse -> CreateDomainResponse -> Bool)
-> Eq CreateDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDomainResponse -> CreateDomainResponse -> Bool
$c/= :: CreateDomainResponse -> CreateDomainResponse -> Bool
== :: CreateDomainResponse -> CreateDomainResponse -> Bool
$c== :: CreateDomainResponse -> CreateDomainResponse -> Bool
Prelude.Eq, ReadPrec [CreateDomainResponse]
ReadPrec CreateDomainResponse
Int -> ReadS CreateDomainResponse
ReadS [CreateDomainResponse]
(Int -> ReadS CreateDomainResponse)
-> ReadS [CreateDomainResponse]
-> ReadPrec CreateDomainResponse
-> ReadPrec [CreateDomainResponse]
-> Read CreateDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDomainResponse]
$creadListPrec :: ReadPrec [CreateDomainResponse]
readPrec :: ReadPrec CreateDomainResponse
$creadPrec :: ReadPrec CreateDomainResponse
readList :: ReadS [CreateDomainResponse]
$creadList :: ReadS [CreateDomainResponse]
readsPrec :: Int -> ReadS CreateDomainResponse
$creadsPrec :: Int -> ReadS CreateDomainResponse
Prelude.Read, Int -> CreateDomainResponse -> ShowS
[CreateDomainResponse] -> ShowS
CreateDomainResponse -> String
(Int -> CreateDomainResponse -> ShowS)
-> (CreateDomainResponse -> String)
-> ([CreateDomainResponse] -> ShowS)
-> Show CreateDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDomainResponse] -> ShowS
$cshowList :: [CreateDomainResponse] -> ShowS
show :: CreateDomainResponse -> String
$cshow :: CreateDomainResponse -> String
showsPrec :: Int -> CreateDomainResponse -> ShowS
$cshowsPrec :: Int -> CreateDomainResponse -> ShowS
Prelude.Show, (forall x. CreateDomainResponse -> Rep CreateDomainResponse x)
-> (forall x. Rep CreateDomainResponse x -> CreateDomainResponse)
-> Generic CreateDomainResponse
forall x. Rep CreateDomainResponse x -> CreateDomainResponse
forall x. CreateDomainResponse -> Rep CreateDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDomainResponse x -> CreateDomainResponse
$cfrom :: forall x. CreateDomainResponse -> Rep CreateDomainResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDomainResponse' 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:
--
-- 'defaultEncryptionKey', 'createDomainResponse_defaultEncryptionKey' - The default encryption key, which is an AWS managed key, is used when no
-- specific type of encryption key is specified. It is used to encrypt all
-- data before it is placed in permanent or semi-permanent storage.
--
-- 'matching', 'createDomainResponse_matching' - The process of matching duplicate profiles. If Matching = true, Amazon
-- Connect Customer Profiles starts a weekly batch process every Saturday
-- at 12AM UTC to detect duplicate profiles in your domains. After that
-- batch process completes, use the
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html GetMatches>
-- API to return and review the results.
--
-- 'deadLetterQueueUrl', 'createDomainResponse_deadLetterQueueUrl' - The URL of the SQS dead letter queue, which is used for reporting errors
-- associated with ingesting data from third party applications.
--
-- 'tags', 'createDomainResponse_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'httpStatus', 'createDomainResponse_httpStatus' - The response's http status code.
--
-- 'domainName', 'createDomainResponse_domainName' - The unique name of the domain.
--
-- 'defaultExpirationDays', 'createDomainResponse_defaultExpirationDays' - The default number of days until the data within the domain expires.
--
-- 'createdAt', 'createDomainResponse_createdAt' - The timestamp of when the domain was created.
--
-- 'lastUpdatedAt', 'createDomainResponse_lastUpdatedAt' - The timestamp of when the domain was most recently edited.
newCreateDomainResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'domainName'
  Prelude.Text ->
  -- | 'defaultExpirationDays'
  Prelude.Natural ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'lastUpdatedAt'
  Prelude.UTCTime ->
  CreateDomainResponse
newCreateDomainResponse :: Int
-> Text -> Natural -> UTCTime -> UTCTime -> CreateDomainResponse
newCreateDomainResponse
  Int
pHttpStatus_
  Text
pDomainName_
  Natural
pDefaultExpirationDays_
  UTCTime
pCreatedAt_
  UTCTime
pLastUpdatedAt_ =
    CreateDomainResponse' :: Maybe Text
-> Maybe MatchingResponse
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse
CreateDomainResponse'
      { $sel:defaultEncryptionKey:CreateDomainResponse' :: Maybe Text
defaultEncryptionKey =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:matching:CreateDomainResponse' :: Maybe MatchingResponse
matching = Maybe MatchingResponse
forall a. Maybe a
Prelude.Nothing,
        $sel:deadLetterQueueUrl:CreateDomainResponse' :: Maybe Text
deadLetterQueueUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateDomainResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateDomainResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:domainName:CreateDomainResponse' :: Text
domainName = Text
pDomainName_,
        $sel:defaultExpirationDays:CreateDomainResponse' :: Natural
defaultExpirationDays = Natural
pDefaultExpirationDays_,
        $sel:createdAt:CreateDomainResponse' :: 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:CreateDomainResponse' :: 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 default encryption key, which is an AWS managed key, is used when no
-- specific type of encryption key is specified. It is used to encrypt all
-- data before it is placed in permanent or semi-permanent storage.
createDomainResponse_defaultEncryptionKey :: Lens.Lens' CreateDomainResponse (Prelude.Maybe Prelude.Text)
createDomainResponse_defaultEncryptionKey :: (Maybe Text -> f (Maybe Text))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_defaultEncryptionKey = (CreateDomainResponse -> Maybe Text)
-> (CreateDomainResponse -> Maybe Text -> CreateDomainResponse)
-> Lens
     CreateDomainResponse CreateDomainResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe Text
defaultEncryptionKey :: Maybe Text
$sel:defaultEncryptionKey:CreateDomainResponse' :: CreateDomainResponse -> Maybe Text
defaultEncryptionKey} -> Maybe Text
defaultEncryptionKey) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe Text
a -> CreateDomainResponse
s {$sel:defaultEncryptionKey:CreateDomainResponse' :: Maybe Text
defaultEncryptionKey = Maybe Text
a} :: CreateDomainResponse)

-- | The process of matching duplicate profiles. If Matching = true, Amazon
-- Connect Customer Profiles starts a weekly batch process every Saturday
-- at 12AM UTC to detect duplicate profiles in your domains. After that
-- batch process completes, use the
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html GetMatches>
-- API to return and review the results.
createDomainResponse_matching :: Lens.Lens' CreateDomainResponse (Prelude.Maybe MatchingResponse)
createDomainResponse_matching :: (Maybe MatchingResponse -> f (Maybe MatchingResponse))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_matching = (CreateDomainResponse -> Maybe MatchingResponse)
-> (CreateDomainResponse
    -> Maybe MatchingResponse -> CreateDomainResponse)
-> Lens
     CreateDomainResponse
     CreateDomainResponse
     (Maybe MatchingResponse)
     (Maybe MatchingResponse)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe MatchingResponse
matching :: Maybe MatchingResponse
$sel:matching:CreateDomainResponse' :: CreateDomainResponse -> Maybe MatchingResponse
matching} -> Maybe MatchingResponse
matching) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe MatchingResponse
a -> CreateDomainResponse
s {$sel:matching:CreateDomainResponse' :: Maybe MatchingResponse
matching = Maybe MatchingResponse
a} :: CreateDomainResponse)

-- | The URL of the SQS dead letter queue, which is used for reporting errors
-- associated with ingesting data from third party applications.
createDomainResponse_deadLetterQueueUrl :: Lens.Lens' CreateDomainResponse (Prelude.Maybe Prelude.Text)
createDomainResponse_deadLetterQueueUrl :: (Maybe Text -> f (Maybe Text))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_deadLetterQueueUrl = (CreateDomainResponse -> Maybe Text)
-> (CreateDomainResponse -> Maybe Text -> CreateDomainResponse)
-> Lens
     CreateDomainResponse CreateDomainResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe Text
deadLetterQueueUrl :: Maybe Text
$sel:deadLetterQueueUrl:CreateDomainResponse' :: CreateDomainResponse -> Maybe Text
deadLetterQueueUrl} -> Maybe Text
deadLetterQueueUrl) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe Text
a -> CreateDomainResponse
s {$sel:deadLetterQueueUrl:CreateDomainResponse' :: Maybe Text
deadLetterQueueUrl = Maybe Text
a} :: CreateDomainResponse)

-- | The tags used to organize, track, or control access for this resource.
createDomainResponse_tags :: Lens.Lens' CreateDomainResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDomainResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_tags = (CreateDomainResponse -> Maybe (HashMap Text Text))
-> (CreateDomainResponse
    -> Maybe (HashMap Text Text) -> CreateDomainResponse)
-> Lens
     CreateDomainResponse
     CreateDomainResponse
     (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 (\CreateDomainResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDomainResponse' :: CreateDomainResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe (HashMap Text Text)
a -> CreateDomainResponse
s {$sel:tags:CreateDomainResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDomainResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateDomainResponse -> f CreateDomainResponse)
-> ((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)))
-> CreateDomainResponse
-> f CreateDomainResponse
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.
createDomainResponse_httpStatus :: Lens.Lens' CreateDomainResponse Prelude.Int
createDomainResponse_httpStatus :: (Int -> f Int) -> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_httpStatus = (CreateDomainResponse -> Int)
-> (CreateDomainResponse -> Int -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDomainResponse' :: CreateDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Int
a -> CreateDomainResponse
s {$sel:httpStatus:CreateDomainResponse' :: Int
httpStatus = Int
a} :: CreateDomainResponse)

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

-- | The default number of days until the data within the domain expires.
createDomainResponse_defaultExpirationDays :: Lens.Lens' CreateDomainResponse Prelude.Natural
createDomainResponse_defaultExpirationDays :: (Natural -> f Natural)
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_defaultExpirationDays = (CreateDomainResponse -> Natural)
-> (CreateDomainResponse -> Natural -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Natural
defaultExpirationDays :: Natural
$sel:defaultExpirationDays:CreateDomainResponse' :: CreateDomainResponse -> Natural
defaultExpirationDays} -> Natural
defaultExpirationDays) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Natural
a -> CreateDomainResponse
s {$sel:defaultExpirationDays:CreateDomainResponse' :: Natural
defaultExpirationDays = Natural
a} :: CreateDomainResponse)

-- | The timestamp of when the domain was created.
createDomainResponse_createdAt :: Lens.Lens' CreateDomainResponse Prelude.UTCTime
createDomainResponse_createdAt :: (UTCTime -> f UTCTime)
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_createdAt = (CreateDomainResponse -> POSIX)
-> (CreateDomainResponse -> POSIX -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {POSIX
createdAt :: POSIX
$sel:createdAt:CreateDomainResponse' :: CreateDomainResponse -> POSIX
createdAt} -> POSIX
createdAt) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} POSIX
a -> CreateDomainResponse
s {$sel:createdAt:CreateDomainResponse' :: POSIX
createdAt = POSIX
a} :: CreateDomainResponse) ((POSIX -> f POSIX)
 -> CreateDomainResponse -> f CreateDomainResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CreateDomainResponse
-> f CreateDomainResponse
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.
createDomainResponse_lastUpdatedAt :: Lens.Lens' CreateDomainResponse Prelude.UTCTime
createDomainResponse_lastUpdatedAt :: (UTCTime -> f UTCTime)
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_lastUpdatedAt = (CreateDomainResponse -> POSIX)
-> (CreateDomainResponse -> POSIX -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {POSIX
lastUpdatedAt :: POSIX
$sel:lastUpdatedAt:CreateDomainResponse' :: CreateDomainResponse -> POSIX
lastUpdatedAt} -> POSIX
lastUpdatedAt) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} POSIX
a -> CreateDomainResponse
s {$sel:lastUpdatedAt:CreateDomainResponse' :: POSIX
lastUpdatedAt = POSIX
a} :: CreateDomainResponse) ((POSIX -> f POSIX)
 -> CreateDomainResponse -> f CreateDomainResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CreateDomainResponse
-> f CreateDomainResponse
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 CreateDomainResponse