{-# 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.SSOAdmin.CreateAccountAssignment
-- 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)
--
-- Assigns access to a principal for a specified Amazon Web Services
-- account using a specified permission set.
--
-- The term /principal/ here refers to a user or group that is defined in
-- Amazon Web Services SSO.
--
-- As part of a successful @CreateAccountAssignment@ call, the specified
-- permission set will automatically be provisioned to the account in the
-- form of an IAM policy. That policy is attached to the SSO-created IAM
-- role. If the permission set is subsequently updated, the corresponding
-- IAM policies attached to roles in your accounts will not be updated
-- automatically. In this case, you must call @ ProvisionPermissionSet @ to
-- make these updates.
module Amazonka.SSOAdmin.CreateAccountAssignment
  ( -- * Creating a Request
    CreateAccountAssignment (..),
    newCreateAccountAssignment,

    -- * Request Lenses
    createAccountAssignment_instanceArn,
    createAccountAssignment_targetId,
    createAccountAssignment_targetType,
    createAccountAssignment_permissionSetArn,
    createAccountAssignment_principalType,
    createAccountAssignment_principalId,

    -- * Destructuring the Response
    CreateAccountAssignmentResponse (..),
    newCreateAccountAssignmentResponse,

    -- * Response Lenses
    createAccountAssignmentResponse_accountAssignmentCreationStatus,
    createAccountAssignmentResponse_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.SSOAdmin.Types

-- | /See:/ 'newCreateAccountAssignment' smart constructor.
data CreateAccountAssignment = CreateAccountAssignment'
  { -- | The ARN of the SSO instance under which the operation will be executed.
    -- For more information about ARNs, see
    -- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
    -- in the /Amazon Web Services General Reference/.
    CreateAccountAssignment -> Text
instanceArn :: Prelude.Text,
    -- | TargetID is an Amazon Web Services account identifier, typically a 10-12
    -- digit string (For example, 123456789012).
    CreateAccountAssignment -> Text
targetId :: Prelude.Text,
    -- | The entity type for which the assignment will be created.
    CreateAccountAssignment -> TargetType
targetType :: TargetType,
    -- | The ARN of the permission set that the admin wants to grant the
    -- principal access to.
    CreateAccountAssignment -> Text
permissionSetArn :: Prelude.Text,
    -- | The entity type for which the assignment will be created.
    CreateAccountAssignment -> PrincipalType
principalType :: PrincipalType,
    -- | An identifier for an object in Amazon Web Services SSO, such as a user
    -- or group. PrincipalIds are GUIDs (For example,
    -- f81d4fae-7dec-11d0-a765-00a0c91e6bf6). For more information about
    -- PrincipalIds in Amazon Web Services SSO, see the
    -- </singlesignon/latest/IdentityStoreAPIReference/welcome.html Amazon Web Services SSO Identity Store API Reference>.
    CreateAccountAssignment -> Text
principalId :: Prelude.Text
  }
  deriving (CreateAccountAssignment -> CreateAccountAssignment -> Bool
(CreateAccountAssignment -> CreateAccountAssignment -> Bool)
-> (CreateAccountAssignment -> CreateAccountAssignment -> Bool)
-> Eq CreateAccountAssignment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountAssignment -> CreateAccountAssignment -> Bool
$c/= :: CreateAccountAssignment -> CreateAccountAssignment -> Bool
== :: CreateAccountAssignment -> CreateAccountAssignment -> Bool
$c== :: CreateAccountAssignment -> CreateAccountAssignment -> Bool
Prelude.Eq, ReadPrec [CreateAccountAssignment]
ReadPrec CreateAccountAssignment
Int -> ReadS CreateAccountAssignment
ReadS [CreateAccountAssignment]
(Int -> ReadS CreateAccountAssignment)
-> ReadS [CreateAccountAssignment]
-> ReadPrec CreateAccountAssignment
-> ReadPrec [CreateAccountAssignment]
-> Read CreateAccountAssignment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountAssignment]
$creadListPrec :: ReadPrec [CreateAccountAssignment]
readPrec :: ReadPrec CreateAccountAssignment
$creadPrec :: ReadPrec CreateAccountAssignment
readList :: ReadS [CreateAccountAssignment]
$creadList :: ReadS [CreateAccountAssignment]
readsPrec :: Int -> ReadS CreateAccountAssignment
$creadsPrec :: Int -> ReadS CreateAccountAssignment
Prelude.Read, Int -> CreateAccountAssignment -> ShowS
[CreateAccountAssignment] -> ShowS
CreateAccountAssignment -> String
(Int -> CreateAccountAssignment -> ShowS)
-> (CreateAccountAssignment -> String)
-> ([CreateAccountAssignment] -> ShowS)
-> Show CreateAccountAssignment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountAssignment] -> ShowS
$cshowList :: [CreateAccountAssignment] -> ShowS
show :: CreateAccountAssignment -> String
$cshow :: CreateAccountAssignment -> String
showsPrec :: Int -> CreateAccountAssignment -> ShowS
$cshowsPrec :: Int -> CreateAccountAssignment -> ShowS
Prelude.Show, (forall x.
 CreateAccountAssignment -> Rep CreateAccountAssignment x)
