{-# 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.OpenSearch.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 new Amazon OpenSearch Service domain. For more information,
-- see
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html Creating and managing Amazon OpenSearch Service domains>
-- in the /Amazon OpenSearch Service Developer Guide/.
module Amazonka.OpenSearch.CreateDomain
  ( -- * Creating a Request
    CreateDomain (..),
    newCreateDomain,

    -- * Request Lenses
    createDomain_eBSOptions,
    createDomain_engineVersion,
    createDomain_nodeToNodeEncryptionOptions,
    createDomain_accessPolicies,
    createDomain_autoTuneOptions,
    createDomain_logPublishingOptions,
    createDomain_clusterConfig,
    createDomain_advancedSecurityOptions,
    createDomain_tagList,
    createDomain_snapshotOptions,
    createDomain_cognitoOptions,
    createDomain_encryptionAtRestOptions,
    createDomain_vPCOptions,
    createDomain_domainEndpointOptions,
    createDomain_advancedOptions,
    createDomain_domainName,

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

    -- * Response Lenses
    createDomainResponse_domainStatus,
    createDomainResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types
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'
  { -- | Options to enable, disable, and specify the type and size of EBS storage
    -- volumes.
    CreateDomain -> Maybe EBSOptions
eBSOptions :: Prelude.Maybe EBSOptions,
    -- | String of format Elasticsearch_X.Y or OpenSearch_X.Y to specify the
    -- engine version for the Amazon OpenSearch Service domain. For example,
    -- \"OpenSearch_1.0\" or \"Elasticsearch_7.9\". For more information, see
    -- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomains Creating and managing Amazon OpenSearch Service domains>
    -- .
    CreateDomain -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | Node-to-node encryption options.
    CreateDomain -> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions :: Prelude.Maybe NodeToNodeEncryptionOptions,
    -- | IAM access policy as a JSON-formatted string.
    CreateDomain -> Maybe Text
accessPolicies :: Prelude.Maybe Prelude.Text,
    -- | Specifies Auto-Tune options.
    CreateDomain -> Maybe AutoTuneOptionsInput
autoTuneOptions :: Prelude.Maybe AutoTuneOptionsInput,
    -- | Map of @LogType@ and @LogPublishingOption@, each containing options to
    -- publish a given type of OpenSearch log.
    CreateDomain -> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions :: Prelude.Maybe (Prelude.HashMap LogType LogPublishingOption),
    -- | Configuration options for a domain. Specifies the instance type and
    -- number of instances in the domain.
    CreateDomain -> Maybe ClusterConfig
clusterConfig :: Prelude.Maybe ClusterConfig,
    -- | Specifies advanced security options.
    CreateDomain -> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions :: Prelude.Maybe AdvancedSecurityOptionsInput,
    -- | A list of @Tag@ added during domain creation.
    CreateDomain -> Maybe [Tag]
tagList :: Prelude.Maybe [Tag],
    -- | Option to set time, in UTC format, of the daily automated snapshot.
    -- Default value is 0 hours.
    CreateDomain -> Maybe SnapshotOptions
snapshotOptions :: Prelude.Maybe SnapshotOptions,
    -- | Options to specify the Cognito user and identity pools for OpenSearch
    -- Dashboards authentication. For more information, see
    -- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html Configuring Amazon Cognito authentication for OpenSearch Dashboards>.
    CreateDomain -> Maybe CognitoOptions
cognitoOptions :: Prelude.Maybe CognitoOptions,
    -- | Options for encryption of data at rest.
    CreateDomain -> Maybe EncryptionAtRestOptions
encryptionAtRestOptions :: Prelude.Maybe EncryptionAtRestOptions,
    -- | Options to specify the subnets and security groups for a VPC endpoint.
    -- For more information, see
    -- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html Launching your Amazon OpenSearch Service domains using a VPC>
    -- .
    CreateDomain -> Maybe VPCOptions
vPCOptions :: Prelude.Maybe VPCOptions,
    -- | Options to specify configurations that will be applied to the domain
    -- endpoint.
    CreateDomain -> Maybe DomainEndpointOptions
domainEndpointOptions :: Prelude.Maybe DomainEndpointOptions,
    -- | Option to allow references to indices in an HTTP request body. Must be
    -- @false@ when configuring access to individual sub-resources. By default,
    -- the value is @true@. See
    -- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options Advanced cluster parameters>
    -- for more information.
    CreateDomain -> Maybe (HashMap Text Text)
advancedOptions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the Amazon OpenSearch Service domain you\'re creating.
    -- Domain names are unique across the domains owned by an account within an
    -- AWS region. Domain names must start with a lowercase letter and can
    -- contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
    CreateDomain -> Text
domainName :: Prelude.Text
  }
  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, 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:
--
-- 'eBSOptions', 'createDomain_eBSOptions' - Options to enable, disable, and specify the type and size of EBS storage
-- volumes.
--
-- 'engineVersion', 'createDomain_engineVersion' - String of format Elasticsearch_X.Y or OpenSearch_X.Y to specify the
-- engine version for the Amazon OpenSearch Service domain. For example,
-- \"OpenSearch_1.0\" or \"Elasticsearch_7.9\". For more information, see
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomains Creating and managing Amazon OpenSearch Service domains>
-- .
--
-- 'nodeToNodeEncryptionOptions', 'createDomain_nodeToNodeEncryptionOptions' - Node-to-node encryption options.
--
-- 'accessPolicies', 'createDomain_accessPolicies' - IAM access policy as a JSON-formatted string.
--
-- 'autoTuneOptions', 'createDomain_autoTuneOptions' - Specifies Auto-Tune options.
--
-- 'logPublishingOptions', 'createDomain_logPublishingOptions' - Map of @LogType@ and @LogPublishingOption@, each containing options to
-- publish a given type of OpenSearch log.
--
-- 'clusterConfig', 'createDomain_clusterConfig' - Configuration options for a domain. Specifies the instance type and
-- number of instances in the domain.
--
-- 'advancedSecurityOptions', 'createDomain_advancedSecurityOptions' - Specifies advanced security options.
--
-- 'tagList', 'createDomain_tagList' - A list of @Tag@ added during domain creation.
--
-- 'snapshotOptions', 'createDomain_snapshotOptions' - Option to set time, in UTC format, of the daily automated snapshot.
-- Default value is 0 hours.
--
-- 'cognitoOptions', 'createDomain_cognitoOptions' - Options to specify the Cognito user and identity pools for OpenSearch
-- Dashboards authentication. For more information, see
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html Configuring Amazon Cognito authentication for OpenSearch Dashboards>.
--
-- 'encryptionAtRestOptions', 'createDomain_encryptionAtRestOptions' - Options for encryption of data at rest.
--
-- 'vPCOptions', 'createDomain_vPCOptions' - Options to specify the subnets and security groups for a VPC endpoint.
-- For more information, see
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html Launching your Amazon OpenSearch Service domains using a VPC>
-- .
--
-- 'domainEndpointOptions', 'createDomain_domainEndpointOptions' - Options to specify configurations that will be applied to the domain
-- endpoint.
--
-- 'advancedOptions', 'createDomain_advancedOptions' - Option to allow references to indices in an HTTP request body. Must be
-- @false@ when configuring access to individual sub-resources. By default,
-- the value is @true@. See
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options Advanced cluster parameters>
-- for more information.
--
-- 'domainName', 'createDomain_domainName' - The name of the Amazon OpenSearch Service domain you\'re creating.
-- Domain names are unique across the domains owned by an account within an
-- AWS region. Domain names must start with a lowercase letter and can
-- contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
newCreateDomain ::
  -- | 'domainName'
  Prelude.Text ->
  CreateDomain
newCreateDomain :: Text -> CreateDomain
newCreateDomain Text
pDomainName_ =
  CreateDomain' :: Maybe EBSOptions
-> Maybe Text
-> Maybe NodeToNodeEncryptionOptions
-> Maybe Text
-> Maybe AutoTuneOptionsInput
-> Maybe (HashMap LogType LogPublishingOption)
-> Maybe ClusterConfig
-> Maybe AdvancedSecurityOptionsInput
-> Maybe [Tag]
-> Maybe SnapshotOptions
-> Maybe CognitoOptions
-> Maybe EncryptionAtRestOptions
-> Maybe VPCOptions
-> Maybe DomainEndpointOptions
-> Maybe (HashMap Text Text)
-> Text
-> CreateDomain
CreateDomain'
    { $sel:eBSOptions:CreateDomain' :: Maybe EBSOptions
eBSOptions = Maybe EBSOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersion:CreateDomain' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeToNodeEncryptionOptions:CreateDomain' :: Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions = Maybe NodeToNodeEncryptionOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:accessPolicies:CreateDomain' :: Maybe Text
accessPolicies = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoTuneOptions:CreateDomain' :: Maybe AutoTuneOptionsInput
autoTuneOptions = Maybe AutoTuneOptionsInput
forall a. Maybe a
Prelude.Nothing,
      $sel:logPublishingOptions:CreateDomain' :: Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions = Maybe (HashMap LogType LogPublishingOption)
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterConfig:CreateDomain' :: Maybe ClusterConfig
clusterConfig = Maybe ClusterConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:advancedSecurityOptions:CreateDomain' :: Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions = Maybe AdvancedSecurityOptionsInput
forall a. Maybe a
Prelude.Nothing,
      $sel:tagList:CreateDomain' :: Maybe [Tag]
tagList = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotOptions:CreateDomain' :: Maybe SnapshotOptions
snapshotOptions = Maybe SnapshotOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:cognitoOptions:CreateDomain' :: Maybe CognitoOptions
cognitoOptions = Maybe CognitoOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionAtRestOptions:CreateDomain' :: Maybe EncryptionAtRestOptions
encryptionAtRestOptions = Maybe EncryptionAtRestOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:vPCOptions:CreateDomain' :: Maybe VPCOptions
vPCOptions = Maybe VPCOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:domainEndpointOptions:CreateDomain' :: Maybe DomainEndpointOptions
domainEndpointOptions = Maybe DomainEndpointOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:advancedOptions:CreateDomain' :: Maybe (HashMap Text Text)
advancedOptions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:CreateDomain' :: Text
domainName = Text
pDomainName_
    }

-- | Options to enable, disable, and specify the type and size of EBS storage
-- volumes.
createDomain_eBSOptions :: Lens.Lens' CreateDomain (Prelude.Maybe EBSOptions)
createDomain_eBSOptions :: (Maybe EBSOptions -> f (Maybe EBSOptions))
-> CreateDomain -> f CreateDomain
createDomain_eBSOptions = (CreateDomain -> Maybe EBSOptions)
-> (CreateDomain -> Maybe EBSOptions -> CreateDomain)
-> Lens
     CreateDomain CreateDomain (Maybe EBSOptions) (Maybe EBSOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe EBSOptions
eBSOptions :: Maybe EBSOptions
$sel:eBSOptions:CreateDomain' :: CreateDomain -> Maybe EBSOptions
eBSOptions} -> Maybe EBSOptions
eBSOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe EBSOptions
a -> CreateDomain
s {$sel:eBSOptions:CreateDomain' :: Maybe EBSOptions
eBSOptions = Maybe EBSOptions
a} :: CreateDomain)

-- | String of format Elasticsearch_X.Y or OpenSearch_X.Y to specify the
-- engine version for the Amazon OpenSearch Service domain. For example,
-- \"OpenSearch_1.0\" or \"Elasticsearch_7.9\". For more information, see
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomains Creating and managing Amazon OpenSearch Service domains>
-- .
createDomain_engineVersion :: Lens.Lens' CreateDomain (Prelude.Maybe Prelude.Text)
createDomain_engineVersion :: (Maybe Text -> f (Maybe Text)) -> CreateDomain -> f CreateDomain
createDomain_engineVersion = (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
engineVersion :: Maybe Text
$sel:engineVersion:CreateDomain' :: CreateDomain -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: CreateDomain
s@CreateDomain' {} Maybe Text
a -> CreateDomain
s {$sel:engineVersion:CreateDomain' :: Maybe Text
engineVersion = Maybe Text
a} :: CreateDomain)

-- | Node-to-node encryption options.
createDomain_nodeToNodeEncryptionOptions :: Lens.Lens' CreateDomain (Prelude.Maybe NodeToNodeEncryptionOptions)
createDomain_nodeToNodeEncryptionOptions :: (Maybe NodeToNodeEncryptionOptions
 -> f (Maybe NodeToNodeEncryptionOptions))
-> CreateDomain -> f CreateDomain
createDomain_nodeToNodeEncryptionOptions = (CreateDomain -> Maybe NodeToNodeEncryptionOptions)
-> (CreateDomain
    -> Maybe NodeToNodeEncryptionOptions -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe NodeToNodeEncryptionOptions)
     (Maybe NodeToNodeEncryptionOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions :: Maybe NodeToNodeEncryptionOptions
$sel:nodeToNodeEncryptionOptions:CreateDomain' :: CreateDomain -> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions} -> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe NodeToNodeEncryptionOptions
a -> CreateDomain
s {$sel:nodeToNodeEncryptionOptions:CreateDomain' :: Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions = Maybe NodeToNodeEncryptionOptions
a} :: CreateDomain)

-- | IAM access policy as a JSON-formatted string.
createDomain_accessPolicies :: Lens.Lens' CreateDomain (Prelude.Maybe Prelude.Text)
createDomain_accessPolicies :: (Maybe Text -> f (Maybe Text)) -> CreateDomain -> f CreateDomain
createDomain_accessPolicies = (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
accessPolicies :: Maybe Text
$sel:accessPolicies:CreateDomain' :: CreateDomain -> Maybe Text
accessPolicies} -> Maybe Text
accessPolicies) (\s :: CreateDomain
s@CreateDomain' {} Maybe Text
a -> CreateDomain
s {$sel:accessPolicies:CreateDomain' :: Maybe Text
accessPolicies = Maybe Text
a} :: CreateDomain)

