{-# 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.IoTWireless.AssociateAwsAccountWithPartnerAccount
-- 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)
--
-- Associates a partner account with your AWS account.
module Amazonka.IoTWireless.AssociateAwsAccountWithPartnerAccount
  ( -- * Creating a Request
    AssociateAwsAccountWithPartnerAccount (..),
    newAssociateAwsAccountWithPartnerAccount,

    -- * Request Lenses
    associateAwsAccountWithPartnerAccount_clientRequestToken,
    associateAwsAccountWithPartnerAccount_tags,
    associateAwsAccountWithPartnerAccount_sidewalk,

    -- * Destructuring the Response
    AssociateAwsAccountWithPartnerAccountResponse (..),
    newAssociateAwsAccountWithPartnerAccountResponse,

    -- * Response Lenses
    associateAwsAccountWithPartnerAccountResponse_sidewalk,
    associateAwsAccountWithPartnerAccountResponse_arn,
    associateAwsAccountWithPartnerAccountResponse_httpStatus,
  )
where

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

-- | /See:/ 'newAssociateAwsAccountWithPartnerAccount' smart constructor.
data AssociateAwsAccountWithPartnerAccount = AssociateAwsAccountWithPartnerAccount'
  { -- | Each resource must have a unique client request token. If you try to
    -- create a new resource with the same token as a resource that already
    -- exists, an exception occurs. If you omit this value, AWS SDKs will
    -- automatically generate a unique client request.
    AssociateAwsAccountWithPartnerAccount -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The tags to attach to the specified resource. Tags are metadata that you
    -- can use to manage a resource.
    AssociateAwsAccountWithPartnerAccount -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The Sidewalk account credentials.
    AssociateAwsAccountWithPartnerAccount -> SidewalkAccountInfo
sidewalk :: SidewalkAccountInfo
  }
  deriving (AssociateAwsAccountWithPartnerAccount
-> AssociateAwsAccountWithPartnerAccount -> Bool
(AssociateAwsAccountWithPartnerAccount
 -> AssociateAwsAccountWithPartnerAccount -> Bool)
-> (AssociateAwsAccountWithPartnerAccount
    -> AssociateAwsAccountWithPartnerAccount -> Bool)
-> Eq AssociateAwsAccountWithPartnerAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateAwsAccountWithPartnerAccount
-> AssociateAwsAccountWithPartnerAccount -> Bool
$c/= :: AssociateAwsAccountWithPartnerAccount
-> AssociateAwsAccountWithPartnerAccount -> Bool
== :: AssociateAwsAccountWithPartnerAccount
-> AssociateAwsAccountWithPartnerAccount -> Bool
$c== :: AssociateAwsAccountWithPartnerAccount
-> AssociateAwsAccountWithPartnerAccount -> Bool
Prelude.Eq, Int -> AssociateAwsAccountWithPartnerAccount -> ShowS
[AssociateAwsAccountWithPartnerAccount] -> ShowS
AssociateAwsAccountWithPartnerAccount -> String
(Int -> AssociateAwsAccountWithPartnerAccount -> ShowS)
-> (AssociateAwsAccountWithPartnerAccount -> String)
-> ([AssociateAwsAccountWithPartnerAccount] -> ShowS)
-> Show AssociateAwsAccountWithPartnerAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateAwsAccountWithPartnerAccount] -> ShowS
$cshowList :: [AssociateAwsAccountWithPartnerAccount] -> ShowS
show :: AssociateAwsAccountWithPartnerAccount -> String
$cshow :: AssociateAwsAccountWithPartnerAccount -> String
showsPrec :: Int -> AssociateAwsAccountWithPartnerAccount -> ShowS
$cshowsPrec :: Int -> AssociateAwsAccountWithPartnerAccount -> ShowS
Prelude.Show, (forall x.
 AssociateAwsAccountWithPartnerAccount
 -> Rep AssociateAwsAccountWithPartnerAccount x)
-> (forall x.
    Rep AssociateAwsAccountWithPartnerAccount x
    -> AssociateAwsAccountWithPartnerAccount)