-> (forall x.
    Rep CreateAccountAssignment x -> CreateAccountAssignment)
-> Generic CreateAccountAssignment
forall x. Rep CreateAccountAssignment x -> CreateAccountAssignment
forall x. CreateAccountAssignment -> Rep CreateAccountAssignment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAccountAssignment x -> CreateAccountAssignment
$cfrom :: forall x. CreateAccountAssignment -> Rep CreateAccountAssignment x
Prelude.Generic)

-- |
-- Create a value of 'CreateAccountAssignment' 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:
--
-- 'instanceArn', 'createAccountAssignment_instanceArn' - The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
--
-- 'targetId', 'createAccountAssignment_targetId' - TargetID is an Amazon Web Services account identifier, typically a 10-12
-- digit string (For example, 123456789012).
--
-- 'targetType', 'createAccountAssignment_targetType' - The entity type for which the assignment will be created.
--
-- 'permissionSetArn', 'createAccountAssignment_permissionSetArn' - The ARN of the permission set that the admin wants to grant the
-- principal access to.
--
-- 'principalType', 'createAccountAssignment_principalType' - The entity type for which the assignment will be created.
--
-- 'principalId', 'createAccountAssignment_principalId' - An identifier for an object in Amazon Web Services SSO, such as a user
-- or group. PrincipalIds are GUIDs (For example,
-- f81d4fae-7dec-11d0-a765-00a0c91e6bf6). For more information about
-- PrincipalIds in Amazon Web Services SSO, see the
-- </singlesignon/latest/IdentityStoreAPIReference/welcome.html Amazon Web Services SSO Identity Store API Reference>.
newCreateAccountAssignment ::
  -- | 'instanceArn'
  Prelude.Text ->
  -- | 'targetId'
  Prelude.Text ->
  -- | 'targetType'
  TargetType ->
  -- | 'permissionSetArn'
  Prelude.Text ->
  -- | 'principalType'
  PrincipalType ->
  -- | 'principalId'
  Prelude.Text ->
  CreateAccountAssignment
newCreateAccountAssignment :: Text
-> Text
-> TargetType
-> Text
-> PrincipalType
-> Text
-> CreateAccountAssignment
newCreateAccountAssignment
  Text
pInstanceArn_
  Text
pTargetId_
  TargetType
pTargetType_
  Text
pPermissionSetArn_
  PrincipalType
pPrincipalType_
  Text
pPrincipalId_ =
    CreateAccountAssignment' :: Text
