{-# 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.Organizations.InviteAccountToOrganization
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Sends an invitation to another account to join your organization as a
-- member account. Organizations sends email on your behalf to the email
-- address that is associated with the other account\'s owner. The
-- invitation is implemented as a Handshake whose details are in the
-- response.
--
-- -   You can invite Amazon Web Services accounts only from the same
--     seller as the management account. For example, if your
--     organization\'s management account was created by Amazon Internet
--     Services Pvt. Ltd (AISPL), an Amazon Web Services seller in India,
--     you can invite only other AISPL accounts to your organization. You
--     can\'t combine accounts from AISPL and Amazon Web Services or from
--     any other Amazon Web Services seller. For more information, see
--     <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilliing-India.html Consolidated Billing in India>.
--
-- -   If you receive an exception that indicates that you exceeded your
--     account limits for the organization or that the operation failed
--     because your organization is still initializing, wait one hour and
--     then try again. If the error persists after an hour, contact
--     <https://console.aws.amazon.com/support/home#/ Amazon Web Services Support>.
--
-- If the request includes tags, then the requester must have the
-- @organizations:TagResource@ permission.
--
-- This operation can be called only from the organization\'s management
-- account.
module Amazonka.Organizations.InviteAccountToOrganization
  ( -- * Creating a Request
    InviteAccountToOrganization (..),
    newInviteAccountToOrganization,

    -- * Request Lenses
    inviteAccountToOrganization_notes,
    inviteAccountToOrganization_tags,
    inviteAccountToOrganization_target,

    -- * Destructuring the Response
    InviteAccountToOrganizationResponse (..),
    newInviteAccountToOrganizationResponse,

    -- * Response Lenses
    inviteAccountToOrganizationResponse_handshake,
    inviteAccountToOrganizationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newInviteAccountToOrganization' smart constructor.
data InviteAccountToOrganization = InviteAccountToOrganization'
  { -- | Additional information that you want to include in the generated email
    -- to the recipient account owner.
    InviteAccountToOrganization -> Maybe (Sensitive Text)
notes :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | A list of tags that you want to attach to the account when it becomes a
    -- member of the organization. For each tag in the list, you must specify
    -- both a tag key and a value. You can set the value to an empty string,
    -- but you can\'t set it to @null@. For more information about tagging, see
    -- <https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html Tagging Organizations resources>
    -- in the Organizations User Guide.
    --
    -- Any tags in the request are checked for compliance with any applicable
    -- tag policies when the request is made. The request is rejected if the
    -- tags in the request don\'t match the requirements of the policy at that
    -- time. Tag policy compliance is /__not__/ checked again when the
    -- invitation is accepted and the tags are actually attached to the
    -- account. That means that if the tag policy changes between the
    -- invitation and the acceptance, then that tags could potentially be
    -- non-compliant.
    --
    -- If any one of the tags is invalid or if you exceed the allowed number of
    -- tags for an account, then the entire request fails and invitations are
    -- not sent.
    InviteAccountToOrganization -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The identifier (ID) of the Amazon Web Services account that you want to
    -- invite to join your organization. This is a JSON object that contains
    -- the following elements:
    --
    -- @{ \"Type\": \"ACCOUNT\", \"Id\": \"\< @/__@account id number@__/@ >\" }@
    --
    -- If you use the CLI, you can submit this as a single string, similar to
    -- the following example:
    --
    -- @--target Id=123456789012,Type=ACCOUNT@
    --
    -- If you specify @\"Type\": \"ACCOUNT\"@, you must provide the Amazon Web
    -- Services account ID number as the @Id@. If you specify
    -- @\"Type\": \"EMAIL\"@, you must specify the email address that is
    -- associated with the account.
    --
    -- @--target Id=diego\@example.com,Type=EMAIL@
    InviteAccountToOrganization -> HandshakeParty
target :: HandshakeParty
  }
  deriving (InviteAccountToOrganization -> InviteAccountToOrganization -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InviteAccountToOrganization -> InviteAccountToOrganization -> Bool
$c/= :: InviteAccountToOrganization -> InviteAccountToOrganization -> Bool
== :: InviteAccountToOrganization -> InviteAccountToOrganization -> Bool
$c== :: InviteAccountToOrganization -> InviteAccountToOrganization -> Bool
Prelude.Eq, Int -> InviteAccountToOrganization -> ShowS
[InviteAccountToOrganization] -> ShowS
InviteAccountToOrganization -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InviteAccountToOrganization] -> ShowS
$cshowList :: [InviteAccountToOrganization] -> ShowS
show :: InviteAccountToOrganization -> String
$cshow :: InviteAccountToOrganization -> String
showsPrec :: Int -> InviteAccountToOrganization -> ShowS
$cshowsPrec :: Int -> InviteAccountToOrganization -> ShowS
Prelude.Show, forall x.
Rep InviteAccountToOrganization x -> InviteAccountToOrganization
forall x.
InviteAccountToOrganization -> Rep InviteAccountToOrganization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InviteAccountToOrganization x -> InviteAccountToOrganization
$cfrom :: forall x.
InviteAccountToOrganization -> Rep InviteAccountToOrganization x
Prelude.Generic)

-- |
-- Create a value of 'InviteAccountToOrganization' 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:
--
-- 'notes', 'inviteAccountToOrganization_notes' - Additional information that you want to include in the generated email
-- to the recipient account owner.
--
-- 'tags', 'inviteAccountToOrganization_tags' - A list of tags that you want to attach to the account when it becomes a
-- member of the organization. For each tag in the list, you must specify
-- both a tag key and a value. You can set the value to an empty string,
-- but you can\'t set it to @null@. For more information about tagging, see
-- <https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html Tagging Organizations resources>
-- in the Organizations User Guide.
--
-- Any tags in the request are checked for compliance with any applicable
-- tag policies when the request is made. The request is rejected if the
-- tags in the request don\'t match the requirements of the policy at that
-- time. Tag policy compliance is /__not__/ checked again when the
-- invitation is accepted and the tags are actually attached to the
-- account. That means that if the tag policy changes between the
-- invitation and the acceptance, then that tags could potentially be
-- non-compliant.
--
-- If any one of the tags is invalid or if you exceed the allowed number of
-- tags for an account, then the entire request fails and invitations are
-- not sent.
--
-- 'target', 'inviteAccountToOrganization_target' - The identifier (ID) of the Amazon Web Services account that you want to
-- invite to join your organization. This is a JSON object that contains
-- the following elements:
--
-- @{ \"Type\": \"ACCOUNT\", \"Id\": \"\< @/__@account id number@__/@ >\" }@
--
-- If you use the CLI, you can submit this as a single string, similar to
-- the following example:
--
-- @--target Id=123456789012,Type=ACCOUNT@
--
-- If you specify @\"Type\": \"ACCOUNT\"@, you must provide the Amazon Web
-- Services account ID number as the @Id@. If you specify
-- @\"Type\": \"EMAIL\"@, you must specify the email address that is
-- associated with the account.
--
-- @--target Id=diego\@example.com,Type=EMAIL@
newInviteAccountToOrganization ::
  -- | 'target'
  HandshakeParty ->
  InviteAccountToOrganization
newInviteAccountToOrganization :: HandshakeParty -> InviteAccountToOrganization
newInviteAccountToOrganization HandshakeParty
pTarget_ =
  InviteAccountToOrganization'
    { $sel:notes:InviteAccountToOrganization' :: Maybe (Sensitive Text)
notes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:tags:InviteAccountToOrganization' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:target:InviteAccountToOrganization' :: HandshakeParty
target = HandshakeParty
pTarget_
    }

-- | Additional information that you want to include in the generated email
-- to the recipient account owner.
inviteAccountToOrganization_notes :: Lens.Lens' InviteAccountToOrganization (Prelude.Maybe Prelude.Text)
inviteAccountToOrganization_notes :: Lens' InviteAccountToOrganization (Maybe Text)
inviteAccountToOrganization_notes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteAccountToOrganization' {Maybe (Sensitive Text)
notes :: Maybe (Sensitive Text)
$sel:notes:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe (Sensitive Text)
notes} -> Maybe (Sensitive Text)
notes) (\s :: InviteAccountToOrganization
s@InviteAccountToOrganization' {} Maybe (Sensitive Text)
a -> InviteAccountToOrganization
s {$sel:notes:InviteAccountToOrganization' :: Maybe (Sensitive Text)
notes = Maybe (Sensitive Text)
a} :: InviteAccountToOrganization) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | A list of tags that you want to attach to the account when it becomes a
-- member of the organization. For each tag in the list, you must specify
-- both a tag key and a value. You can set the value to an empty string,
-- but you can\'t set it to @null@. For more information about tagging, see
-- <https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html Tagging Organizations resources>
-- in the Organizations User Guide.
--
-- Any tags in the request are checked for compliance with any applicable
-- tag policies when the request is made. The request is rejected if the
-- tags in the request don\'t match the requirements of the policy at that
-- time. Tag policy compliance is /__not__/ checked again when the
-- invitation is accepted and the tags are actually attached to the
-- account. That means that if the tag policy changes between the
-- invitation and the acceptance, then that tags could potentially be
-- non-compliant.
--
-- If any one of the tags is invalid or if you exceed the allowed number of
-- tags for an account, then the entire request fails and invitations are
-- not sent.
inviteAccountToOrganization_tags :: Lens.Lens' InviteAccountToOrganization (Prelude.Maybe [Tag])
inviteAccountToOrganization_tags :: Lens' InviteAccountToOrganization (Maybe [Tag])
inviteAccountToOrganization_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteAccountToOrganization' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: InviteAccountToOrganization
s@InviteAccountToOrganization' {} Maybe [Tag]
a -> InviteAccountToOrganization
s {$sel:tags:InviteAccountToOrganization' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: InviteAccountToOrganization) 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

-- | The identifier (ID) of the Amazon Web Services account that you want to
-- invite to join your organization. This is a JSON object that contains
-- the following elements:
--
-- @{ \"Type\": \"ACCOUNT\", \"Id\": \"\< @/__@account id number@__/@ >\" }@
--
-- If you use the CLI, you can submit this as a single string, similar to
-- the following example:
--
-- @--target Id=123456789012,Type=ACCOUNT@
--
-- If you specify @\"Type\": \"ACCOUNT\"@, you must provide the Amazon Web
-- Services account ID number as the @Id@. If you specify
-- @\"Type\": \"EMAIL\"@, you must specify the email address that is
-- associated with the account.
--
-- @--target Id=diego\@example.com,Type=EMAIL@
inviteAccountToOrganization_target :: Lens.Lens' InviteAccountToOrganization HandshakeParty
inviteAccountToOrganization_target :: Lens' InviteAccountToOrganization HandshakeParty
inviteAccountToOrganization_target = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteAccountToOrganization' {HandshakeParty
target :: HandshakeParty
$sel:target:InviteAccountToOrganization' :: InviteAccountToOrganization -> HandshakeParty
target} -> HandshakeParty
target) (\s :: InviteAccountToOrganization
s@InviteAccountToOrganization' {} HandshakeParty
a -> InviteAccountToOrganization
s {$sel:target:InviteAccountToOrganization' :: HandshakeParty
target = HandshakeParty
a} :: InviteAccountToOrganization)

instance Core.AWSRequest InviteAccountToOrganization where
  type
    AWSResponse InviteAccountToOrganization =
      InviteAccountToOrganizationResponse
  request :: (Service -> Service)
-> InviteAccountToOrganization
-> Request InviteAccountToOrganization
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 InviteAccountToOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse InviteAccountToOrganization)))
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 Handshake -> Int -> InviteAccountToOrganizationResponse
InviteAccountToOrganizationResponse'
            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