-> Generic AssociateAwsAccountWithPartnerAccount
forall x.
Rep AssociateAwsAccountWithPartnerAccount x
-> AssociateAwsAccountWithPartnerAccount
forall x.
AssociateAwsAccountWithPartnerAccount
-> Rep AssociateAwsAccountWithPartnerAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateAwsAccountWithPartnerAccount x
-> AssociateAwsAccountWithPartnerAccount
$cfrom :: forall x.
AssociateAwsAccountWithPartnerAccount
-> Rep AssociateAwsAccountWithPartnerAccount x
Prelude.Generic)

-- |
-- Create a value of 'AssociateAwsAccountWithPartnerAccount' 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:
--
-- 'clientRequestToken', 'associateAwsAccountWithPartnerAccount_clientRequestToken' - Each resource must have a unique client request token. If you try to
-- create a new resource with the same token as a resource that already
-- exists, an exception occurs. If you omit this value, AWS SDKs will
-- automatically generate a unique client request.
--
-- 'tags', 'associateAwsAccountWithPartnerAccount_tags' - The tags to attach to the specified resource. Tags are metadata that you
-- can use to manage a resource.
--
-- 'sidewalk', 'associateAwsAccountWithPartnerAccount_sidewalk' - The Sidewalk account credentials.
newAssociateAwsAccountWithPartnerAccount ::
  -- | 'sidewalk'
  SidewalkAccountInfo ->
  AssociateAwsAccountWithPartnerAccount
newAssociateAwsAccountWithPartnerAccount :: SidewalkAccountInfo -> AssociateAwsAccountWithPartnerAccount
newAssociateAwsAccountWithPartnerAccount SidewalkAccountInfo
pSidewalk_ =
  AssociateAwsAccountWithPartnerAccount' :: Maybe Text
-> Maybe [Tag]
-> SidewalkAccountInfo
-> AssociateAwsAccountWithPartnerAccount
AssociateAwsAccountWithPartnerAccount'
    { $sel:clientRequestToken:AssociateAwsAccountWithPartnerAccount' :: Maybe Text
clientRequestToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:AssociateAwsAccountWithPartnerAccount' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:sidewalk:AssociateAwsAccountWithPartnerAccount' :: SidewalkAccountInfo
sidewalk = SidewalkAccountInfo
pSidewalk_
    }

-- | Each resource must have a unique client request token. If you try to
-- create a new resource with the same token as a resource that already
-- exists, an exception occurs. If you omit this value, AWS SDKs will
-- automatically generate a unique client request.
associateAwsAccountWithPartnerAccount_clientRequestToken :: Lens.Lens' AssociateAwsAccountWithPartnerAccount (Prelude.Maybe Prelude.Text)
associateAwsAccountWithPartnerAccount_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> AssociateAwsAccountWithPartnerAccount
-> f AssociateAwsAccountWithPartnerAccount
associateAwsAccountWithPartnerAccount_clientRequestToken = (AssociateAwsAccountWithPartnerAccount -> Maybe Text)
-> (AssociateAwsAccountWithPartnerAccount
    -> Maybe Text -> AssociateAwsAccountWithPartnerAccount)
-> Lens
     AssociateAwsAccountWithPartnerAccount
     AssociateAwsAccountWithPartnerAccount
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAwsAccountWithPartnerAccount' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:AssociateAwsAccountWithPartnerAccount' :: AssociateAwsAccountWithPartnerAccount -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: AssociateAwsAccountWithPartnerAccount
s@AssociateAwsAccountWithPartnerAccount' {} Maybe Text
a -> AssociateAwsAccountWithPartnerAccount
s {$sel:clientRequestToken:AssociateAwsAccountWithPartnerAccount' :: Maybe Text
clientRequestToken = Maybe Text
a} :: AssociateAwsAccountWithPartnerAccount)

-- | The tags to attach to the specified resource. Tags are metadata that you
-- can use to manage a resource.
associateAwsAccountWithPartnerAccount_tags :: Lens.Lens' AssociateAwsAccountWithPartnerAccount (Prelude.Maybe [Tag])
associateAwsAccountWithPartnerAccount_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> AssociateAwsAccountWithPartnerAccount
-> f AssociateAwsAccountWithPartnerAccount
associateAwsAccountWithPartnerAccount_tags = (AssociateAwsAccountWithPartnerAccount -> Maybe [Tag])
-> (AssociateAwsAccountWithPartnerAccount
    -> Maybe [Tag] -> AssociateAwsAccountWithPartnerAccount)
