{-# 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.ServiceCatalog.AssociatePrincipalWithPortfolio
-- 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 the specified principal ARN with the specified portfolio.
module Amazonka.ServiceCatalog.AssociatePrincipalWithPortfolio
  ( -- * Creating a Request
    AssociatePrincipalWithPortfolio (..),
    newAssociatePrincipalWithPortfolio,

    -- * Request Lenses
    associatePrincipalWithPortfolio_acceptLanguage,
    associatePrincipalWithPortfolio_portfolioId,
    associatePrincipalWithPortfolio_principalARN,
    associatePrincipalWithPortfolio_principalType,

    -- * Destructuring the Response
    AssociatePrincipalWithPortfolioResponse (..),
    newAssociatePrincipalWithPortfolioResponse,

    -- * Response Lenses
    associatePrincipalWithPortfolioResponse_httpStatus,
  )
where

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

-- | /See:/ 'newAssociatePrincipalWithPortfolio' smart constructor.
data AssociatePrincipalWithPortfolio = AssociatePrincipalWithPortfolio'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    AssociatePrincipalWithPortfolio -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The portfolio identifier.
    AssociatePrincipalWithPortfolio -> Text
portfolioId :: Prelude.Text,
    -- | The ARN of the principal (IAM user, role, or group).
    AssociatePrincipalWithPortfolio -> Text
principalARN :: Prelude.Text,
    -- | The principal type. The supported value is @IAM@.
    AssociatePrincipalWithPortfolio -> PrincipalType
principalType :: PrincipalType
  }
  deriving (AssociatePrincipalWithPortfolio
-> AssociatePrincipalWithPortfolio -> Bool
(AssociatePrincipalWithPortfolio
 -> AssociatePrincipalWithPortfolio -> Bool)
-> (AssociatePrincipalWithPortfolio
    -> AssociatePrincipalWithPortfolio -> Bool)
-> Eq AssociatePrincipalWithPortfolio
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatePrincipalWithPortfolio
-> AssociatePrincipalWithPortfolio -> Bool
$c/= :: AssociatePrincipalWithPortfolio
-> AssociatePrincipalWithPortfolio -> Bool
== :: AssociatePrincipalWithPortfolio
-> AssociatePrincipalWithPortfolio -> Bool
$c== :: AssociatePrincipalWithPortfolio
-> AssociatePrincipalWithPortfolio -> Bool
Prelude.Eq, ReadPrec [AssociatePrincipalWithPortfolio]
ReadPrec AssociatePrincipalWithPortfolio
Int -> ReadS AssociatePrincipalWithPortfolio
ReadS [AssociatePrincipalWithPortfolio]
(Int -> ReadS AssociatePrincipalWithPortfolio)
-> ReadS [AssociatePrincipalWithPortfolio]
-> ReadPrec AssociatePrincipalWithPortfolio
-> ReadPrec [AssociatePrincipalWithPortfolio]
-> Read AssociatePrincipalWithPortfolio
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociatePrincipalWithPortfolio]
$creadListPrec :: ReadPrec [AssociatePrincipalWithPortfolio]
readPrec :: ReadPrec AssociatePrincipalWithPortfolio
$creadPrec :: ReadPrec AssociatePrincipalWithPortfolio
readList :: ReadS [AssociatePrincipalWithPortfolio]
$creadList :: ReadS [AssociatePrincipalWithPortfolio]
readsPrec :: Int -> ReadS AssociatePrincipalWithPortfolio
$creadsPrec :: Int -> ReadS AssociatePrincipalWithPortfolio
Prelude.Read, Int -> AssociatePrincipalWithPortfolio -> ShowS
[AssociatePrincipalWithPortfolio] -> ShowS
AssociatePrincipalWithPortfolio -> String
(Int -> AssociatePrincipalWithPortfolio -> ShowS)
-> (AssociatePrincipalWithPortfolio -> String)
-> ([AssociatePrincipalWithPortfolio] -> ShowS)
-> Show AssociatePrincipalWithPortfolio
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatePrincipalWithPortfolio] -> ShowS
$cshowList :: [AssociatePrincipalWithPortfolio] -> ShowS
show :: AssociatePrincipalWithPortfolio -> String
$cshow :: AssociatePrincipalWithPortfolio -> String
showsPrec :: Int -> AssociatePrincipalWithPortfolio -> ShowS
$cshowsPrec :: Int -> AssociatePrincipalWithPortfolio -> ShowS
Prelude.Show, (forall x.
 AssociatePrincipalWithPortfolio
 -> Rep AssociatePrincipalWithPortfolio x)
-> (forall x.
    Rep AssociatePrincipalWithPortfolio x
    -> AssociatePrincipalWithPortfolio)