-> Text
-> TargetType
-> Text
-> PrincipalType
-> Text
-> CreateAccountAssignment
CreateAccountAssignment'
      { $sel:instanceArn:CreateAccountAssignment' :: Text
instanceArn =
          Text
pInstanceArn_,
        $sel:targetId:CreateAccountAssignment' :: Text
targetId = Text
pTargetId_,
        $sel:targetType:CreateAccountAssignment' :: TargetType
targetType = TargetType
pTargetType_,
        $sel:permissionSetArn:CreateAccountAssignment' :: Text
permissionSetArn = Text
pPermissionSetArn_,
        $sel:principalType:CreateAccountAssignment' :: PrincipalType
principalType = PrincipalType
pPrincipalType_,
        $sel:principalId:CreateAccountAssignment' :: Text
principalId = Text
pPrincipalId_
      }

-- | The ARN of the SSO instance under which the operation will be executed.
-- For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces>
-- in the /Amazon Web Services General Reference/.
createAccountAssignment_instanceArn :: Lens.Lens' CreateAccountAssignment Prelude.Text
createAccountAssignment_instanceArn :: (Text -> f Text)
-> CreateAccountAssignment -> f CreateAccountAssignment
createAccountAssignment_instanceArn = (CreateAccountAssignment -> Text)
-> (CreateAccountAssignment -> Text -> CreateAccountAssignment)
-> Lens CreateAccountAssignment CreateAccountAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAssignment' {Text
instanceArn :: Text
$sel:instanceArn:CreateAccountAssignment' :: CreateAccountAssignment -> Text
instanceArn} -> Text
instanceArn) (\s :: CreateAccountAssignment
s@CreateAccountAssignment' {} Text
a -> CreateAccountAssignment
s {$sel:instanceArn:CreateAccountAssignment' :: Text
instanceArn = Text
a} :: CreateAccountAssignment)

-- | TargetID is an Amazon Web Services account identifier, typically a 10-12
-- digit string (For example, 123456789012).
createAccountAssignment_targetId :: Lens.Lens' CreateAccountAssignment Prelude.Text
createAccountAssignment_targetId :: (Text -> f Text)
-> CreateAccountAssignment -> f CreateAccountAssignment
createAccountAssignment_targetId = (CreateAccountAssignment -> Text)
-> (CreateAccountAssignment -> Text -> CreateAccountAssignment)
-> Lens CreateAccountAssignment CreateAccountAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAssignment' {Text
targetId :: Text
$sel:targetId:CreateAccountAssignment' :: CreateAccountAssignment -> Text
targetId} -> Text
targetId) (\s :: CreateAccountAssignment
s@CreateAccountAssignment' {} Text
a -> CreateAccountAssignment
s {$sel:targetId:CreateAccountAssignment' :: Text
targetId = Text
a} :: CreateAccountAssignment)

-- | The entity type for which the assignment will be created.
createAccountAssignment_targetType :: Lens.Lens' CreateAccountAssignment TargetType
createAccountAssignment_targetType :: (TargetType -> f TargetType)
-> CreateAccountAssignment -> f CreateAccountAssignment
createAccountAssignment_targetType = (CreateAccountAssignment -> TargetType)
-> (CreateAccountAssignment
    -> TargetType -> CreateAccountAssignment)
-> Lens
     CreateAccountAssignment
     CreateAccountAssignment
     TargetType
     TargetType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAssignment' {TargetType
targetType :: TargetType
$sel:targetType:CreateAccountAssignment' :: CreateAccountAssignment -> TargetType
targetType} -> TargetType
targetType) (\s :: CreateAccountAssignment
s@CreateAccountAssignment' {} TargetType
a -> CreateAccountAssignment
s {$sel:targetType:CreateAccountAssignment' :: TargetType
targetType = TargetType
a} :: CreateAccountAssignment)

-- | The ARN of the permission set that the admin wants to grant the
-- principal access to.
createAccountAssignment_permissionSetArn :: Lens.Lens' CreateAccountAssignment Prelude.Text
createAccountAssignment_permissionSetArn :: (Text -> f Text)
-> CreateAccountAssignment -> f CreateAccountAssignment
createAccountAssignment_permissionSetArn = (CreateAccountAssignment -> Text)
-> (CreateAccountAssignment -> Text -> CreateAccountAssignment)
-> Lens CreateAccountAssignment CreateAccountAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAssignment' {Text
permissionSetArn :: Text
$sel:permissionSetArn:CreateAccountAssignment' :: CreateAccountAssignment -> Text
permissionSetArn} -> Text
permissionSetArn) (\s :: CreateAccountAssignment
s@CreateAccountAssignment' {} Text
a -> CreateAccountAssignment
s {$sel:permissionSetArn:CreateAccountAssignment' :: Text
permissionSetArn = Text
a} :: CreateAccountAssignment)

