{-# 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.WorkMail.CreateOrganization
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new WorkMail organization. Optionally, you can choose to
-- associate an existing AWS Directory Service directory with your
-- organization. If an AWS Directory Service directory ID is specified, the
-- organization alias must match the directory alias. If you choose not to
-- associate an existing directory with your organization, then we create a
-- new WorkMail directory for you. For more information, see
-- <https://docs.aws.amazon.com/workmail/latest/adminguide/add_new_organization.html Adding an organization>
-- in the /WorkMail Administrator Guide/.
--
-- You can associate multiple email domains with an organization, then
-- choose your default email domain from the WorkMail console. You can also
-- associate a domain that is managed in an Amazon Route 53 public hosted
-- zone. For more information, see
-- <https://docs.aws.amazon.com/workmail/latest/adminguide/add_domain.html Adding a domain>
-- and
-- <https://docs.aws.amazon.com/workmail/latest/adminguide/default_domain.html Choosing the default domain>
-- in the /WorkMail Administrator Guide/.
--
-- Optionally, you can use a customer managed key from AWS Key Management
-- Service (AWS KMS) to encrypt email for your organization. If you don\'t
-- associate an AWS KMS key, WorkMail creates a default, AWS managed key
-- for you.
module Amazonka.WorkMail.CreateOrganization
  ( -- * Creating a Request
    CreateOrganization (..),
    newCreateOrganization,

    -- * Request Lenses
    createOrganization_clientToken,
    createOrganization_directoryId,
    createOrganization_domains,
    createOrganization_enableInteroperability,
    createOrganization_kmsKeyArn,
    createOrganization_alias,

    -- * Destructuring the Response
    CreateOrganizationResponse (..),
    newCreateOrganizationResponse,

    -- * Response Lenses
    createOrganizationResponse_organizationId,
    createOrganizationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkMail.Types

-- | /See:/ 'newCreateOrganization' smart constructor.
data CreateOrganization = CreateOrganization'
  { -- | The idempotency token associated with the request.
    CreateOrganization -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The AWS Directory Service directory ID.
    CreateOrganization -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The email domains to associate with the organization.
    CreateOrganization -> Maybe [Domain]
domains :: Prelude.Maybe [Domain],
    -- | When @true@, allows organization interoperability between WorkMail and
    -- Microsoft Exchange. If @true@, you must include a AD Connector directory
    -- ID in the request.
    CreateOrganization -> Maybe Bool
enableInteroperability :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of a customer managed key from AWS KMS.
    CreateOrganization -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The organization alias.
    CreateOrganization -> Text
alias :: Prelude.Text
  }
  deriving (CreateOrganization -> CreateOrganization -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateOrganization -> CreateOrganization -> Bool
$c/= :: CreateOrganization -> CreateOrganization -> Bool
== :: CreateOrganization -> CreateOrganization -> Bool
$c== :: CreateOrganization -> CreateOrganization -> Bool
Prelude.Eq, ReadPrec [CreateOrganization]
ReadPrec CreateOrganization
Int -> ReadS CreateOrganization
ReadS [CreateOrganization]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateOrganization]
$creadListPrec :: ReadPrec [CreateOrganization]
readPrec :: ReadPrec CreateOrganization
$creadPrec :: ReadPrec CreateOrganization
readList :: ReadS [CreateOrganization]
$creadList :: ReadS [CreateOrganization]
readsPrec :: Int -> ReadS CreateOrganization
$creadsPrec :: Int -> ReadS CreateOrganization
Prelude.Read, Int -> CreateOrganization -> ShowS
[CreateOrganization] -> ShowS
CreateOrganization -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateOrganization] -> ShowS
$cshowList :: [CreateOrganization] -> ShowS
show :: CreateOrganization -> String
$cshow :: CreateOrganization -> String
showsPrec :: Int -> CreateOrganization -> ShowS
$cshowsPrec :: Int -> CreateOrganization -> ShowS
Prelude.Show, forall x. Rep CreateOrganization x -> CreateOrganization
forall x. CreateOrganization -> Rep CreateOrganization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateOrganization x -> CreateOrganization
$cfrom :: forall x. CreateOrganization -> Rep CreateOrganization x
Prelude.Generic)