-> Lens
     AssociateAwsAccountWithPartnerAccount
     AssociateAwsAccountWithPartnerAccount
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAwsAccountWithPartnerAccount' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:AssociateAwsAccountWithPartnerAccount' :: AssociateAwsAccountWithPartnerAccount -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: AssociateAwsAccountWithPartnerAccount
s@AssociateAwsAccountWithPartnerAccount' {} Maybe [Tag]
a -> AssociateAwsAccountWithPartnerAccount
s {$sel:tags:AssociateAwsAccountWithPartnerAccount' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: AssociateAwsAccountWithPartnerAccount) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> AssociateAwsAccountWithPartnerAccount
 -> f AssociateAwsAccountWithPartnerAccount)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> AssociateAwsAccountWithPartnerAccount
-> f AssociateAwsAccountWithPartnerAccount
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 Sidewalk account credentials.
associateAwsAccountWithPartnerAccount_sidewalk :: Lens.Lens' AssociateAwsAccountWithPartnerAccount SidewalkAccountInfo
associateAwsAccountWithPartnerAccount_sidewalk :: (SidewalkAccountInfo -> f SidewalkAccountInfo)
-> AssociateAwsAccountWithPartnerAccount
-> f AssociateAwsAccountWithPartnerAccount
associateAwsAccountWithPartnerAccount_sidewalk = (AssociateAwsAccountWithPartnerAccount -> SidewalkAccountInfo)
-> (AssociateAwsAccountWithPartnerAccount
    -> SidewalkAccountInfo -> AssociateAwsAccountWithPartnerAccount)
-> Lens
     AssociateAwsAccountWithPartnerAccount
     AssociateAwsAccountWithPartnerAccount
     SidewalkAccountInfo
     SidewalkAccountInfo
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAwsAccountWithPartnerAccount' {SidewalkAccountInfo
sidewalk :: SidewalkAccountInfo
$sel:sidewalk:AssociateAwsAccountWithPartnerAccount' :: AssociateAwsAccountWithPartnerAccount -> SidewalkAccountInfo
sidewalk} -> SidewalkAccountInfo
sidewalk) (\s :: AssociateAwsAccountWithPartnerAccount
s@AssociateAwsAccountWithPartnerAccount' {} SidewalkAccountInfo
a -> AssociateAwsAccountWithPartnerAccount
s {$sel:sidewalk:AssociateAwsAccountWithPartnerAccount' :: SidewalkAccountInfo
sidewalk = SidewalkAccountInfo
a} :: AssociateAwsAccountWithPartnerAccount)

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

instance
  Prelude.NFData
    AssociateAwsAccountWithPartnerAccount

instance
  Core.ToHeaders
    AssociateAwsAccountWithPartnerAccount
  where
  toHeaders :: AssociateAwsAccountWithPartnerAccount -> ResponseHeaders
toHeaders = ResponseHeaders
-> AssociateAwsAccountWithPartnerAccount -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance
  Core.ToJSON
    AssociateAwsAccountWithPartnerAccount
  where
  toJSON :: AssociateAwsAccountWithPartnerAccount -> Value
toJSON AssociateAwsAccountWithPartnerAccount' {Maybe [Tag]
Maybe Text
SidewalkAccountInfo
sidewalk :: SidewalkAccountInfo
tags :: Maybe [Tag]
clientRequestToken :: Maybe Text
$sel:sidewalk:AssociateAwsAccountWithPartnerAccount' :: AssociateAwsAccountWithPartnerAccount -> SidewalkAccountInfo
$sel:tags:AssociateAwsAccountWithPartnerAccount' :: AssociateAwsAccountWithPartnerAccount -> Maybe [Tag]
$sel:clientRequestToken:AssociateAwsAccountWithPartnerAccount' :: AssociateAwsAccountWithPartnerAccount -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClientRequestToken" 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
clientRequestToken,
            (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
"Sidewalk" Text -> SidewalkAccountInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SidewalkAccountInfo
sidewalk)
          ]
      )

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

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