"Handshake")
            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 InviteAccountToOrganization where
  hashWithSalt :: Int -> InviteAccountToOrganization -> Int
hashWithSalt Int
_salt InviteAccountToOrganization' {Maybe [Tag]
Maybe (Sensitive Text)
HandshakeParty
target :: HandshakeParty
tags :: Maybe [Tag]
notes :: Maybe (Sensitive Text)
$sel:target:InviteAccountToOrganization' :: InviteAccountToOrganization -> HandshakeParty
$sel:tags:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe [Tag]
$sel:notes:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
notes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HandshakeParty
target

instance Prelude.NFData InviteAccountToOrganization where
  rnf :: InviteAccountToOrganization -> ()
rnf InviteAccountToOrganization' {Maybe [Tag]
Maybe (Sensitive Text)
HandshakeParty
target :: HandshakeParty
tags :: Maybe [Tag]
notes :: Maybe (Sensitive Text)
$sel:target:InviteAccountToOrganization' :: InviteAccountToOrganization -> HandshakeParty
$sel:tags:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe [Tag]
$sel:notes:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
notes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HandshakeParty
target

instance Data.ToHeaders InviteAccountToOrganization where
  toHeaders :: InviteAccountToOrganization -> 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
"AWSOrganizationsV20161128.InviteAccountToOrganization" ::
                          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 InviteAccountToOrganization where
  toJSON :: InviteAccountToOrganization -> Value