-> Generic AssociatePrincipalWithPortfolio
forall x.
Rep AssociatePrincipalWithPortfolio x
-> AssociatePrincipalWithPortfolio
forall x.
AssociatePrincipalWithPortfolio
-> Rep AssociatePrincipalWithPortfolio x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociatePrincipalWithPortfolio x
-> AssociatePrincipalWithPortfolio
$cfrom :: forall x.
AssociatePrincipalWithPortfolio
-> Rep AssociatePrincipalWithPortfolio x
Prelude.Generic)

-- |
-- Create a value of 'AssociatePrincipalWithPortfolio' 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:
--
-- 'acceptLanguage', 'associatePrincipalWithPortfolio_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'portfolioId', 'associatePrincipalWithPortfolio_portfolioId' - The portfolio identifier.
--
-- 'principalARN', 'associatePrincipalWithPortfolio_principalARN' - The ARN of the principal (IAM user, role, or group).
--
-- 'principalType', 'associatePrincipalWithPortfolio_principalType' - The principal type. The supported value is @IAM@.
newAssociatePrincipalWithPortfolio ::
  -- | 'portfolioId'
  Prelude.Text ->
  -- | 'principalARN'
  Prelude.Text ->
  -- | 'principalType'
  PrincipalType ->
  AssociatePrincipalWithPortfolio
newAssociatePrincipalWithPortfolio :: Text -> Text -> PrincipalType -> AssociatePrincipalWithPortfolio
newAssociatePrincipalWithPortfolio
  Text
pPortfolioId_
  Text
pPrincipalARN_
  PrincipalType
pPrincipalType_ =
    AssociatePrincipalWithPortfolio' :: Maybe Text
-> Text -> Text -> PrincipalType -> AssociatePrincipalWithPortfolio
AssociatePrincipalWithPortfolio'
      { $sel:acceptLanguage:AssociatePrincipalWithPortfolio' :: Maybe Text
acceptLanguage =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:portfolioId:AssociatePrincipalWithPortfolio' :: Text
portfolioId = Text
pPortfolioId_,
        $sel:principalARN:AssociatePrincipalWithPortfolio' :: Text
principalARN = Text
pPrincipalARN_,
        $sel:principalType:AssociatePrincipalWithPortfolio' :: PrincipalType
principalType = PrincipalType
pPrincipalType_
      }

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
associatePrincipalWithPortfolio_acceptLanguage :: Lens.Lens' AssociatePrincipalWithPortfolio (Prelude.Maybe Prelude.Text)
associatePrincipalWithPortfolio_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> AssociatePrincipalWithPortfolio
-> f AssociatePrincipalWithPortfolio
associatePrincipalWithPortfolio_acceptLanguage = (AssociatePrincipalWithPortfolio -> Maybe Text)
-> (AssociatePrincipalWithPortfolio
    -> Maybe Text -> AssociatePrincipalWithPortfolio)
-> Lens
     AssociatePrincipalWithPortfolio
     AssociatePrincipalWithPortfolio
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePrincipalWithPortfolio' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: AssociatePrincipalWithPortfolio
s@AssociatePrincipalWithPortfolio' {} Maybe Text
a -> AssociatePrincipalWithPortfolio
s {$sel:acceptLanguage:AssociatePrincipalWithPortfolio' :: Maybe Text
acceptLanguage = Maybe Text
a} :: AssociatePrincipalWithPortfolio)

-- | The portfolio identifier.
associatePrincipalWithPortfolio_portfolioId :: Lens.Lens' AssociatePrincipalWithPortfolio Prelude.Text
associatePrincipalWithPortfolio_portfolioId :: (Text -> f Text)
-> AssociatePrincipalWithPortfolio
-> f AssociatePrincipalWithPortfolio
associatePrincipalWithPortfolio_portfolioId = (AssociatePrincipalWithPortfolio -> Text)
-> (AssociatePrincipalWithPortfolio
    -> Text -> AssociatePrincipalWithPortfolio)
-> Lens
     AssociatePrincipalWithPortfolio
     AssociatePrincipalWithPortfolio
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePrincipalWithPortfolio' {Text
portfolioId :: Text
$sel:portfolioId:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> Text
portfolioId} -> Text
portfolioId) (\s :: AssociatePrincipalWithPortfolio
s@AssociatePrincipalWithPortfolio' {} Text
a -> AssociatePrincipalWithPortfolio
s {$sel:portfolioId:AssociatePrincipalWithPortfolio' :: Text
portfolioId = Text
a} :: AssociatePrincipalWithPortfolio)

-- | The ARN of the principal (IAM user, role, or group).
associatePrincipalWithPortfolio_principalARN :: Lens.Lens' AssociatePrincipalWithPortfolio Prelude.Text
associatePrincipalWithPortfolio_principalARN :: (Text -> f Text)
-> AssociatePrincipalWithPortfolio
-> f AssociatePrincipalWithPortfolio
associatePrincipalWithPortfolio_principalARN = (AssociatePrincipalWithPortfolio -> Text)
-> (AssociatePrincipalWithPortfolio
    -> Text -> AssociatePrincipalWithPortfolio)