-- | The entity type for which the assignment will be created.
createAccountAssignment_principalType :: Lens.Lens' CreateAccountAssignment PrincipalType
createAccountAssignment_principalType :: (PrincipalType -> f PrincipalType)
-> CreateAccountAssignment -> f CreateAccountAssignment
createAccountAssignment_principalType = (CreateAccountAssignment -> PrincipalType)
-> (CreateAccountAssignment
    -> PrincipalType -> CreateAccountAssignment)
-> Lens
     CreateAccountAssignment
     CreateAccountAssignment
     PrincipalType
     PrincipalType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAssignment' {PrincipalType
principalType :: PrincipalType
$sel:principalType:CreateAccountAssignment' :: CreateAccountAssignment -> PrincipalType
principalType} -> PrincipalType
principalType) (\s :: CreateAccountAssignment
s@CreateAccountAssignment' {} PrincipalType
a -> CreateAccountAssignment
s {$sel:principalType:CreateAccountAssignment' :: PrincipalType
principalType = PrincipalType
a} :: CreateAccountAssignment)

-- | An identifier for an object in Amazon Web Services SSO, such as a user
-- or group. PrincipalIds are GUIDs (For example,
-- f81d4fae-7dec-11d0-a765-00a0c91e6bf6). For more information about
-- PrincipalIds in Amazon Web Services SSO, see the
-- </singlesignon/latest/IdentityStoreAPIReference/welcome.html Amazon Web Services SSO Identity Store API Reference>.
createAccountAssignment_principalId :: Lens.Lens' CreateAccountAssignment Prelude.Text
createAccountAssignment_principalId :: (Text -> f Text)
-> CreateAccountAssignment -> f CreateAccountAssignment
createAccountAssignment_principalId = (CreateAccountAssignment -> Text)
-> (CreateAccountAssignment -> Text -> CreateAccountAssignment)
-> Lens CreateAccountAssignment CreateAccountAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAssignment' {Text
principalId :: Text
$sel:principalId:CreateAccountAssignment' :: CreateAccountAssignment -> Text
principalId} -> Text
principalId) (\s :: CreateAccountAssignment
s@CreateAccountAssignment' {} Text
a -> CreateAccountAssignment
s {$sel:principalId:CreateAccountAssignment' :: Text
principalId = Text
a} :: CreateAccountAssignment)

instance Core.AWSRequest CreateAccountAssignment where
  type
    AWSResponse CreateAccountAssignment =
      CreateAccountAssignmentResponse
  request :: CreateAccountAssignment -> Request CreateAccountAssignment
request = Service
-> CreateAccountAssignment -> Request CreateAccountAssignment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateAccountAssignment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAccountAssignment)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateAccountAssignment))
-> Logger
-> Service
-> Proxy CreateAccountAssignment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateAccountAssignment)))
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 AccountAssignmentOperationStatus
-> Int -> CreateAccountAssignmentResponse
CreateAccountAssignmentResponse'
            (Maybe AccountAssignmentOperationStatus
 -> Int -> CreateAccountAssignmentResponse)