-- | /See:/ 'newAssociateAwsAccountWithPartnerAccountResponse' smart constructor.
data AssociateAwsAccountWithPartnerAccountResponse = AssociateAwsAccountWithPartnerAccountResponse'
  { -- | The Sidewalk account credentials.
    AssociateAwsAccountWithPartnerAccountResponse
-> Maybe SidewalkAccountInfo
sidewalk :: Prelude.Maybe SidewalkAccountInfo,
    -- | The Amazon Resource Name of the resource.
    AssociateAwsAccountWithPartnerAccountResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    AssociateAwsAccountWithPartnerAccountResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateAwsAccountWithPartnerAccountResponse
-> AssociateAwsAccountWithPartnerAccountResponse -> Bool
(AssociateAwsAccountWithPartnerAccountResponse
 -> AssociateAwsAccountWithPartnerAccountResponse -> Bool)
-> (AssociateAwsAccountWithPartnerAccountResponse
    -> AssociateAwsAccountWithPartnerAccountResponse -> Bool)
-> Eq AssociateAwsAccountWithPartnerAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateAwsAccountWithPartnerAccountResponse
-> AssociateAwsAccountWithPartnerAccountResponse -> Bool
$c/= :: AssociateAwsAccountWithPartnerAccountResponse
-> AssociateAwsAccountWithPartnerAccountResponse -> Bool
== :: AssociateAwsAccountWithPartnerAccountResponse
-> AssociateAwsAccountWithPartnerAccountResponse -> Bool
$c== :: AssociateAwsAccountWithPartnerAccountResponse
-> AssociateAwsAccountWithPartnerAccountResponse -> Bool
Prelude.Eq, Int -> AssociateAwsAccountWithPartnerAccountResponse -> ShowS
[AssociateAwsAccountWithPartnerAccountResponse] -> ShowS
AssociateAwsAccountWithPartnerAccountResponse -> String
(Int -> AssociateAwsAccountWithPartnerAccountResponse -> ShowS)
-> (AssociateAwsAccountWithPartnerAccountResponse -> String)
-> ([AssociateAwsAccountWithPartnerAccountResponse] -> ShowS)
-> Show AssociateAwsAccountWithPartnerAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateAwsAccountWithPartnerAccountResponse] -> ShowS
$cshowList :: [AssociateAwsAccountWithPartnerAccountResponse] -> ShowS
show :: AssociateAwsAccountWithPartnerAccountResponse -> String
$cshow :: AssociateAwsAccountWithPartnerAccountResponse -> String
showsPrec :: Int -> AssociateAwsAccountWithPartnerAccountResponse -> ShowS
$cshowsPrec :: Int -> AssociateAwsAccountWithPartnerAccountResponse -> ShowS
Prelude.Show, (forall x.
 AssociateAwsAccountWithPartnerAccountResponse
 -> Rep AssociateAwsAccountWithPartnerAccountResponse x)
-> (forall x.
    Rep AssociateAwsAccountWithPartnerAccountResponse x
    -> AssociateAwsAccountWithPartnerAccountResponse)
-> Generic AssociateAwsAccountWithPartnerAccountResponse
forall x.
Rep AssociateAwsAccountWithPartnerAccountResponse x
-> AssociateAwsAccountWithPartnerAccountResponse
forall x.
AssociateAwsAccountWithPartnerAccountResponse
-> Rep AssociateAwsAccountWithPartnerAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateAwsAccountWithPartnerAccountResponse x
-> AssociateAwsAccountWithPartnerAccountResponse
$cfrom :: forall x.
AssociateAwsAccountWithPartnerAccountResponse
-> Rep AssociateAwsAccountWithPartnerAccountResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateAwsAccountWithPartnerAccountResponse' 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:
--
-- 'sidewalk', 'associateAwsAccountWithPartnerAccountResponse_sidewalk' - The Sidewalk account credentials.
--
-- 'arn', 'associateAwsAccountWithPartnerAccountResponse_arn' - The Amazon Resource Name of the resource.
--
-- 'httpStatus', 'associateAwsAccountWithPartnerAccountResponse_httpStatus' - The response's http status code.
newAssociateAwsAccountWithPartnerAccountResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateAwsAccountWithPartnerAccountResponse
newAssociateAwsAccountWithPartnerAccountResponse :: Int -> AssociateAwsAccountWithPartnerAccountResponse
newAssociateAwsAccountWithPartnerAccountResponse
  Int
