{-# 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-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)
--
-- Sends an invitation to another account to join your organization as a
-- member account. AWS 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 AWS 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
--     AWS seller in India, you can invite only other AISPL accounts to
--     your organization. You can\'t combine accounts from AISPL and AWS or
--     from any other AWS seller. For more information, see
--     <http://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#/ AWS 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.Lens as Lens
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 (Core.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 AWS Organizations resources>
    -- in the AWS 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 AWS 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 AWS 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 AWS 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
(InviteAccountToOrganization
 -> InviteAccountToOrganization -> Bool)
-> (InviteAccountToOrganization
    -> InviteAccountToOrganization -> Bool)
-> Eq InviteAccountToOrganization
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
(Int -> InviteAccountToOrganization -> ShowS)
-> (InviteAccountToOrganization -> String)
-> ([InviteAccountToOrganization] -> ShowS)
-> Show InviteAccountToOrganization
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.
 InviteAccountToOrganization -> Rep InviteAccountToOrganization x)
-> (forall x.
    Rep InviteAccountToOrganization x -> InviteAccountToOrganization)
-> Generic InviteAccountToOrganization
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 AWS Organizations resources>
-- in the AWS 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 AWS 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 AWS 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 AWS 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' :: Maybe (Sensitive Text)
-> Maybe [Tag] -> HandshakeParty -> InviteAccountToOrganization
InviteAccountToOrganization'
    { $sel:notes:InviteAccountToOrganization' :: Maybe (Sensitive Text)
notes =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:InviteAccountToOrganization' :: Maybe [Tag]
tags = Maybe [Tag]
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 :: (Maybe Text -> f (Maybe Text))
-> InviteAccountToOrganization -> f InviteAccountToOrganization
inviteAccountToOrganization_notes = (InviteAccountToOrganization -> Maybe (Sensitive Text))
-> (InviteAccountToOrganization
    -> Maybe (Sensitive Text) -> InviteAccountToOrganization)
-> Lens
     InviteAccountToOrganization
     InviteAccountToOrganization
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> InviteAccountToOrganization -> f InviteAccountToOrganization)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> InviteAccountToOrganization
-> f InviteAccountToOrganization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._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 AWS Organizations resources>
-- in the AWS 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 :: (Maybe [Tag] -> f (Maybe [Tag]))
-> InviteAccountToOrganization -> f InviteAccountToOrganization
inviteAccountToOrganization_tags = (InviteAccountToOrganization -> Maybe [Tag])
-> (InviteAccountToOrganization
    -> Maybe [Tag] -> InviteAccountToOrganization)
-> Lens
     InviteAccountToOrganization
     InviteAccountToOrganization
     (Maybe [Tag])
     (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> InviteAccountToOrganization -> f InviteAccountToOrganization)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> InviteAccountToOrganization
-> f InviteAccountToOrganization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier (ID) of the AWS 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 AWS 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 AWS 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 :: (HandshakeParty -> f HandshakeParty)
-> InviteAccountToOrganization -> f InviteAccountToOrganization
inviteAccountToOrganization_target = (InviteAccountToOrganization -> HandshakeParty)
-> (InviteAccountToOrganization
    -> HandshakeParty -> InviteAccountToOrganization)
-> Lens
     InviteAccountToOrganization
     InviteAccountToOrganization
     HandshakeParty
     HandshakeParty
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 :: InviteAccountToOrganization -> Request InviteAccountToOrganization
request = Service
-> InviteAccountToOrganization
-> Request InviteAccountToOrganization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy InviteAccountToOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse InviteAccountToOrganization)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse InviteAccountToOrganization))
-> Logger
-> Service
-> Proxy InviteAccountToOrganization
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse InviteAccountToOrganization)))
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 Handshake -> Int -> InviteAccountToOrganizationResponse
InviteAccountToOrganizationResponse'
            (Maybe Handshake -> Int -> InviteAccountToOrganizationResponse)
-> Either String (Maybe Handshake)
-> Either String (Int -> InviteAccountToOrganizationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Handshake)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Handshake")
            Either String (Int -> InviteAccountToOrganizationResponse)
-> Either String Int
-> Either String InviteAccountToOrganizationResponse
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 InviteAccountToOrganization

instance Prelude.NFData InviteAccountToOrganization

instance Core.ToHeaders InviteAccountToOrganization where
  toHeaders :: InviteAccountToOrganization -> ResponseHeaders
toHeaders =
    ResponseHeaders -> InviteAccountToOrganization -> 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
"AWSOrganizationsV20161128.InviteAccountToOrganization" ::
                          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 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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Notes" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
notes,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Target" Text -> HandshakeParty -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HandshakeParty
target)
          ]
      )

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

instance Core.ToQuery InviteAccountToOrganization where
  toQuery :: InviteAccountToOrganization -> QueryString
toQuery = QueryString -> InviteAccountToOrganization -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(InviteAccountToOrganizationResponse
 -> InviteAccountToOrganizationResponse -> Bool)
-> (InviteAccountToOrganizationResponse
    -> InviteAccountToOrganizationResponse -> Bool)
-> Eq InviteAccountToOrganizationResponse
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
(Int -> InviteAccountToOrganizationResponse -> ShowS)
-> (InviteAccountToOrganizationResponse -> String)
-> ([InviteAccountToOrganizationResponse] -> ShowS)
-> Show InviteAccountToOrganizationResponse
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.
 InviteAccountToOrganizationResponse
 -> Rep InviteAccountToOrganizationResponse x)
-> (forall x.
    Rep InviteAccountToOrganizationResponse x
    -> InviteAccountToOrganizationResponse)
-> Generic InviteAccountToOrganizationResponse
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' :: Maybe Handshake -> Int -> InviteAccountToOrganizationResponse
InviteAccountToOrganizationResponse'
    { $sel:handshake:InviteAccountToOrganizationResponse' :: Maybe Handshake
handshake =
        Maybe 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 :: (Maybe Handshake -> f (Maybe Handshake))
-> InviteAccountToOrganizationResponse
-> f InviteAccountToOrganizationResponse
inviteAccountToOrganizationResponse_handshake = (InviteAccountToOrganizationResponse -> Maybe Handshake)
-> (InviteAccountToOrganizationResponse
    -> Maybe Handshake -> InviteAccountToOrganizationResponse)
-> Lens
     InviteAccountToOrganizationResponse
     InviteAccountToOrganizationResponse
     (Maybe Handshake)
     (Maybe 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 :: (Int -> f Int)
-> InviteAccountToOrganizationResponse
-> f InviteAccountToOrganizationResponse
inviteAccountToOrganizationResponse_httpStatus = (InviteAccountToOrganizationResponse -> Int)
-> (InviteAccountToOrganizationResponse
    -> Int -> InviteAccountToOrganizationResponse)
-> Lens
     InviteAccountToOrganizationResponse
     InviteAccountToOrganizationResponse
     Int
     Int
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