-- | Specifies Auto-Tune options.
createDomain_autoTuneOptions :: Lens.Lens' CreateDomain (Prelude.Maybe AutoTuneOptionsInput)
createDomain_autoTuneOptions :: (Maybe AutoTuneOptionsInput -> f (Maybe AutoTuneOptionsInput))
-> CreateDomain -> f CreateDomain
createDomain_autoTuneOptions = (CreateDomain -> Maybe AutoTuneOptionsInput)
-> (CreateDomain -> Maybe AutoTuneOptionsInput -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe AutoTuneOptionsInput)
     (Maybe AutoTuneOptionsInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe AutoTuneOptionsInput
autoTuneOptions :: Maybe AutoTuneOptionsInput
$sel:autoTuneOptions:CreateDomain' :: CreateDomain -> Maybe AutoTuneOptionsInput
autoTuneOptions} -> Maybe AutoTuneOptionsInput
autoTuneOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe AutoTuneOptionsInput
a -> CreateDomain
s {$sel:autoTuneOptions:CreateDomain' :: Maybe AutoTuneOptionsInput
autoTuneOptions = Maybe AutoTuneOptionsInput
a} :: CreateDomain)

-- | Map of @LogType@ and @LogPublishingOption@, each containing options to
-- publish a given type of OpenSearch log.
createDomain_logPublishingOptions :: Lens.Lens' CreateDomain (Prelude.Maybe (Prelude.HashMap LogType LogPublishingOption))
createDomain_logPublishingOptions :: (Maybe (HashMap LogType LogPublishingOption)
 -> f (Maybe (HashMap LogType LogPublishingOption)))
