{-# 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.Proton.CreateEnvironmentAccountConnection
-- 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)
--
-- Create an environment account connection in an environment account so
-- that environment infrastructure resources can be provisioned in the
-- environment account from a management account.
--
-- An environment account connection is a secure bi-directional connection
-- between a /management account/ and an /environment account/ that
-- maintains authorization and permissions. For more information, see
-- <https://docs.aws.amazon.com/proton/latest/adminguide/ag-env-account-connections.html Environment account connections>
-- in the /AWS Proton Administrator guide/.
module Amazonka.Proton.CreateEnvironmentAccountConnection
  ( -- * Creating a Request
    CreateEnvironmentAccountConnection (..),
    newCreateEnvironmentAccountConnection,

    -- * Request Lenses
    createEnvironmentAccountConnection_clientToken,
    createEnvironmentAccountConnection_environmentName,
    createEnvironmentAccountConnection_managementAccountId,
    createEnvironmentAccountConnection_roleArn,

    -- * Destructuring the Response
    CreateEnvironmentAccountConnectionResponse (..),
    newCreateEnvironmentAccountConnectionResponse,

    -- * Response Lenses
    createEnvironmentAccountConnectionResponse_httpStatus,
    createEnvironmentAccountConnectionResponse_environmentAccountConnection,
  )
where

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

-- | /See:/ 'newCreateEnvironmentAccountConnection' smart constructor.
data CreateEnvironmentAccountConnection = CreateEnvironmentAccountConnection'
  { -- | When included, if two identicial requests are made with the same client
    -- token, AWS Proton returns the environment account connection that the
    -- first request created.
    CreateEnvironmentAccountConnection -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the AWS Proton environment that\'s created in the associated
    -- management account.
    CreateEnvironmentAccountConnection -> Text
environmentName :: Prelude.Text,
    -- | The ID of the management account that accepts or rejects the environment
    -- account connection. You create an manage the AWS Proton environment in
    -- this account. If the management account accepts the environment account
    -- connection, AWS Proton can use the associated IAM role to provision
    -- environment infrastructure resources in the associated environment
    -- account.
    CreateEnvironmentAccountConnection -> Text
managementAccountId :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM service role that\'s created
    -- in the environment account. AWS Proton uses this role to provision
    -- infrastructure resources in the associated environment account.
    CreateEnvironmentAccountConnection -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateEnvironmentAccountConnection
-> CreateEnvironmentAccountConnection -> Bool
(CreateEnvironmentAccountConnection
 -> CreateEnvironmentAccountConnection -> Bool)
-> (CreateEnvironmentAccountConnection
    -> CreateEnvironmentAccountConnection -> Bool)
-> Eq CreateEnvironmentAccountConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEnvironmentAccountConnection
-> CreateEnvironmentAccountConnection -> Bool
$c/= :: CreateEnvironmentAccountConnection
-> CreateEnvironmentAccountConnection -> Bool
== :: CreateEnvironmentAccountConnection
-> CreateEnvironmentAccountConnection -> Bool
$c== :: CreateEnvironmentAccountConnection
-> CreateEnvironmentAccountConnection -> Bool
Prelude.Eq, ReadPrec [CreateEnvironmentAccountConnection]
ReadPrec CreateEnvironmentAccountConnection
Int -> ReadS CreateEnvironmentAccountConnection
ReadS [CreateEnvironmentAccountConnection]
(Int -> ReadS CreateEnvironmentAccountConnection)
-> ReadS [CreateEnvironmentAccountConnection]
-> ReadPrec CreateEnvironmentAccountConnection
-> ReadPrec [CreateEnvironmentAccountConnection]
-> Read CreateEnvironmentAccountConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEnvironmentAccountConnection]
$creadListPrec :: ReadPrec [CreateEnvironmentAccountConnection]
readPrec :: ReadPrec CreateEnvironmentAccountConnection
$creadPrec :: ReadPrec CreateEnvironmentAccountConnection
readList :: ReadS [CreateEnvironmentAccountConnection]
$creadList :: ReadS [CreateEnvironmentAccountConnection]
readsPrec :: Int -> ReadS CreateEnvironmentAccountConnection
$creadsPrec :: Int -> ReadS CreateEnvironmentAccountConnection
Prelude.Read, Int -> CreateEnvironmentAccountConnection -> ShowS
[CreateEnvironmentAccountConnection] -> ShowS
CreateEnvironmentAccountConnection -> String
(Int -> CreateEnvironmentAccountConnection -> ShowS)
-> (CreateEnvironmentAccountConnection -> String)
-> ([CreateEnvironmentAccountConnection] -> ShowS)
-> Show CreateEnvironmentAccountConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEnvironmentAccountConnection] -> ShowS
$cshowList :: [CreateEnvironmentAccountConnection] -> ShowS
show :: CreateEnvironmentAccountConnection -> String
$cshow :: CreateEnvironmentAccountConnection -> String
showsPrec :: Int -> CreateEnvironmentAccountConnection -> ShowS
$cshowsPrec :: Int -> CreateEnvironmentAccountConnection -> ShowS
Prelude.Show, (forall x.
 CreateEnvironmentAccountConnection
 -> Rep CreateEnvironmentAccountConnection x)
