{-# 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-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 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 Amazon 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 /Amazon WorkMail Administrator Guide/.
--
-- You can associate multiple email domains with an organization, then set
-- your default email domain from the Amazon 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 /Amazon WorkMail Administrator Guide/.
--
-- Optionally, you can use a customer managed master key from AWS Key
-- Management Service (AWS KMS) to encrypt email for your organization. If
-- you don\'t associate an AWS KMS key, Amazon WorkMail creates a default
-- AWS managed master key for you.
module Amazonka.WorkMail.CreateOrganization
  ( -- * Creating a Request
    CreateOrganization (..),
    newCreateOrganization,

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

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

    -- * Response Lenses
    createOrganizationResponse_organizationId,
    createOrganizationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateOrganization' smart constructor.
data CreateOrganization = CreateOrganization'
  { -- | The AWS Directory Service directory ID.
    CreateOrganization -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | When @true@, allows organization interoperability between Amazon
    -- WorkMail and Microsoft Exchange. Can only be set to @true@ if an AD
    -- Connector directory ID is included in the request.
    CreateOrganization -> Maybe Bool
enableInteroperability :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of a customer managed master key from AWS
    -- KMS.
    CreateOrganization -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The idempotency token associated with the request.
    CreateOrganization -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The email domains to associate with the organization.
    CreateOrganization -> Maybe [Domain]
domains :: Prelude.Maybe [Domain],
    -- | The organization alias.
    CreateOrganization -> Text
alias :: Prelude.Text
  }
  deriving (CreateOrganization -> CreateOrganization -> Bool
(CreateOrganization -> CreateOrganization -> Bool)
-> (CreateOrganization -> CreateOrganization -> Bool)
-> Eq CreateOrganization
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]
(Int -> ReadS CreateOrganization)
-> ReadS [CreateOrganization]
-> ReadPrec CreateOrganization
-> ReadPrec [CreateOrganization]
-> Read 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
(Int -> CreateOrganization -> ShowS)
-> (CreateOrganization -> String)
-> ([CreateOrganization] -> ShowS)
-> Show CreateOrganization
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. CreateOrganization -> Rep CreateOrganization x)
-> (forall x. Rep CreateOrganization x -> CreateOrganization)
-> Generic CreateOrganization
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:
--
-- 'directoryId', 'createOrganization_directoryId' - The AWS Directory Service directory ID.
--
-- 'enableInteroperability', 'createOrganization_enableInteroperability' - When @true@, allows organization interoperability between Amazon
-- WorkMail and Microsoft Exchange. Can only be set to @true@ if an AD
-- Connector directory ID is included in the request.
--
-- 'kmsKeyArn', 'createOrganization_kmsKeyArn' - The Amazon Resource Name (ARN) of a customer managed master key from AWS
-- KMS.
--
-- 'clientToken', 'createOrganization_clientToken' - The idempotency token associated with the request.
--
-- 'domains', 'createOrganization_domains' - The email domains to associate with the organization.
--
-- 'alias', 'createOrganization_alias' - The organization alias.
newCreateOrganization ::
  -- | 'alias'
  Prelude.Text ->
  CreateOrganization
newCreateOrganization :: Text -> CreateOrganization
newCreateOrganization Text
pAlias_ =
  CreateOrganization' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Domain]
-> Text
-> CreateOrganization
CreateOrganization'
    { $sel:directoryId:CreateOrganization' :: Maybe Text
directoryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableInteroperability:CreateOrganization' :: Maybe Bool
enableInteroperability = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:CreateOrganization' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:CreateOrganization' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domains:CreateOrganization' :: Maybe [Domain]
domains = Maybe [Domain]
forall a. Maybe a
Prelude.Nothing,
      $sel:alias:CreateOrganization' :: Text
alias = Text
pAlias_
    }

-- | The AWS Directory Service directory ID.
createOrganization_directoryId :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Text)
createOrganization_directoryId :: (Maybe Text -> f (Maybe Text))
-> CreateOrganization -> f CreateOrganization
createOrganization_directoryId = (CreateOrganization -> Maybe Text)
-> (CreateOrganization -> Maybe Text -> CreateOrganization)
-> Lens
     CreateOrganization CreateOrganization (Maybe Text) (Maybe Text)
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)

-- | When @true@, allows organization interoperability between Amazon
-- WorkMail and Microsoft Exchange. Can only be set to @true@ if an AD
-- Connector directory ID is included in the request.
createOrganization_enableInteroperability :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Bool)
createOrganization_enableInteroperability :: (Maybe Bool -> f (Maybe Bool))
-> CreateOrganization -> f CreateOrganization
createOrganization_enableInteroperability = (CreateOrganization -> Maybe Bool)
-> (CreateOrganization -> Maybe Bool -> CreateOrganization)
-> Lens
     CreateOrganization CreateOrganization (Maybe Bool) (Maybe Bool)
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 master key from AWS
-- KMS.
createOrganization_kmsKeyArn :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Text)
createOrganization_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> CreateOrganization -> f CreateOrganization
createOrganization_kmsKeyArn = (CreateOrganization -> Maybe Text)
-> (CreateOrganization -> Maybe Text -> CreateOrganization)
-> Lens
     CreateOrganization CreateOrganization (Maybe Text) (Maybe Text)
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 idempotency token associated with the request.
createOrganization_clientToken :: Lens.Lens' CreateOrganization (Prelude.Maybe Prelude.Text)
createOrganization_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateOrganization -> f CreateOrganization
createOrganization_clientToken = (CreateOrganization -> Maybe Text)
-> (CreateOrganization -> Maybe Text -> CreateOrganization)
-> Lens
     CreateOrganization CreateOrganization (Maybe Text) (Maybe Text)
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 email domains to associate with the organization.
createOrganization_domains :: Lens.Lens' CreateOrganization (Prelude.Maybe [Domain])
createOrganization_domains :: (Maybe [Domain] -> f (Maybe [Domain]))
-> CreateOrganization -> f CreateOrganization
createOrganization_domains = (CreateOrganization -> Maybe [Domain])
-> (CreateOrganization -> Maybe [Domain] -> CreateOrganization)
-> Lens
     CreateOrganization
     CreateOrganization
     (Maybe [Domain])
     (Maybe [Domain])
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) ((Maybe [Domain] -> f (Maybe [Domain]))
 -> CreateOrganization -> f CreateOrganization)