pHttpStatus_ =
    AssociateAwsAccountWithPartnerAccountResponse' :: Maybe SidewalkAccountInfo
-> Maybe Text
-> Int
-> AssociateAwsAccountWithPartnerAccountResponse
AssociateAwsAccountWithPartnerAccountResponse'
      { $sel:sidewalk:AssociateAwsAccountWithPartnerAccountResponse' :: Maybe SidewalkAccountInfo
sidewalk =
          Maybe SidewalkAccountInfo
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:AssociateAwsAccountWithPartnerAccountResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AssociateAwsAccountWithPartnerAccountResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The Sidewalk account credentials.
associateAwsAccountWithPartnerAccountResponse_sidewalk :: Lens.Lens' AssociateAwsAccountWithPartnerAccountResponse (Prelude.Maybe SidewalkAccountInfo)
associateAwsAccountWithPartnerAccountResponse_sidewalk :: (Maybe SidewalkAccountInfo -> f (Maybe SidewalkAccountInfo))
-> AssociateAwsAccountWithPartnerAccountResponse
-> f AssociateAwsAccountWithPartnerAccountResponse
associateAwsAccountWithPartnerAccountResponse_sidewalk = (AssociateAwsAccountWithPartnerAccountResponse
 -> Maybe SidewalkAccountInfo)
-> (AssociateAwsAccountWithPartnerAccountResponse
    -> Maybe SidewalkAccountInfo
    -> AssociateAwsAccountWithPartnerAccountResponse)
-> Lens
     AssociateAwsAccountWithPartnerAccountResponse
     AssociateAwsAccountWithPartnerAccountResponse
     (Maybe SidewalkAccountInfo)
     (Maybe SidewalkAccountInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAwsAccountWithPartnerAccountResponse' {Maybe SidewalkAccountInfo
sidewalk :: Maybe SidewalkAccountInfo
$sel:sidewalk:AssociateAwsAccountWithPartnerAccountResponse' :: AssociateAwsAccountWithPartnerAccountResponse
-> Maybe SidewalkAccountInfo
sidewalk} -> Maybe SidewalkAccountInfo
sidewalk) (\s :: AssociateAwsAccountWithPartnerAccountResponse
s@AssociateAwsAccountWithPartnerAccountResponse' {} Maybe SidewalkAccountInfo
a -> AssociateAwsAccountWithPartnerAccountResponse
s {$sel:sidewalk:AssociateAwsAccountWithPartnerAccountResponse' :: Maybe SidewalkAccountInfo
sidewalk = Maybe SidewalkAccountInfo
a} :: AssociateAwsAccountWithPartnerAccountResponse)

-- | The Amazon Resource Name of the resource.
associateAwsAccountWithPartnerAccountResponse_arn :: Lens.Lens' AssociateAwsAccountWithPartnerAccountResponse (Prelude.Maybe Prelude.Text)
associateAwsAccountWithPartnerAccountResponse_arn :: (Maybe Text -> f (Maybe Text))
-> AssociateAwsAccountWithPartnerAccountResponse
-> f AssociateAwsAccountWithPartnerAccountResponse
associateAwsAccountWithPartnerAccountResponse_arn = (AssociateAwsAccountWithPartnerAccountResponse -> Maybe Text)
-> (AssociateAwsAccountWithPartnerAccountResponse
    -> Maybe Text -> AssociateAwsAccountWithPartnerAccountResponse)
-> Lens
     AssociateAwsAccountWithPartnerAccountResponse
     AssociateAwsAccountWithPartnerAccountResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAwsAccountWithPartnerAccountResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:AssociateAwsAccountWithPartnerAccountResponse' :: AssociateAwsAccountWithPartnerAccountResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AssociateAwsAccountWithPartnerAccountResponse
s@AssociateAwsAccountWithPartnerAccountResponse' {} Maybe Text
a -> AssociateAwsAccountWithPartnerAccountResponse
s {$sel:arn:AssociateAwsAccountWithPartnerAccountResponse' :: Maybe Text
arn = Maybe Text
a} :: AssociateAwsAccountWithPartnerAccountResponse)

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

instance
  Prelude.NFData
    AssociateAwsAccountWithPartnerAccountResponse