-- |
-- Create a value of 'CreateOrganization' 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:
--
-- 'clientToken', 'createOrganization_clientToken' - The idempotency token associated with the request.
--
-- 'directoryId', 'createOrganization_directoryId' - The AWS Directory Service directory ID.
--
-- 'domains', 'createOrganization_domains' - The email domains to associate with the organization.
--
-- 'enableInteroperability', 'createOrganization_enableInteroperability' - When @true@, allows organization interoperability between WorkMail and
-- Microsoft Exchange. If @true@, you must include a AD Connector directory
-- ID in the request.
--
-- 'kmsKeyArn', 'createOrganization_kmsKeyArn' - The Amazon Resource Name (ARN) of a customer managed key from AWS KMS.
--
-- 'alias', 'createOrganization_alias' - The organization alias.
newCreateOrganization ::
  -- | 'alias'
  Prelude.Text ->
  CreateOrganization
newCreateOrganization :: Text -> CreateOrganization
newCreateOrganization Text
pAlias_ =
  CreateOrganization'
    { $sel:clientToken:CreateOrganization' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:directoryId:CreateOrganization' :: Maybe Text
directoryId = forall a. Maybe a
Prelude.Nothing,
      $sel:domains:CreateOrganization' :: Maybe [Domain]
domains = forall a. Maybe a
Prelude.Nothing,
      $sel:enableInteroperability:CreateOrganization' :: Maybe Bool
enableInteroperability = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:CreateOrganization' :: Maybe Text
kmsKeyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:alias:CreateOrganization' :: Text
alias = Text
pAlias_
    }

-- | The idempotency token associated with the request.
createOrganization_clientToken :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Text)
createOrganization_clientToken :: Lens' CreateOrganization (Maybe Text)
createOrganization_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOrganization' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateOrganization' :: CreateOrganization -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateOrganization
s@CreateOrganization' {} Maybe Text
a -> CreateOrganization
s {$sel:clientToken:CreateOrganization' :: Maybe Text
clientToken = Maybe Text
a} :: CreateOrganization)

-- | The AWS Directory Service directory ID.
createOrganization_directoryId :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Text)
createOrganization_directoryId :: Lens' CreateOrganization (Maybe Text)
createOrganization_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOrganization' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:CreateOrganization' :: CreateOrganization -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: CreateOrganization
s@CreateOrganization' {} Maybe Text
a -> CreateOrganization
s {$sel:directoryId:CreateOrganization' :: Maybe Text
directoryId = Maybe Text
a} :: CreateOrganization)

-- | The email domains to associate with the organization.
createOrganization_domains :: Lens.Lens' CreateOrganization (Prelude.Maybe [Domain])
createOrganization_domains :: Lens' CreateOrganization (Maybe [Domain])
createOrganization_domains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOrganization' {Maybe [Domain]
domains :: Maybe [Domain]
$sel:domains:CreateOrganization' :: CreateOrganization -> Maybe [Domain]
domains} -> Maybe [Domain]
domains) (\s :: CreateOrganization
s@CreateOrganization' {} Maybe [Domain]
a -> CreateOrganization
s {$sel:domains:CreateOrganization' :: Maybe [Domain]
domains = Maybe [Domain]
a} :: CreateOrganization) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When @true@, allows organization interoperability between WorkMail and
-- Microsoft Exchange. If @true@, you must include a AD Connector directory
-- ID in the request.
createOrganization_enableInteroperability :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Bool)
createOrganization_enableInteroperability :: Lens' CreateOrganization (Maybe Bool)
createOrganization_enableInteroperability = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOrganization' {Maybe Bool
enableInteroperability :: Maybe Bool
$sel:enableInteroperability:CreateOrganization' :: CreateOrganization -> Maybe Bool
enableInteroperability} -> Maybe Bool
enableInteroperability) (\s :: CreateOrganization
s@CreateOrganization' {} Maybe Bool
a -> CreateOrganization
s {$sel:enableInteroperability:CreateOrganization' :: Maybe Bool
enableInteroperability = Maybe Bool
a} :: CreateOrganization)