-> CreateDomain -> f CreateDomain
createDomain_logPublishingOptions = (CreateDomain -> Maybe (HashMap LogType LogPublishingOption))
-> (CreateDomain
    -> Maybe (HashMap LogType LogPublishingOption) -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions :: Maybe (HashMap LogType LogPublishingOption)
$sel:logPublishingOptions:CreateDomain' :: CreateDomain -> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions} -> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe (HashMap LogType LogPublishingOption)
a -> CreateDomain
s {$sel:logPublishingOptions:CreateDomain' :: Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions = Maybe (HashMap LogType LogPublishingOption)
a} :: CreateDomain) ((Maybe (HashMap LogType LogPublishingOption)
  -> f (Maybe (HashMap LogType LogPublishingOption)))
 -> CreateDomain -> f CreateDomain)
-> ((Maybe (HashMap LogType LogPublishingOption)
     -> f (Maybe (HashMap LogType LogPublishingOption)))
    -> Maybe (HashMap LogType LogPublishingOption)
    -> f (Maybe (HashMap LogType LogPublishingOption)))
-> (Maybe (HashMap LogType LogPublishingOption)
    -> f (Maybe (HashMap LogType LogPublishingOption)))
-> CreateDomain
-> f CreateDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
-> Iso
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
     (Maybe (HashMap LogType LogPublishingOption))
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 LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
  (HashMap LogType LogPublishingOption)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Configuration options for a domain. Specifies the instance type and