-> ((Maybe [Domain] -> f (Maybe [Domain]))
    -> Maybe [Domain] -> f (Maybe [Domain]))
-> (Maybe [Domain] -> f (Maybe [Domain]))
-> CreateOrganization
-> f CreateOrganization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Domain] [Domain] [Domain] [Domain]
-> Iso
     (Maybe [Domain]) (Maybe [Domain]) (Maybe [Domain]) (Maybe [Domain])
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 [Domain] [Domain] [Domain] [Domain]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The organization alias.
createOrganization_alias :: Lens.Lens' CreateOrganization Prelude.Text
createOrganization_alias :: (Text -> f Text) -> CreateOrganization -> f CreateOrganization
createOrganization_alias = (CreateOrganization -> Text)
-> (CreateOrganization -> Text -> CreateOrganization)
-> Lens CreateOrganization CreateOrganization Text Text
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 :: CreateOrganization -> Request CreateOrganization
request = Service -> CreateOrganization -> Request CreateOrganization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateOrganization)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateOrganization))
-> Logger
-> Service
-> Proxy CreateOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateOrganization)))
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 -> Int -> CreateOrganizationResponse
CreateOrganizationResponse'
            (Maybe Text -> Int -> CreateOrganizationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateOrganizationResponse)
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
"OrganizationId")
            Either String (Int -> CreateOrganizationResponse)
-> Either String Int -> Either String CreateOrganizationResponse
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 CreateOrganization

instance Prelude.NFData CreateOrganization

instance Core.ToHeaders CreateOrganization where
  toHeaders :: CreateOrganization -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateOrganization -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"WorkMailService.CreateOrganization" ::
                          Prelude.ByteString
                      ),
            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 CreateOrganization where
  toJSON :: CreateOrganization -> Value
toJSON CreateOrganization' {Maybe Bool
Maybe [Domain]
Maybe Text
Text
alias :: Text
domains :: Maybe [Domain]
clientToken :: Maybe Text
kmsKeyArn :: Maybe Text
enableInteroperability :: Maybe Bool
directoryId :: Maybe Text
$sel:alias:CreateOrganization' :: CreateOrganization -> Text
$sel:domains:CreateOrganization' :: CreateOrganization -> Maybe [Domain]
$sel:clientToken:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:kmsKeyArn:CreateOrganization' :: CreateOrganization -> Maybe Text
$sel:enableInteroperability:CreateOrganization' :: CreateOrganization -> Maybe Bool
$sel:directoryId:CreateOrganization' :: CreateOrganization -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DirectoryId" 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
directoryId,
            (Text
"EnableInteroperability" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableInteroperability,
            (Text
"KmsKeyArn" 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
kmsKeyArn,
            (Text
"ClientToken" 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
clientToken,
            (Text
"Domains" Text -> [Domain] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Domain] -> Pair) -> Maybe [Domain] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Domain]
domains,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Alias" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
alias)
          ]
      )

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

instance Core.ToQuery CreateOrganization where
  toQuery :: CreateOrganization -> QueryString
toQuery = QueryString -> CreateOrganization -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateOrganizationResponse -> CreateOrganizationResponse -> Bool)
-> (CreateOrganizationResponse
    -> CreateOrganizationResponse -> Bool)
-> Eq CreateOrganizationResponse
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]
(Int -> ReadS CreateOrganizationResponse)
-> ReadS [CreateOrganizationResponse]
-> ReadPrec CreateOrganizationResponse
-> ReadPrec [CreateOrganizationResponse]
-> Read 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
(Int -> CreateOrganizationResponse -> ShowS)
-> (CreateOrganizationResponse -> String)
-> ([CreateOrganizationResponse] -> ShowS)
-> Show CreateOrganizationResponse
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.
 CreateOrganizationResponse -> Rep CreateOrganizationResponse x)
-> (forall x.
    Rep CreateOrganizationResponse x -> CreateOrganizationResponse)
-> Generic CreateOrganizationResponse
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' :: Maybe Text -> Int -> CreateOrganizationResponse
CreateOrganizationResponse'
    { $sel:organizationId:CreateOrganizationResponse' :: Maybe Text
organizationId =
        Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> CreateOrganizationResponse -> f CreateOrganizationResponse
createOrganizationResponse_organizationId = (CreateOrganizationResponse -> Maybe Text)
-> (CreateOrganizationResponse
    -> Maybe Text -> CreateOrganizationResponse)
-> Lens
     CreateOrganizationResponse
     CreateOrganizationResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Int -> f Int)
-> CreateOrganizationResponse -> f CreateOrganizationResponse
createOrganizationResponse_httpStatus = (CreateOrganizationResponse -> Int)
-> (CreateOrganizationResponse
    -> Int -> CreateOrganizationResponse)
-> Lens
     CreateOrganizationResponse CreateOrganizationResponse Int Int
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