-> (forall x.
    Rep CreateEnvironmentAccountConnection x
    -> CreateEnvironmentAccountConnection)
-> Generic CreateEnvironmentAccountConnection
forall x.
Rep CreateEnvironmentAccountConnection x
-> CreateEnvironmentAccountConnection
forall x.
CreateEnvironmentAccountConnection
-> Rep CreateEnvironmentAccountConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEnvironmentAccountConnection x
-> CreateEnvironmentAccountConnection
$cfrom :: forall x.
CreateEnvironmentAccountConnection
-> Rep CreateEnvironmentAccountConnection x
Prelude.Generic)

-- |
-- Create a value of 'CreateEnvironmentAccountConnection' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'createEnvironmentAccountConnection_clientToken' - When included, if two identicial requests are made with the same client
-- token, AWS Proton returns the environment account connection that the
-- first request created.
--
-- 'environmentName', 'createEnvironmentAccountConnection_environmentName' - The name of the AWS Proton environment that\'s created in the associated
-- management account.
--
-- 'managementAccountId', 'createEnvironmentAccountConnection_managementAccountId' - The ID of the management account that accepts or rejects the environment
-- account connection. You create an manage the AWS Proton environment in
-- this account. If the management account accepts the environment account
-- connection, AWS Proton can use the associated IAM role to provision
-- environment infrastructure resources in the associated environment
-- account.
--
-- 'roleArn', 'createEnvironmentAccountConnection_roleArn' - The Amazon Resource Name (ARN) of the IAM service role that\'s created
-- in the environment account. AWS Proton uses this role to provision
-- infrastructure resources in the associated environment account.
newCreateEnvironmentAccountConnection ::
  -- | 'environmentName'
  Prelude.Text ->
  -- | 'managementAccountId'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateEnvironmentAccountConnection
newCreateEnvironmentAccountConnection :: Text -> Text -> Text -> CreateEnvironmentAccountConnection
newCreateEnvironmentAccountConnection
  Text
pEnvironmentName_
  Text
pManagementAccountId_
  Text
pRoleArn_ =
    CreateEnvironmentAccountConnection' :: Maybe Text
-> Text -> Text -> Text -> CreateEnvironmentAccountConnection
CreateEnvironmentAccountConnection'
      { $sel:clientToken:CreateEnvironmentAccountConnection' :: Maybe Text
clientToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:environmentName:CreateEnvironmentAccountConnection' :: Text
environmentName = Text
pEnvironmentName_,
        $sel:managementAccountId:CreateEnvironmentAccountConnection' :: Text
managementAccountId =
          Text
pManagementAccountId_,
        $sel:roleArn:CreateEnvironmentAccountConnection' :: Text
roleArn = Text
pRoleArn_
      }

-- | When included, if two identicial requests are made with the same client
-- token, AWS Proton returns the environment account connection that the
-- first request created.
createEnvironmentAccountConnection_clientToken :: Lens.Lens' CreateEnvironmentAccountConnection (Prelude.Maybe Prelude.Text)
createEnvironmentAccountConnection_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentAccountConnection
-> f CreateEnvironmentAccountConnection
createEnvironmentAccountConnection_clientToken = (CreateEnvironmentAccountConnection -> Maybe Text)
-> (CreateEnvironmentAccountConnection
    -> Maybe Text -> CreateEnvironmentAccountConnection)