-> Lens
     AssociatePrincipalWithPortfolio
     AssociatePrincipalWithPortfolio
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePrincipalWithPortfolio' {Text
principalARN :: Text
$sel:principalARN:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> Text
principalARN} -> Text
principalARN) (\s :: AssociatePrincipalWithPortfolio
s@AssociatePrincipalWithPortfolio' {} Text
a -> AssociatePrincipalWithPortfolio
s {$sel:principalARN:AssociatePrincipalWithPortfolio' :: Text
principalARN = Text
a} :: AssociatePrincipalWithPortfolio)

-- | The principal type. The supported value is @IAM@.
associatePrincipalWithPortfolio_principalType :: Lens.Lens' AssociatePrincipalWithPortfolio PrincipalType
associatePrincipalWithPortfolio_principalType :: (PrincipalType -> f PrincipalType)
-> AssociatePrincipalWithPortfolio
-> f AssociatePrincipalWithPortfolio
associatePrincipalWithPortfolio_principalType = (AssociatePrincipalWithPortfolio -> PrincipalType)
-> (AssociatePrincipalWithPortfolio
    -> PrincipalType -> AssociatePrincipalWithPortfolio)
-> Lens
     AssociatePrincipalWithPortfolio
     AssociatePrincipalWithPortfolio
     PrincipalType
     PrincipalType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePrincipalWithPortfolio' {PrincipalType
principalType :: PrincipalType
$sel:principalType:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> PrincipalType
principalType} -> PrincipalType
principalType) (\s :: AssociatePrincipalWithPortfolio
s@AssociatePrincipalWithPortfolio' {} PrincipalType
a -> AssociatePrincipalWithPortfolio
s {$sel:principalType:AssociatePrincipalWithPortfolio' :: PrincipalType
principalType = PrincipalType
a} :: AssociatePrincipalWithPortfolio)

instance
  Core.AWSRequest
    AssociatePrincipalWithPortfolio
  where
  type
    AWSResponse AssociatePrincipalWithPortfolio =
      AssociatePrincipalWithPortfolioResponse
  request :: AssociatePrincipalWithPortfolio
-> Request AssociatePrincipalWithPortfolio
request = Service
-> AssociatePrincipalWithPortfolio
-> Request AssociatePrincipalWithPortfolio
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AssociatePrincipalWithPortfolio
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AssociatePrincipalWithPortfolio)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse AssociatePrincipalWithPortfolio))
-> Logger
-> Service
-> Proxy AssociatePrincipalWithPortfolio
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AssociatePrincipalWithPortfolio)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> AssociatePrincipalWithPortfolioResponse
AssociatePrincipalWithPortfolioResponse'
            (Int -> AssociatePrincipalWithPortfolioResponse)
-> Either String Int
-> Either String AssociatePrincipalWithPortfolioResponse
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))
      )

instance
  Prelude.Hashable
    AssociatePrincipalWithPortfolio

instance
  Prelude.NFData
    AssociatePrincipalWithPortfolio

instance
  Core.ToHeaders
    AssociatePrincipalWithPortfolio
  where
  toHeaders :: AssociatePrincipalWithPortfolio -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AssociatePrincipalWithPortfolio -> 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
"AWS242ServiceCatalogService.AssociatePrincipalWithPortfolio" ::
                          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 AssociatePrincipalWithPortfolio where
  toJSON :: AssociatePrincipalWithPortfolio -> Value
toJSON AssociatePrincipalWithPortfolio' {Maybe Text
Text
PrincipalType
principalType :: PrincipalType
principalARN :: Text
portfolioId :: Text
acceptLanguage :: Maybe Text
$sel:principalType:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> PrincipalType
$sel:principalARN:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> Text
$sel:portfolioId:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> Text
$sel:acceptLanguage:AssociatePrincipalWithPortfolio' :: AssociatePrincipalWithPortfolio -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AcceptLanguage" 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
acceptLanguage,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PortfolioId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
portfolioId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PrincipalARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
principalARN),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PrincipalType" Text -> PrincipalType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PrincipalType
principalType)
          ]
      )

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

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

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

-- |
-- Create a value of 'AssociatePrincipalWithPortfolioResponse' 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', 'associatePrincipalWithPortfolioResponse_httpStatus' - The response's http status code.
newAssociatePrincipalWithPortfolioResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociatePrincipalWithPortfolioResponse
newAssociatePrincipalWithPortfolioResponse :: Int -> AssociatePrincipalWithPortfolioResponse
newAssociatePrincipalWithPortfolioResponse
  Int
pHttpStatus_ =
    AssociatePrincipalWithPortfolioResponse' :: Int -> AssociatePrincipalWithPortfolioResponse
AssociatePrincipalWithPortfolioResponse'
      { $sel:httpStatus:AssociatePrincipalWithPortfolioResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

instance
  Prelude.NFData
    AssociatePrincipalWithPortfolioResponse