-- number of instances in the domain.
createDomain_clusterConfig :: Lens.Lens' CreateDomain (Prelude.Maybe ClusterConfig)
createDomain_clusterConfig :: (Maybe ClusterConfig -> f (Maybe ClusterConfig))
-> CreateDomain -> f CreateDomain
createDomain_clusterConfig = (CreateDomain -> Maybe ClusterConfig)
-> (CreateDomain -> Maybe ClusterConfig -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe ClusterConfig)
     (Maybe ClusterConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe ClusterConfig
clusterConfig :: Maybe ClusterConfig
$sel:clusterConfig:CreateDomain' :: CreateDomain -> Maybe ClusterConfig
clusterConfig} -> Maybe ClusterConfig
clusterConfig) (\s :: CreateDomain
s@CreateDomain' {} Maybe ClusterConfig
a -> CreateDomain
s {$sel:clusterConfig:CreateDomain' :: Maybe ClusterConfig
clusterConfig = Maybe ClusterConfig
a} :: CreateDomain)

-- | Specifies advanced security options.
createDomain_advancedSecurityOptions :: Lens.Lens' CreateDomain (Prelude.Maybe AdvancedSecurityOptionsInput)
createDomain_advancedSecurityOptions :: (Maybe AdvancedSecurityOptionsInput
 -> f (Maybe AdvancedSecurityOptionsInput))
-> CreateDomain -> f CreateDomain
createDomain_advancedSecurityOptions = (CreateDomain -> Maybe AdvancedSecurityOptionsInput)
-> (CreateDomain
    -> Maybe AdvancedSecurityOptionsInput -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe AdvancedSecurityOptionsInput)
     (Maybe AdvancedSecurityOptionsInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions :: Maybe AdvancedSecurityOptionsInput
$sel:advancedSecurityOptions:CreateDomain' :: CreateDomain -> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions} -> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe AdvancedSecurityOptionsInput
a -> CreateDomain
s {$sel:advancedSecurityOptions:CreateDomain' :: Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions = Maybe AdvancedSecurityOptionsInput
a} :: CreateDomain)

-- | A list of @Tag@ added during domain creation.
createDomain_tagList :: Lens.Lens' CreateDomain (Prelude.Maybe [Tag])
createDomain_tagList :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateDomain -> f CreateDomain
createDomain_tagList = (CreateDomain -> Maybe [Tag])
-> (CreateDomain -> Maybe [Tag] -> CreateDomain)
-> Lens CreateDomain CreateDomain (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe [Tag]
tagList :: Maybe [Tag]
$sel:tagList:CreateDomain' :: CreateDomain -> Maybe [Tag]
tagList} -> Maybe [Tag]
tagList) (\s :: CreateDomain
s@CreateDomain' {} Maybe [Tag]
a -> CreateDomain
s {$sel:tagList:CreateDomain' :: Maybe [Tag]
tagList = Maybe [Tag]
a} :: CreateDomain) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateDomain -> f CreateDomain)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDomain
-> f CreateDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Option to set time, in UTC format, of the daily automated snapshot.
-- Default value is 0 hours.
createDomain_snapshotOptions :: Lens.Lens' CreateDomain (Prelude.Maybe SnapshotOptions)
createDomain_snapshotOptions :: (Maybe SnapshotOptions -> f (Maybe SnapshotOptions))
-> CreateDomain -> f CreateDomain
createDomain_snapshotOptions = (CreateDomain -> Maybe SnapshotOptions)
-> (CreateDomain -> Maybe SnapshotOptions -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe SnapshotOptions)
     (Maybe SnapshotOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe SnapshotOptions
snapshotOptions :: Maybe SnapshotOptions
$sel:snapshotOptions:CreateDomain' :: CreateDomain -> Maybe SnapshotOptions
snapshotOptions} -> Maybe SnapshotOptions
snapshotOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe SnapshotOptions
a -> CreateDomain
s {$sel:snapshotOptions:CreateDomain' :: Maybe SnapshotOptions
snapshotOptions = Maybe SnapshotOptions
a} :: CreateDomain)

-- | Options to specify the Cognito user and identity pools for OpenSearch
-- Dashboards authentication. For more information, see
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/cognito-auth.html Configuring Amazon Cognito authentication for OpenSearch Dashboards>.
createDomain_cognitoOptions :: Lens.Lens' CreateDomain (Prelude.Maybe CognitoOptions)
createDomain_cognitoOptions :: (Maybe CognitoOptions -> f (Maybe CognitoOptions))
-> CreateDomain -> f CreateDomain
createDomain_cognitoOptions = (CreateDomain -> Maybe CognitoOptions)
-> (CreateDomain -> Maybe CognitoOptions -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe CognitoOptions)
     (Maybe CognitoOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe CognitoOptions
cognitoOptions :: Maybe CognitoOptions
$sel:cognitoOptions:CreateDomain' :: CreateDomain -> Maybe CognitoOptions
cognitoOptions} -> Maybe CognitoOptions
cognitoOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe CognitoOptions
a -> CreateDomain
s {$sel:cognitoOptions:CreateDomain' :: Maybe CognitoOptions
cognitoOptions = Maybe CognitoOptions
a} :: CreateDomain)

-- | Options for encryption of data at rest.
createDomain_encryptionAtRestOptions :: Lens.Lens' CreateDomain (Prelude.Maybe EncryptionAtRestOptions)
createDomain_encryptionAtRestOptions :: (Maybe EncryptionAtRestOptions
 -> f (Maybe EncryptionAtRestOptions))
-> CreateDomain -> f CreateDomain
createDomain_encryptionAtRestOptions = (CreateDomain -> Maybe EncryptionAtRestOptions)
-> (CreateDomain -> Maybe EncryptionAtRestOptions -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe EncryptionAtRestOptions)
     (Maybe EncryptionAtRestOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe EncryptionAtRestOptions
encryptionAtRestOptions :: Maybe EncryptionAtRestOptions
$sel:encryptionAtRestOptions:CreateDomain' :: CreateDomain -> Maybe EncryptionAtRestOptions
encryptionAtRestOptions} -> Maybe EncryptionAtRestOptions
encryptionAtRestOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe EncryptionAtRestOptions
a -> CreateDomain
s {$sel:encryptionAtRestOptions:CreateDomain' :: Maybe EncryptionAtRestOptions
encryptionAtRestOptions = Maybe EncryptionAtRestOptions
a} :: CreateDomain)

-- | Options to specify the subnets and security groups for a VPC endpoint.
-- For more information, see
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html Launching your Amazon OpenSearch Service domains using a VPC>
-- .
createDomain_vPCOptions :: Lens.Lens' CreateDomain (Prelude.Maybe VPCOptions)
createDomain_vPCOptions :: (Maybe VPCOptions -> f (Maybe VPCOptions))
-> CreateDomain -> f CreateDomain
createDomain_vPCOptions = (CreateDomain -> Maybe VPCOptions)
-> (CreateDomain -> Maybe VPCOptions -> CreateDomain)
-> Lens
     CreateDomain CreateDomain (Maybe VPCOptions) (Maybe VPCOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe VPCOptions
vPCOptions :: Maybe VPCOptions
$sel:vPCOptions:CreateDomain' :: CreateDomain -> Maybe VPCOptions
vPCOptions} -> Maybe VPCOptions
vPCOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe VPCOptions
a -> CreateDomain
s {$sel:vPCOptions:CreateDomain' :: Maybe VPCOptions
vPCOptions = Maybe VPCOptions
a} :: CreateDomain)

-- | Options to specify configurations that will be applied to the domain
-- endpoint.
createDomain_domainEndpointOptions :: Lens.Lens' CreateDomain (Prelude.Maybe DomainEndpointOptions)
createDomain_domainEndpointOptions :: (Maybe DomainEndpointOptions -> f (Maybe DomainEndpointOptions))
-> CreateDomain -> f CreateDomain
createDomain_domainEndpointOptions = (CreateDomain -> Maybe DomainEndpointOptions)
-> (CreateDomain -> Maybe DomainEndpointOptions -> CreateDomain)
-> Lens
     CreateDomain
     CreateDomain
     (Maybe DomainEndpointOptions)
     (Maybe DomainEndpointOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe DomainEndpointOptions
domainEndpointOptions :: Maybe DomainEndpointOptions
$sel:domainEndpointOptions:CreateDomain' :: CreateDomain -> Maybe DomainEndpointOptions
domainEndpointOptions} -> Maybe DomainEndpointOptions
domainEndpointOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe DomainEndpointOptions
a -> CreateDomain
s {$sel:domainEndpointOptions:CreateDomain' :: Maybe DomainEndpointOptions
domainEndpointOptions = Maybe DomainEndpointOptions
a} :: CreateDomain)

-- | Option to allow references to indices in an HTTP request body. Must be
-- @false@ when configuring access to individual sub-resources. By default,
-- the value is @true@. See
-- <http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options Advanced cluster parameters>
-- for more information.
createDomain_advancedOptions :: Lens.Lens' CreateDomain (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDomain_advancedOptions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomain -> f CreateDomain
createDomain_advancedOptions = (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)
advancedOptions :: Maybe (HashMap Text Text)
$sel:advancedOptions:CreateDomain' :: CreateDomain -> Maybe (HashMap Text Text)
advancedOptions} -> Maybe (HashMap Text Text)
advancedOptions) (\s :: CreateDomain
s@CreateDomain' {} Maybe (HashMap Text Text)
a -> CreateDomain
s {$sel:advancedOptions:CreateDomain' :: Maybe (HashMap Text Text)
advancedOptions = 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 name of the Amazon OpenSearch Service domain you\'re creating.
-- Domain names are unique across the domains owned by an account within an
-- AWS region. Domain names must start with a lowercase letter and can
-- contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
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)

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 DomainStatus -> Int -> CreateDomainResponse
CreateDomainResponse'
            (Maybe DomainStatus -> Int -> CreateDomainResponse)
-> Either String (Maybe DomainStatus)
-> Either String (Int -> CreateDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DomainStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DomainStatus")
            Either String (Int -> CreateDomainResponse)
-> Either String Int -> Either String 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))
      )

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
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateDomain where
  toJSON :: CreateDomain -> Value
toJSON CreateDomain' {Maybe [Tag]
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap LogType LogPublishingOption)
Maybe CognitoOptions
Maybe EncryptionAtRestOptions
Maybe NodeToNodeEncryptionOptions
Maybe AdvancedSecurityOptionsInput
Maybe SnapshotOptions
Maybe DomainEndpointOptions
Maybe AutoTuneOptionsInput
Maybe VPCOptions
Maybe EBSOptions
Maybe ClusterConfig
Text
domainName :: Text
advancedOptions :: Maybe (HashMap Text Text)
domainEndpointOptions :: Maybe DomainEndpointOptions
vPCOptions :: Maybe VPCOptions
encryptionAtRestOptions :: Maybe EncryptionAtRestOptions
cognitoOptions :: Maybe CognitoOptions
snapshotOptions :: Maybe SnapshotOptions
tagList :: Maybe [Tag]
advancedSecurityOptions :: Maybe AdvancedSecurityOptionsInput
clusterConfig :: Maybe ClusterConfig
logPublishingOptions :: Maybe (HashMap LogType LogPublishingOption)
autoTuneOptions :: Maybe AutoTuneOptionsInput
accessPolicies :: Maybe Text
nodeToNodeEncryptionOptions :: Maybe NodeToNodeEncryptionOptions
engineVersion :: Maybe Text
eBSOptions :: Maybe EBSOptions
$sel:domainName:CreateDomain' :: CreateDomain -> Text
$sel:advancedOptions:CreateDomain' :: CreateDomain -> Maybe (HashMap Text Text)
$sel:domainEndpointOptions:CreateDomain' :: CreateDomain -> Maybe DomainEndpointOptions
$sel:vPCOptions:CreateDomain' :: CreateDomain -> Maybe VPCOptions
$sel:encryptionAtRestOptions:CreateDomain' :: CreateDomain -> Maybe EncryptionAtRestOptions
$sel:cognitoOptions:CreateDomain' :: CreateDomain -> Maybe CognitoOptions
$sel:snapshotOptions:CreateDomain' :: CreateDomain -> Maybe SnapshotOptions
$sel:tagList:CreateDomain' :: CreateDomain -> Maybe [Tag]
$sel:advancedSecurityOptions:CreateDomain' :: CreateDomain -> Maybe AdvancedSecurityOptionsInput
$sel:clusterConfig:CreateDomain' :: CreateDomain -> Maybe ClusterConfig
$sel:logPublishingOptions:CreateDomain' :: CreateDomain -> Maybe (HashMap LogType LogPublishingOption)
$sel:autoTuneOptions:CreateDomain' :: CreateDomain -> Maybe AutoTuneOptionsInput
$sel:accessPolicies:CreateDomain' :: CreateDomain -> Maybe Text
$sel:nodeToNodeEncryptionOptions:CreateDomain' :: CreateDomain -> Maybe NodeToNodeEncryptionOptions
$sel:engineVersion:CreateDomain' :: CreateDomain -> Maybe Text
$sel:eBSOptions:CreateDomain' :: CreateDomain -> Maybe EBSOptions
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"EBSOptions" Text -> EBSOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EBSOptions -> Pair) -> Maybe EBSOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EBSOptions
eBSOptions,
            (Text
"EngineVersion" 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
engineVersion,
            (Text
"NodeToNodeEncryptionOptions" Text -> NodeToNodeEncryptionOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NodeToNodeEncryptionOptions -> Pair)
-> Maybe NodeToNodeEncryptionOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeToNodeEncryptionOptions
nodeToNodeEncryptionOptions,
            (Text
"AccessPolicies" 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
accessPolicies,
            (Text
"AutoTuneOptions" Text -> AutoTuneOptionsInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AutoTuneOptionsInput -> Pair)
-> Maybe AutoTuneOptionsInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoTuneOptionsInput
autoTuneOptions,
            (Text
"LogPublishingOptions" Text -> HashMap LogType LogPublishingOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap LogType LogPublishingOption -> Pair)
-> Maybe (HashMap LogType LogPublishingOption) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap LogType LogPublishingOption)
logPublishingOptions,
            (Text
"ClusterConfig" Text -> ClusterConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ClusterConfig -> Pair) -> Maybe ClusterConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ClusterConfig
clusterConfig,
            (Text
"AdvancedSecurityOptions" Text -> AdvancedSecurityOptionsInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AdvancedSecurityOptionsInput -> Pair)
-> Maybe AdvancedSecurityOptionsInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AdvancedSecurityOptionsInput
advancedSecurityOptions,
            (Text
"TagList" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tagList,
            (Text
"SnapshotOptions" Text -> SnapshotOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SnapshotOptions -> Pair) -> Maybe SnapshotOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SnapshotOptions
snapshotOptions,
            (Text
"CognitoOptions" Text -> CognitoOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CognitoOptions -> Pair) -> Maybe CognitoOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CognitoOptions
cognitoOptions,
            (Text
"EncryptionAtRestOptions" Text -> EncryptionAtRestOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EncryptionAtRestOptions -> Pair)
-> Maybe EncryptionAtRestOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionAtRestOptions
encryptionAtRestOptions,
            (Text
"VPCOptions" Text -> VPCOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VPCOptions -> Pair) -> Maybe VPCOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VPCOptions
vPCOptions,
            (Text
"DomainEndpointOptions" Text -> DomainEndpointOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DomainEndpointOptions -> Pair)
-> Maybe DomainEndpointOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DomainEndpointOptions
domainEndpointOptions,
            (Text
"AdvancedOptions" 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)
advancedOptions,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DomainName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainName)
          ]
      )

instance Core.ToPath CreateDomain where
  toPath :: CreateDomain -> ByteString
toPath =
    ByteString -> CreateDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2021-01-01/opensearch/domain"

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

-- | The result of a @CreateDomain@ operation. Contains the status of the
-- newly created Amazon OpenSearch Service domain.
--
-- /See:/ 'newCreateDomainResponse' smart constructor.
data CreateDomainResponse = CreateDomainResponse'
  { -- | The status of the newly created domain.
    CreateDomainResponse -> Maybe DomainStatus
domainStatus :: Prelude.Maybe DomainStatus,
    -- | The response's http status code.
    CreateDomainResponse -> Int
httpStatus :: Prelude.Int
  }
  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:
--
-- 'domainStatus', 'createDomainResponse_domainStatus' - The status of the newly created domain.
--
-- 'httpStatus', 'createDomainResponse_httpStatus' - The response's http status code.
newCreateDomainResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDomainResponse
newCreateDomainResponse :: Int -> CreateDomainResponse
newCreateDomainResponse Int
pHttpStatus_ =
  CreateDomainResponse' :: Maybe DomainStatus -> Int -> CreateDomainResponse
CreateDomainResponse'
    { $sel:domainStatus:CreateDomainResponse' :: Maybe DomainStatus
domainStatus =
        Maybe DomainStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the newly created domain.
createDomainResponse_domainStatus :: Lens.Lens' CreateDomainResponse (Prelude.Maybe DomainStatus)
createDomainResponse_domainStatus :: (Maybe DomainStatus -> f (Maybe DomainStatus))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_domainStatus = (CreateDomainResponse -> Maybe DomainStatus)
-> (CreateDomainResponse
    -> Maybe DomainStatus -> CreateDomainResponse)
-> Lens
     CreateDomainResponse
     CreateDomainResponse
     (Maybe DomainStatus)
     (Maybe DomainStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe DomainStatus
domainStatus :: Maybe DomainStatus
$sel:domainStatus:CreateDomainResponse' :: CreateDomainResponse -> Maybe DomainStatus
domainStatus} -> Maybe DomainStatus
domainStatus) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe DomainStatus
a -> CreateDomainResponse
s {$sel:domainStatus:CreateDomainResponse' :: Maybe DomainStatus
domainStatus = Maybe DomainStatus
a} :: CreateDomainResponse)

-- | 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)

instance Prelude.NFData CreateDomainResponse