-> Lens
     CreateEnvironmentAccountConnection
     CreateEnvironmentAccountConnection
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentAccountConnection' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateEnvironmentAccountConnection
s@CreateEnvironmentAccountConnection' {} Maybe Text
a -> CreateEnvironmentAccountConnection
s {$sel:clientToken:CreateEnvironmentAccountConnection' :: Maybe Text
clientToken = Maybe Text
a} :: CreateEnvironmentAccountConnection)

-- | The name of the AWS Proton environment that\'s created in the associated
-- management account.
createEnvironmentAccountConnection_environmentName :: Lens.Lens' CreateEnvironmentAccountConnection Prelude.Text
createEnvironmentAccountConnection_environmentName :: (Text -> f Text)
-> CreateEnvironmentAccountConnection
-> f CreateEnvironmentAccountConnection
createEnvironmentAccountConnection_environmentName = (CreateEnvironmentAccountConnection -> Text)
-> (CreateEnvironmentAccountConnection
    -> Text -> CreateEnvironmentAccountConnection)
-> Lens
     CreateEnvironmentAccountConnection
     CreateEnvironmentAccountConnection
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentAccountConnection' {Text
environmentName :: Text
$sel:environmentName:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Text
environmentName} -> Text
environmentName) (\s :: CreateEnvironmentAccountConnection
s@CreateEnvironmentAccountConnection' {} Text
a -> CreateEnvironmentAccountConnection
s {$sel:environmentName:CreateEnvironmentAccountConnection' :: Text
environmentName = Text
a} :: CreateEnvironmentAccountConnection)

-- | The ID of the management account that accepts or rejects the environment
-- account connection. You create an manage the AWS Proton environment in
-- this account. If the management account accepts the environment account
-- connection, AWS Proton can use the associated IAM role to provision
-- environment infrastructure resources in the associated environment
-- account.
createEnvironmentAccountConnection_managementAccountId :: Lens.Lens' CreateEnvironmentAccountConnection Prelude.Text
createEnvironmentAccountConnection_managementAccountId :: (Text -> f Text)
-> CreateEnvironmentAccountConnection
-> f CreateEnvironmentAccountConnection
createEnvironmentAccountConnection_managementAccountId = (CreateEnvironmentAccountConnection -> Text)
-> (CreateEnvironmentAccountConnection
    -> Text -> CreateEnvironmentAccountConnection)
-> Lens
     CreateEnvironmentAccountConnection
     CreateEnvironmentAccountConnection
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentAccountConnection' {Text
managementAccountId :: Text
$sel:managementAccountId:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Text
managementAccountId} -> Text
managementAccountId) (\s :: CreateEnvironmentAccountConnection
s@CreateEnvironmentAccountConnection' {} Text
a -> CreateEnvironmentAccountConnection
s {$sel:managementAccountId:CreateEnvironmentAccountConnection' :: Text
managementAccountId = Text
a} :: CreateEnvironmentAccountConnection)

-- | The Amazon Resource Name (ARN) of the IAM service role that\'s created
-- in the environment account. AWS Proton uses this role to provision
-- infrastructure resources in the associated environment account.
createEnvironmentAccountConnection_roleArn :: Lens.Lens' CreateEnvironmentAccountConnection Prelude.Text
createEnvironmentAccountConnection_roleArn :: (Text -> f Text)
-> CreateEnvironmentAccountConnection
-> f CreateEnvironmentAccountConnection
createEnvironmentAccountConnection_roleArn = (CreateEnvironmentAccountConnection -> Text)
-> (CreateEnvironmentAccountConnection
    -> Text -> CreateEnvironmentAccountConnection)
-> Lens
     CreateEnvironmentAccountConnection
     CreateEnvironmentAccountConnection
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentAccountConnection' {Text
roleArn :: Text
$sel:roleArn:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Text
roleArn} -> Text
roleArn) (\s :: CreateEnvironmentAccountConnection
s@CreateEnvironmentAccountConnection' {} Text
a -> CreateEnvironmentAccountConnection
s {$sel:roleArn:CreateEnvironmentAccountConnection' :: Text
roleArn = Text
a} :: CreateEnvironmentAccountConnection)

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

instance
  Prelude.Hashable
    CreateEnvironmentAccountConnection

instance
  Prelude.NFData
    CreateEnvironmentAccountConnection