toJSON InviteAccountToOrganization' {Maybe [Tag]
Maybe (Sensitive Text)
HandshakeParty
target :: HandshakeParty
tags :: Maybe [Tag]
notes :: Maybe (Sensitive Text)
$sel:target:InviteAccountToOrganization' :: InviteAccountToOrganization -> HandshakeParty
$sel:tags:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe [Tag]
$sel:notes:InviteAccountToOrganization' :: InviteAccountToOrganization -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Notes" 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 (Sensitive Text)
notes,
            (Key
"Tags" 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 [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Target" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HandshakeParty
target)
          ]
      )

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

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

-- | /See:/ 'newInviteAccountToOrganizationResponse' smart constructor.
data InviteAccountToOrganizationResponse = InviteAccountToOrganizationResponse'
  { -- | A structure that contains details about the handshake that is created to
    -- support this invitation request.
    InviteAccountToOrganizationResponse -> Maybe Handshake
handshake :: Prelude.Maybe Handshake,
    -- | The response's http status code.
    InviteAccountToOrganizationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (InviteAccountToOrganizationResponse
-> InviteAccountToOrganizationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InviteAccountToOrganizationResponse
-> InviteAccountToOrganizationResponse -> Bool
$c/= :: InviteAccountToOrganizationResponse
-> InviteAccountToOrganizationResponse -> Bool
== :: InviteAccountToOrganizationResponse
-> InviteAccountToOrganizationResponse -> Bool
$c== :: InviteAccountToOrganizationResponse
-> InviteAccountToOrganizationResponse -> Bool
Prelude.Eq, Int -> InviteAccountToOrganizationResponse -> ShowS
[InviteAccountToOrganizationResponse] -> ShowS
InviteAccountToOrganizationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InviteAccountToOrganizationResponse] -> ShowS
$cshowList :: [InviteAccountToOrganizationResponse] -> ShowS
show :: InviteAccountToOrganizationResponse -> String
$cshow :: InviteAccountToOrganizationResponse -> String
showsPrec :: Int -> InviteAccountToOrganizationResponse -> ShowS
$cshowsPrec :: Int -> InviteAccountToOrganizationResponse -> ShowS
Prelude.Show, forall x.
Rep InviteAccountToOrganizationResponse x
-> InviteAccountToOrganizationResponse
forall x.
InviteAccountToOrganizationResponse
-> Rep InviteAccountToOrganizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InviteAccountToOrganizationResponse x
-> InviteAccountToOrganizationResponse
$cfrom :: forall x.
InviteAccountToOrganizationResponse
-> Rep InviteAccountToOrganizationResponse x
Prelude.Generic)

-- |
-- Create a value of 'InviteAccountToOrganizationResponse' 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:
--
-- 'handshake', 'inviteAccountToOrganizationResponse_handshake' - A structure that contains details about the handshake that is created to
-- support this invitation request.
--
-- 'httpStatus', 'inviteAccountToOrganizationResponse_httpStatus' - The response's http status code.
newInviteAccountToOrganizationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  InviteAccountToOrganizationResponse
newInviteAccountToOrganizationResponse :: Int -> InviteAccountToOrganizationResponse
newInviteAccountToOrganizationResponse Int
pHttpStatus_ =
  InviteAccountToOrganizationResponse'
    { $sel:handshake:InviteAccountToOrganizationResponse' :: Maybe Handshake
handshake =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:InviteAccountToOrganizationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A structure that contains details about the handshake that is created to
-- support this invitation request.
inviteAccountToOrganizationResponse_handshake :: Lens.Lens' InviteAccountToOrganizationResponse (Prelude.Maybe Handshake)
inviteAccountToOrganizationResponse_handshake :: Lens' InviteAccountToOrganizationResponse (Maybe Handshake)
inviteAccountToOrganizationResponse_handshake = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteAccountToOrganizationResponse' {Maybe Handshake
handshake :: Maybe Handshake
$sel:handshake:InviteAccountToOrganizationResponse' :: InviteAccountToOrganizationResponse -> Maybe Handshake
handshake} -> Maybe Handshake
handshake) (\s :: InviteAccountToOrganizationResponse
s@InviteAccountToOrganizationResponse' {} Maybe Handshake
a -> InviteAccountToOrganizationResponse
s {$sel:handshake:InviteAccountToOrganizationResponse' :: Maybe Handshake
handshake = Maybe Handshake
a} :: InviteAccountToOrganizationResponse)

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

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