-> Either String (Maybe AccountAssignmentOperationStatus)
-> Either String (Int -> CreateAccountAssignmentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe AccountAssignmentOperationStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AccountAssignmentCreationStatus")
            Either String (Int -> CreateAccountAssignmentResponse)
-> Either String Int
-> Either String CreateAccountAssignmentResponse
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 CreateAccountAssignment

instance Prelude.NFData CreateAccountAssignment

instance Core.ToHeaders CreateAccountAssignment where
  toHeaders :: CreateAccountAssignment -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAccountAssignment -> 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
"SWBExternalService.CreateAccountAssignment" ::
                          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 CreateAccountAssignment where
  toJSON :: CreateAccountAssignment -> Value
toJSON CreateAccountAssignment' {Text
PrincipalType
TargetType
principalId :: Text
principalType :: PrincipalType
permissionSetArn :: Text
targetType :: TargetType
targetId :: Text
instanceArn :: Text
$sel:principalId:CreateAccountAssignment' :: CreateAccountAssignment -> Text
$sel:principalType:CreateAccountAssignment' :: CreateAccountAssignment -> PrincipalType
$sel:permissionSetArn:CreateAccountAssignment' :: CreateAccountAssignment -> Text
$sel:targetType:CreateAccountAssignment' :: CreateAccountAssignment -> TargetType
$sel:targetId:CreateAccountAssignment' :: CreateAccountAssignment -> Text
$sel:instanceArn:CreateAccountAssignment' :: CreateAccountAssignment -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TargetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TargetType" Text -> TargetType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TargetType
targetType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PermissionSetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
permissionSetArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PrincipalType" Text -> PrincipalType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PrincipalType
principalType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PrincipalId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
principalId)
          ]
      )

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

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

-- | /See:/ 'newCreateAccountAssignmentResponse' smart constructor.
data CreateAccountAssignmentResponse = CreateAccountAssignmentResponse'
  { -- | The status object for the account assignment creation operation.
    CreateAccountAssignmentResponse
-> Maybe AccountAssignmentOperationStatus
accountAssignmentCreationStatus :: Prelude.Maybe AccountAssignmentOperationStatus,
    -- | The response's http status code.
    CreateAccountAssignmentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateAccountAssignmentResponse
-> CreateAccountAssignmentResponse -> Bool
(CreateAccountAssignmentResponse
 -> CreateAccountAssignmentResponse -> Bool)
-> (CreateAccountAssignmentResponse
    -> CreateAccountAssignmentResponse -> Bool)
-> Eq CreateAccountAssignmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountAssignmentResponse
-> CreateAccountAssignmentResponse -> Bool
$c/= :: CreateAccountAssignmentResponse
-> CreateAccountAssignmentResponse -> Bool
== :: CreateAccountAssignmentResponse
-> CreateAccountAssignmentResponse -> Bool
$c== :: CreateAccountAssignmentResponse
-> CreateAccountAssignmentResponse -> Bool
Prelude.Eq, ReadPrec [CreateAccountAssignmentResponse]
ReadPrec CreateAccountAssignmentResponse
Int -> ReadS CreateAccountAssignmentResponse
ReadS [CreateAccountAssignmentResponse]
(Int -> ReadS CreateAccountAssignmentResponse)
-> ReadS [CreateAccountAssignmentResponse]
-> ReadPrec CreateAccountAssignmentResponse
-> ReadPrec [CreateAccountAssignmentResponse]
-> Read CreateAccountAssignmentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountAssignmentResponse]
$creadListPrec :: ReadPrec [CreateAccountAssignmentResponse]
readPrec :: ReadPrec CreateAccountAssignmentResponse
$creadPrec :: ReadPrec CreateAccountAssignmentResponse
readList :: ReadS [CreateAccountAssignmentResponse]
$creadList :: ReadS [CreateAccountAssignmentResponse]
readsPrec :: Int -> ReadS CreateAccountAssignmentResponse
$creadsPrec :: Int -> ReadS CreateAccountAssignmentResponse
Prelude.Read, Int -> CreateAccountAssignmentResponse -> ShowS
[CreateAccountAssignmentResponse] -> ShowS
CreateAccountAssignmentResponse -> String
(Int -> CreateAccountAssignmentResponse -> ShowS)
-> (CreateAccountAssignmentResponse -> String)
-> ([CreateAccountAssignmentResponse] -> ShowS)
-> Show CreateAccountAssignmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountAssignmentResponse] -> ShowS
$cshowList :: [CreateAccountAssignmentResponse] -> ShowS
show :: CreateAccountAssignmentResponse -> String
$cshow :: CreateAccountAssignmentResponse -> String
showsPrec :: Int -> CreateAccountAssignmentResponse -> ShowS
$cshowsPrec :: Int -> CreateAccountAssignmentResponse -> ShowS
Prelude.Show, (forall x.
 CreateAccountAssignmentResponse
 -> Rep CreateAccountAssignmentResponse x)
-> (forall x.
    Rep CreateAccountAssignmentResponse x
    -> CreateAccountAssignmentResponse)
-> Generic CreateAccountAssignmentResponse
forall x.
Rep CreateAccountAssignmentResponse x
-> CreateAccountAssignmentResponse
forall x.
CreateAccountAssignmentResponse
-> Rep CreateAccountAssignmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAccountAssignmentResponse x
-> CreateAccountAssignmentResponse
$cfrom :: forall x.
CreateAccountAssignmentResponse
-> Rep CreateAccountAssignmentResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAccountAssignmentResponse' 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:
--
-- 'accountAssignmentCreationStatus', 'createAccountAssignmentResponse_accountAssignmentCreationStatus' - The status object for the account assignment creation operation.
--
-- 'httpStatus', 'createAccountAssignmentResponse_httpStatus' - The response's http status code.
newCreateAccountAssignmentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAccountAssignmentResponse
newCreateAccountAssignmentResponse :: Int -> CreateAccountAssignmentResponse
newCreateAccountAssignmentResponse Int
pHttpStatus_ =
  CreateAccountAssignmentResponse' :: Maybe AccountAssignmentOperationStatus
-> Int -> CreateAccountAssignmentResponse
CreateAccountAssignmentResponse'
    { $sel:accountAssignmentCreationStatus:CreateAccountAssignmentResponse' :: Maybe AccountAssignmentOperationStatus
accountAssignmentCreationStatus =
        Maybe AccountAssignmentOperationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAccountAssignmentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status object for the account assignment creation operation.
createAccountAssignmentResponse_accountAssignmentCreationStatus :: Lens.Lens' CreateAccountAssignmentResponse (Prelude.Maybe AccountAssignmentOperationStatus)
createAccountAssignmentResponse_accountAssignmentCreationStatus :: (Maybe AccountAssignmentOperationStatus
 -> f (Maybe AccountAssignmentOperationStatus))
-> CreateAccountAssignmentResponse
-> f CreateAccountAssignmentResponse
createAccountAssignmentResponse_accountAssignmentCreationStatus = (CreateAccountAssignmentResponse
 -> Maybe AccountAssignmentOperationStatus)
-> (CreateAccountAssignmentResponse
    -> Maybe AccountAssignmentOperationStatus
    -> CreateAccountAssignmentResponse)
-> Lens
     CreateAccountAssignmentResponse
     CreateAccountAssignmentResponse
     (Maybe AccountAssignmentOperationStatus)
     (Maybe AccountAssignmentOperationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAssignmentResponse' {Maybe AccountAssignmentOperationStatus
accountAssignmentCreationStatus :: Maybe AccountAssignmentOperationStatus
$sel:accountAssignmentCreationStatus:CreateAccountAssignmentResponse' :: CreateAccountAssignmentResponse
-> Maybe AccountAssignmentOperationStatus
accountAssignmentCreationStatus} -> Maybe AccountAssignmentOperationStatus
accountAssignmentCreationStatus) (\s :: CreateAccountAssignmentResponse
s@CreateAccountAssignmentResponse' {} Maybe AccountAssignmentOperationStatus
a -> CreateAccountAssignmentResponse
s {$sel:accountAssignmentCreationStatus:CreateAccountAssignmentResponse' :: Maybe AccountAssignmentOperationStatus
accountAssignmentCreationStatus = Maybe AccountAssignmentOperationStatus
a} :: CreateAccountAssignmentResponse)

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

instance
  Prelude.NFData
    CreateAccountAssignmentResponse