instance
  Core.ToHeaders
    CreateEnvironmentAccountConnection
  where
  toHeaders :: CreateEnvironmentAccountConnection -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> CreateEnvironmentAccountConnection -> 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
"AwsProton20200720.CreateEnvironmentAccountConnection" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    CreateEnvironmentAccountConnection
  where
  toJSON :: CreateEnvironmentAccountConnection -> Value
toJSON CreateEnvironmentAccountConnection' {Maybe Text
Text
roleArn :: Text
managementAccountId :: Text
environmentName :: Text
clientToken :: Maybe Text
$sel:roleArn:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Text
$sel:managementAccountId:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Text
$sel:environmentName:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Text
$sel:clientToken:CreateEnvironmentAccountConnection' :: CreateEnvironmentAccountConnection -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"environmentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
environmentName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"managementAccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
managementAccountId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
          ]
      )

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

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

-- | /See:/ 'newCreateEnvironmentAccountConnectionResponse' smart constructor.
data CreateEnvironmentAccountConnectionResponse = CreateEnvironmentAccountConnectionResponse'
  { -- | The response's http status code.
    CreateEnvironmentAccountConnectionResponse -> Int
httpStatus :: Prelude.Int,
    -- | The environment account connection detail data that\'s returned by AWS
    -- Proton.
    CreateEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
environmentAccountConnection :: EnvironmentAccountConnection
  }
  deriving (CreateEnvironmentAccountConnectionResponse
-> CreateEnvironmentAccountConnectionResponse -> Bool
(CreateEnvironmentAccountConnectionResponse
 -> CreateEnvironmentAccountConnectionResponse -> Bool)
-> (CreateEnvironmentAccountConnectionResponse
    -> CreateEnvironmentAccountConnectionResponse -> Bool)
-> Eq CreateEnvironmentAccountConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEnvironmentAccountConnectionResponse
-> CreateEnvironmentAccountConnectionResponse -> Bool
$c/= :: CreateEnvironmentAccountConnectionResponse
-> CreateEnvironmentAccountConnectionResponse -> Bool
== :: CreateEnvironmentAccountConnectionResponse
-> CreateEnvironmentAccountConnectionResponse -> Bool
$c== :: CreateEnvironmentAccountConnectionResponse
-> CreateEnvironmentAccountConnectionResponse -> Bool
Prelude.Eq, ReadPrec [CreateEnvironmentAccountConnectionResponse]
ReadPrec CreateEnvironmentAccountConnectionResponse
Int -> ReadS CreateEnvironmentAccountConnectionResponse
ReadS [CreateEnvironmentAccountConnectionResponse]
(Int -> ReadS CreateEnvironmentAccountConnectionResponse)
-> ReadS [CreateEnvironmentAccountConnectionResponse]
-> ReadPrec CreateEnvironmentAccountConnectionResponse
-> ReadPrec [CreateEnvironmentAccountConnectionResponse]
-> Read CreateEnvironmentAccountConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEnvironmentAccountConnectionResponse]
$creadListPrec :: ReadPrec [CreateEnvironmentAccountConnectionResponse]
readPrec :: ReadPrec CreateEnvironmentAccountConnectionResponse
$creadPrec :: ReadPrec CreateEnvironmentAccountConnectionResponse
readList :: ReadS [CreateEnvironmentAccountConnectionResponse]
$creadList :: ReadS [CreateEnvironmentAccountConnectionResponse]
readsPrec :: Int -> ReadS CreateEnvironmentAccountConnectionResponse
$creadsPrec :: Int -> ReadS CreateEnvironmentAccountConnectionResponse
Prelude.Read, Int -> CreateEnvironmentAccountConnectionResponse -> ShowS
[CreateEnvironmentAccountConnectionResponse] -> ShowS
CreateEnvironmentAccountConnectionResponse -> String
(Int -> CreateEnvironmentAccountConnectionResponse -> ShowS)
-> (CreateEnvironmentAccountConnectionResponse -> String)
-> ([CreateEnvironmentAccountConnectionResponse] -> ShowS)
-> Show CreateEnvironmentAccountConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEnvironmentAccountConnectionResponse] -> ShowS
$cshowList :: [CreateEnvironmentAccountConnectionResponse] -> ShowS
show :: CreateEnvironmentAccountConnectionResponse -> String
$cshow :: CreateEnvironmentAccountConnectionResponse -> String
showsPrec :: Int -> CreateEnvironmentAccountConnectionResponse -> ShowS
$cshowsPrec :: Int -> CreateEnvironmentAccountConnectionResponse -> ShowS
Prelude.Show, (forall x.
 CreateEnvironmentAccountConnectionResponse
 -> Rep CreateEnvironmentAccountConnectionResponse x)
-> (forall x.
    Rep CreateEnvironmentAccountConnectionResponse x
    -> CreateEnvironmentAccountConnectionResponse)
-> Generic CreateEnvironmentAccountConnectionResponse
forall x.
Rep CreateEnvironmentAccountConnectionResponse x
-> CreateEnvironmentAccountConnectionResponse
forall x.
CreateEnvironmentAccountConnectionResponse
-> Rep CreateEnvironmentAccountConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEnvironmentAccountConnectionResponse x
-> CreateEnvironmentAccountConnectionResponse
$cfrom :: forall x.
CreateEnvironmentAccountConnectionResponse
-> Rep CreateEnvironmentAccountConnectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateEnvironmentAccountConnectionResponse' 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:
--
-- 'httpStatus', 'createEnvironmentAccountConnectionResponse_httpStatus' - The response's http status code.
--
-- 'environmentAccountConnection', 'createEnvironmentAccountConnectionResponse_environmentAccountConnection' - The environment account connection detail data that\'s returned by AWS
-- Proton.
newCreateEnvironmentAccountConnectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'environmentAccountConnection'
  EnvironmentAccountConnection ->
  CreateEnvironmentAccountConnectionResponse
newCreateEnvironmentAccountConnectionResponse :: Int
-> EnvironmentAccountConnection
-> CreateEnvironmentAccountConnectionResponse
newCreateEnvironmentAccountConnectionResponse
  Int
pHttpStatus_
  EnvironmentAccountConnection
pEnvironmentAccountConnection_ =
    CreateEnvironmentAccountConnectionResponse' :: Int
-> EnvironmentAccountConnection
-> CreateEnvironmentAccountConnectionResponse
CreateEnvironmentAccountConnectionResponse'
      { $sel:httpStatus:CreateEnvironmentAccountConnectionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:environmentAccountConnection:CreateEnvironmentAccountConnectionResponse' :: EnvironmentAccountConnection
environmentAccountConnection =
          EnvironmentAccountConnection
pEnvironmentAccountConnection_
      }

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

-- | The environment account connection detail data that\'s returned by AWS
-- Proton.
createEnvironmentAccountConnectionResponse_environmentAccountConnection :: Lens.Lens' CreateEnvironmentAccountConnectionResponse EnvironmentAccountConnection
createEnvironmentAccountConnectionResponse_environmentAccountConnection :: (EnvironmentAccountConnection -> f EnvironmentAccountConnection)
-> CreateEnvironmentAccountConnectionResponse
-> f CreateEnvironmentAccountConnectionResponse
createEnvironmentAccountConnectionResponse_environmentAccountConnection = (CreateEnvironmentAccountConnectionResponse
 -> EnvironmentAccountConnection)
-> (CreateEnvironmentAccountConnectionResponse
    -> EnvironmentAccountConnection
    -> CreateEnvironmentAccountConnectionResponse)
-> Lens
     CreateEnvironmentAccountConnectionResponse
     CreateEnvironmentAccountConnectionResponse
     EnvironmentAccountConnection
     EnvironmentAccountConnection
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentAccountConnectionResponse' {EnvironmentAccountConnection
environmentAccountConnection :: EnvironmentAccountConnection
$sel:environmentAccountConnection:CreateEnvironmentAccountConnectionResponse' :: CreateEnvironmentAccountConnectionResponse
-> EnvironmentAccountConnection
environmentAccountConnection} -> EnvironmentAccountConnection
environmentAccountConnection) (\s :: CreateEnvironmentAccountConnectionResponse
s@CreateEnvironmentAccountConnectionResponse' {} EnvironmentAccountConnection
a -> CreateEnvironmentAccountConnectionResponse
s {$sel:environmentAccountConnection:CreateEnvironmentAccountConnectionResponse' :: EnvironmentAccountConnection
environmentAccountConnection = EnvironmentAccountConnection
a} :: CreateEnvironmentAccountConnectionResponse)

instance
  Prelude.NFData
    CreateEnvironmentAccountConnectionResponse