-- | The Amazon Resource Name (ARN) of a customer managed key from AWS KMS.
createOrganization_kmsKeyArn :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Text)
createOrganization_kmsKeyArn :: Lens' CreateOrganization (Maybe Text)
createOrganization_kmsKeyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOrganization' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:CreateOrganization' :: CreateOrganization -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: CreateOrganization
s@CreateOrganization' {} Maybe Text
a -> CreateOrganization
s {$sel:kmsKeyArn:CreateOrganization' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: CreateOrganization)

-- | The organization alias.
createOrganization_alias :: Lens.Lens' CreateOrganization Prelude.Text
createOrganization_alias :: Lens' CreateOrganization Text
createOrganization_alias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOrganization' {Text
alias :: Text
$sel:alias:CreateOrganization' :: CreateOrganization -> Text
alias} -> Text
alias) (\s :: CreateOrganization
s@CreateOrganization' {} Text
a -> CreateOrganization
s {$sel:alias:CreateOrganization' :: Text
alias = Text
a} :: CreateOrganization)

instance Core.AWSRequest CreateOrganization where
  type
    AWSResponse CreateOrganization =
      CreateOrganizationResponse
  request :: (Service -> Service)
-> CreateOrganization -> Request CreateOrganization
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateOrganization)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateOrganizationResponse
CreateOrganizationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"OrganizationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateOrganization where
  hashWithSalt :: Int -> CreateOrganization -> Int
hashWithSalt Int
_salt CreateOrganization' {Maybe Bool
Maybe [Domain]
Maybe Text
Text
alias :: Text
kmsKeyArn :: Maybe Text
enableInteroperability :: Maybe Bool
domains :: Maybe [Domain]
directoryId :: Maybe Text
clientToken :: Maybe Text
$sel:alias:CreateOrganization' :: CreateOrganization -> Text
$sel:kmsKeyArn:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:enableInteroperability:CreateOrganization' :: CreateOrganization -> Maybe Bool
$sel:domains:CreateOrganization' :: CreateOrganization -> Maybe [Domain]
$sel:directoryId:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:clientToken:CreateOrganization' :: CreateOrganization -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Domain]
domains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableInteroperability
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
alias

instance Prelude.NFData CreateOrganization where
  rnf :: CreateOrganization -> ()
rnf CreateOrganization' {Maybe Bool
Maybe [Domain]
Maybe Text
Text
alias :: Text
kmsKeyArn :: Maybe Text
enableInteroperability :: Maybe Bool
domains :: Maybe [Domain]
directoryId :: Maybe Text
clientToken :: Maybe Text
$sel:alias:CreateOrganization' :: CreateOrganization -> Text
$sel:kmsKeyArn:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:enableInteroperability:CreateOrganization' :: CreateOrganization -> Maybe Bool
$sel:domains:CreateOrganization' :: CreateOrganization -> Maybe [Domain]
$sel:directoryId:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:clientToken:CreateOrganization' :: CreateOrganization -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Domain]
domains
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableInteroperability
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
alias

instance Data.ToHeaders CreateOrganization where
  toHeaders :: CreateOrganization -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.CreateOrganization" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateOrganization where
  toJSON :: CreateOrganization -> Value
toJSON CreateOrganization' {Maybe Bool
Maybe [Domain]
Maybe Text
Text
alias :: Text
kmsKeyArn :: Maybe Text
enableInteroperability :: Maybe Bool
domains :: Maybe [Domain]
directoryId :: Maybe Text
clientToken :: Maybe Text
$sel:alias:CreateOrganization' :: CreateOrganization -> Text
$sel:kmsKeyArn:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:enableInteroperability:CreateOrganization' :: CreateOrganization -> Maybe Bool
$sel:domains:CreateOrganization' :: CreateOrganization -> Maybe [Domain]
$sel:directoryId:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:clientToken:CreateOrganization' :: CreateOrganization -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"DirectoryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
directoryId,
            (Key
"Domains" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Domain]
domains,
            (Key
"EnableInteroperability" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableInteroperability,
            (Key
"KmsKeyArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyArn,
            forall a. a -> Maybe a
Prelude.Just (Key
"Alias" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
alias)
          ]
      )

instance Data.ToPath CreateOrganization where
  toPath :: CreateOrganization -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newCreateOrganizationResponse' smart constructor.
data CreateOrganizationResponse = CreateOrganizationResponse'
  { -- | The organization ID.
    CreateOrganizationResponse -> Maybe Text
organizationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateOrganizationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateOrganizationResponse -> CreateOrganizationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateOrganizationResponse -> CreateOrganizationResponse -> Bool
$c/= :: CreateOrganizationResponse -> CreateOrganizationResponse -> Bool
== :: CreateOrganizationResponse -> CreateOrganizationResponse -> Bool
$c== :: CreateOrganizationResponse -> CreateOrganizationResponse -> Bool
Prelude.Eq, ReadPrec [CreateOrganizationResponse]
ReadPrec CreateOrganizationResponse
Int -> ReadS CreateOrganizationResponse
ReadS [CreateOrganizationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateOrganizationResponse]
$creadListPrec :: ReadPrec [CreateOrganizationResponse]
readPrec :: ReadPrec CreateOrganizationResponse
$creadPrec :: ReadPrec CreateOrganizationResponse
readList :: ReadS [CreateOrganizationResponse]
$creadList :: ReadS [CreateOrganizationResponse]
readsPrec :: Int -> ReadS CreateOrganizationResponse
$creadsPrec :: Int -> ReadS CreateOrganizationResponse
Prelude.Read, Int -> CreateOrganizationResponse -> ShowS
[CreateOrganizationResponse] -> ShowS
CreateOrganizationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateOrganizationResponse] -> ShowS
$cshowList :: [CreateOrganizationResponse] -> ShowS
show :: CreateOrganizationResponse -> String
$cshow :: CreateOrganizationResponse -> String
showsPrec :: Int -> CreateOrganizationResponse -> ShowS
$cshowsPrec :: Int -> CreateOrganizationResponse -> ShowS
Prelude.Show, forall x.
Rep CreateOrganizationResponse x -> CreateOrganizationResponse
forall x.
CreateOrganizationResponse -> Rep CreateOrganizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateOrganizationResponse x -> CreateOrganizationResponse
$cfrom :: forall x.
CreateOrganizationResponse -> Rep CreateOrganizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateOrganizationResponse' 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:
--
-- 'organizationId', 'createOrganizationResponse_organizationId' - The organization ID.
--
-- 'httpStatus', 'createOrganizationResponse_httpStatus' - The response's http status code.
newCreateOrganizationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateOrganizationResponse
newCreateOrganizationResponse :: Int -> CreateOrganizationResponse
newCreateOrganizationResponse Int
pHttpStatus_ =
  CreateOrganizationResponse'
    { $sel:organizationId:CreateOrganizationResponse' :: Maybe Text
organizationId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateOrganizationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The organization ID.
createOrganizationResponse_organizationId :: Lens.Lens' CreateOrganizationResponse (Prelude.Maybe Prelude.Text)
createOrganizationResponse_organizationId :: Lens' CreateOrganizationResponse (Maybe Text)
createOrganizationResponse_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateOrganizationResponse' {Maybe Text
organizationId :: Maybe Text
$sel:organizationId:CreateOrganizationResponse' :: CreateOrganizationResponse -> Maybe Text
organizationId} -> Maybe Text
organizationId) (\s :: CreateOrganizationResponse
s@CreateOrganizationResponse' {} Maybe Text
a -> CreateOrganizationResponse
s {$sel:organizationId:CreateOrganizationResponse' :: Maybe Text
organizationId = Maybe Text
a} :: CreateOrganizationResponse)

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

instance Prelude.NFData CreateOrganizationResponse where
  rnf :: CreateOrganizationResponse -> ()
rnf CreateOrganizationResponse' {Int
Maybe Text
httpStatus :: Int
organizationId :: Maybe Text
$sel:httpStatus:CreateOrganizationResponse' :: CreateOrganizationResponse -> Int
$sel:organizationId:CreateOrganizationResponse' :: CreateOrganizationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
organizationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus