{-# 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.RAM.AssociateResourceSharePermission
-- 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 permission with a resource share.
module Amazonka.RAM.AssociateResourceSharePermission
  ( -- * Creating a Request
    AssociateResourceSharePermission (..),
    newAssociateResourceSharePermission,

    -- * Request Lenses
    associateResourceSharePermission_replace,
    associateResourceSharePermission_clientToken,
    associateResourceSharePermission_permissionVersion,
    associateResourceSharePermission_resourceShareArn,
    associateResourceSharePermission_permissionArn,

    -- * Destructuring the Response
    AssociateResourceSharePermissionResponse (..),
    newAssociateResourceSharePermissionResponse,

    -- * Response Lenses
    associateResourceSharePermissionResponse_clientToken,
    associateResourceSharePermissionResponse_returnValue,
    associateResourceSharePermissionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newAssociateResourceSharePermission' smart constructor.
data AssociateResourceSharePermission = AssociateResourceSharePermission'
  { -- | Indicates whether the permission should replace the permissions that are
    -- currently associated with the resource share. Use @true@ to replace the
    -- current permissions. Use @false@ to add the permission to the current
    -- permission.
    AssociateResourceSharePermission -> Maybe Bool
replace :: Prelude.Maybe Prelude.Bool,
    -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    AssociateResourceSharePermission -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The version of the RAM permissions to associate with the resource share.
    AssociateResourceSharePermission -> Maybe Int
permissionVersion :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the resource share.
    AssociateResourceSharePermission -> Text
resourceShareArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the RAM permission to associate with
    -- the resource share.
    AssociateResourceSharePermission -> Text
permissionArn :: Prelude.Text
  }
  deriving (AssociateResourceSharePermission
-> AssociateResourceSharePermission -> Bool
(AssociateResourceSharePermission
 -> AssociateResourceSharePermission -> Bool)
-> (AssociateResourceSharePermission
    -> AssociateResourceSharePermission -> Bool)
-> Eq AssociateResourceSharePermission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateResourceSharePermission
-> AssociateResourceSharePermission -> Bool
$c/= :: AssociateResourceSharePermission
-> AssociateResourceSharePermission -> Bool
== :: AssociateResourceSharePermission
-> AssociateResourceSharePermission -> Bool
$c== :: AssociateResourceSharePermission
-> AssociateResourceSharePermission -> Bool
Prelude.Eq, ReadPrec [AssociateResourceSharePermission]
ReadPrec AssociateResourceSharePermission
Int -> ReadS AssociateResourceSharePermission
ReadS [AssociateResourceSharePermission]
(Int -> ReadS AssociateResourceSharePermission)
-> ReadS [AssociateResourceSharePermission]
-> ReadPrec AssociateResourceSharePermission
-> ReadPrec [AssociateResourceSharePermission]
-> Read AssociateResourceSharePermission
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateResourceSharePermission]
$creadListPrec :: ReadPrec [AssociateResourceSharePermission]
readPrec :: ReadPrec AssociateResourceSharePermission
$creadPrec :: ReadPrec AssociateResourceSharePermission
readList :: ReadS [AssociateResourceSharePermission]
$creadList :: ReadS [AssociateResourceSharePermission]
readsPrec :: Int -> ReadS AssociateResourceSharePermission
$creadsPrec :: Int -> ReadS AssociateResourceSharePermission
Prelude.Read, Int -> AssociateResourceSharePermission -> ShowS
[AssociateResourceSharePermission] -> ShowS
AssociateResourceSharePermission -> String
(Int -> AssociateResourceSharePermission -> ShowS)
-> (AssociateResourceSharePermission -> String)
-> ([AssociateResourceSharePermission] -> ShowS)
-> Show AssociateResourceSharePermission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateResourceSharePermission] -> ShowS
$cshowList :: [AssociateResourceSharePermission] -> ShowS
show :: AssociateResourceSharePermission -> String
$cshow :: AssociateResourceSharePermission -> String
showsPrec :: Int -> AssociateResourceSharePermission -> ShowS
$cshowsPrec :: Int -> AssociateResourceSharePermission -> ShowS
Prelude.Show, (forall x.
 AssociateResourceSharePermission
 -> Rep AssociateResourceSharePermission x)
-> (forall x.
    Rep AssociateResourceSharePermission x
    -> AssociateResourceSharePermission)
-> Generic AssociateResourceSharePermission
forall x.
Rep AssociateResourceSharePermission x
-> AssociateResourceSharePermission
forall x.
AssociateResourceSharePermission
-> Rep AssociateResourceSharePermission x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateResourceSharePermission x
-> AssociateResourceSharePermission
$cfrom :: forall x.
AssociateResourceSharePermission
-> Rep AssociateResourceSharePermission x
Prelude.Generic)

-- |
-- Create a value of 'AssociateResourceSharePermission' 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:
--
-- 'replace', 'associateResourceSharePermission_replace' - Indicates whether the permission should replace the permissions that are
-- currently associated with the resource share. Use @true@ to replace the
-- current permissions. Use @false@ to add the permission to the current
-- permission.
--
-- 'clientToken', 'associateResourceSharePermission_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'permissionVersion', 'associateResourceSharePermission_permissionVersion' - The version of the RAM permissions to associate with the resource share.
--
-- 'resourceShareArn', 'associateResourceSharePermission_resourceShareArn' - The Amazon Resource Name (ARN) of the resource share.
--
-- 'permissionArn', 'associateResourceSharePermission_permissionArn' - The Amazon Resource Name (ARN) of the RAM permission to associate with
-- the resource share.
newAssociateResourceSharePermission ::
  -- | 'resourceShareArn'
  Prelude.Text ->
  -- | 'permissionArn'
  Prelude.Text ->
  AssociateResourceSharePermission
newAssociateResourceSharePermission :: Text -> Text -> AssociateResourceSharePermission
newAssociateResourceSharePermission
  Text
pResourceShareArn_
  Text
pPermissionArn_ =
    AssociateResourceSharePermission' :: Maybe Bool
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> AssociateResourceSharePermission
AssociateResourceSharePermission'
      { $sel:replace:AssociateResourceSharePermission' :: Maybe Bool
replace =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:AssociateResourceSharePermission' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:permissionVersion:AssociateResourceSharePermission' :: Maybe Int
permissionVersion = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:resourceShareArn:AssociateResourceSharePermission' :: Text
resourceShareArn = Text
pResourceShareArn_,
        $sel:permissionArn:AssociateResourceSharePermission' :: Text
permissionArn = Text
pPermissionArn_
      }

-- | Indicates whether the permission should replace the permissions that are
-- currently associated with the resource share. Use @true@ to replace the
-- current permissions. Use @false@ to add the permission to the current
-- permission.
associateResourceSharePermission_replace :: Lens.Lens' AssociateResourceSharePermission (Prelude.Maybe Prelude.Bool)
associateResourceSharePermission_replace :: (Maybe Bool -> f (Maybe Bool))
-> AssociateResourceSharePermission
-> f AssociateResourceSharePermission
associateResourceSharePermission_replace = (AssociateResourceSharePermission -> Maybe Bool)
-> (AssociateResourceSharePermission
    -> Maybe Bool -> AssociateResourceSharePermission)
-> Lens
     AssociateResourceSharePermission
     AssociateResourceSharePermission
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResourceSharePermission' {Maybe Bool
replace :: Maybe Bool
$sel:replace:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Maybe Bool
replace} -> Maybe Bool
replace) (\s :: AssociateResourceSharePermission
s@AssociateResourceSharePermission' {} Maybe Bool
a -> AssociateResourceSharePermission
s {$sel:replace:AssociateResourceSharePermission' :: Maybe Bool
replace = Maybe Bool
a} :: AssociateResourceSharePermission)

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
associateResourceSharePermission_clientToken :: Lens.Lens' AssociateResourceSharePermission (Prelude.Maybe Prelude.Text)
associateResourceSharePermission_clientToken :: (Maybe Text -> f (Maybe Text))
-> AssociateResourceSharePermission
-> f AssociateResourceSharePermission
associateResourceSharePermission_clientToken = (AssociateResourceSharePermission -> Maybe Text)
-> (AssociateResourceSharePermission
    -> Maybe Text -> AssociateResourceSharePermission)
-> Lens
     AssociateResourceSharePermission
     AssociateResourceSharePermission
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResourceSharePermission' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: AssociateResourceSharePermission
s@AssociateResourceSharePermission' {} Maybe Text
a -> AssociateResourceSharePermission
s {$sel:clientToken:AssociateResourceSharePermission' :: Maybe Text
clientToken = Maybe Text
a} :: AssociateResourceSharePermission)

-- | The version of the RAM permissions to associate with the resource share.
associateResourceSharePermission_permissionVersion :: Lens.Lens' AssociateResourceSharePermission (Prelude.Maybe Prelude.Int)
associateResourceSharePermission_permissionVersion :: (Maybe Int -> f (Maybe Int))
-> AssociateResourceSharePermission
-> f AssociateResourceSharePermission
associateResourceSharePermission_permissionVersion = (AssociateResourceSharePermission -> Maybe Int)
-> (AssociateResourceSharePermission
    -> Maybe Int -> AssociateResourceSharePermission)
-> Lens
     AssociateResourceSharePermission
     AssociateResourceSharePermission
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResourceSharePermission' {Maybe Int
permissionVersion :: Maybe Int
$sel:permissionVersion:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Maybe Int
permissionVersion} -> Maybe Int
permissionVersion) (\s :: AssociateResourceSharePermission
s@AssociateResourceSharePermission' {} Maybe Int
a -> AssociateResourceSharePermission
s {$sel:permissionVersion:AssociateResourceSharePermission' :: Maybe Int
permissionVersion = Maybe Int
a} :: AssociateResourceSharePermission)

-- | The Amazon Resource Name (ARN) of the resource share.
associateResourceSharePermission_resourceShareArn :: Lens.Lens' AssociateResourceSharePermission Prelude.Text
associateResourceSharePermission_resourceShareArn :: (Text -> f Text)
-> AssociateResourceSharePermission
-> f AssociateResourceSharePermission
associateResourceSharePermission_resourceShareArn = (AssociateResourceSharePermission -> Text)
-> (AssociateResourceSharePermission
    -> Text -> AssociateResourceSharePermission)
-> Lens
     AssociateResourceSharePermission
     AssociateResourceSharePermission
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResourceSharePermission' {Text
resourceShareArn :: Text
$sel:resourceShareArn:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Text
resourceShareArn} -> Text
resourceShareArn) (\s :: AssociateResourceSharePermission
s@AssociateResourceSharePermission' {} Text
a -> AssociateResourceSharePermission
s {$sel:resourceShareArn:AssociateResourceSharePermission' :: Text
resourceShareArn = Text
a} :: AssociateResourceSharePermission)

-- | The Amazon Resource Name (ARN) of the RAM permission to associate with
-- the resource share.
associateResourceSharePermission_permissionArn :: Lens.Lens' AssociateResourceSharePermission Prelude.Text
associateResourceSharePermission_permissionArn :: (Text -> f Text)
-> AssociateResourceSharePermission
-> f AssociateResourceSharePermission
associateResourceSharePermission_permissionArn = (AssociateResourceSharePermission -> Text)
-> (AssociateResourceSharePermission
    -> Text -> AssociateResourceSharePermission)
-> Lens
     AssociateResourceSharePermission
     AssociateResourceSharePermission
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResourceSharePermission' {Text
permissionArn :: Text
$sel:permissionArn:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Text
permissionArn} -> Text
permissionArn) (\s :: AssociateResourceSharePermission
s@AssociateResourceSharePermission' {} Text
a -> AssociateResourceSharePermission
s {$sel:permissionArn:AssociateResourceSharePermission' :: Text
permissionArn = Text
a} :: AssociateResourceSharePermission)

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

instance
  Prelude.NFData
    AssociateResourceSharePermission

instance
  Core.ToHeaders
    AssociateResourceSharePermission
  where
  toHeaders :: AssociateResourceSharePermission -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AssociateResourceSharePermission -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 AssociateResourceSharePermission where
  toJSON :: AssociateResourceSharePermission -> Value
toJSON AssociateResourceSharePermission' {Maybe Bool
Maybe Int
Maybe Text
Text
permissionArn :: Text
resourceShareArn :: Text
permissionVersion :: Maybe Int
clientToken :: Maybe Text
replace :: Maybe Bool
$sel:permissionArn:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Text
$sel:resourceShareArn:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Text
$sel:permissionVersion:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Maybe Int
$sel:clientToken:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Maybe Text
$sel:replace:AssociateResourceSharePermission' :: AssociateResourceSharePermission -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"replace" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
replace,
            (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,
            (Text
"permissionVersion" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
permissionVersion,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"resourceShareArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceShareArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"permissionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
permissionArn)
          ]
      )

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

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

-- | /See:/ 'newAssociateResourceSharePermissionResponse' smart constructor.
data AssociateResourceSharePermissionResponse = AssociateResourceSharePermissionResponse'
  { -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    AssociateResourceSharePermissionResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the request succeeded.
    AssociateResourceSharePermissionResponse -> Maybe Bool
returnValue :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    AssociateResourceSharePermissionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateResourceSharePermissionResponse
-> AssociateResourceSharePermissionResponse -> Bool
(AssociateResourceSharePermissionResponse
 -> AssociateResourceSharePermissionResponse -> Bool)
-> (AssociateResourceSharePermissionResponse
    -> AssociateResourceSharePermissionResponse -> Bool)
-> Eq AssociateResourceSharePermissionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateResourceSharePermissionResponse
-> AssociateResourceSharePermissionResponse -> Bool
$c/= :: AssociateResourceSharePermissionResponse
-> AssociateResourceSharePermissionResponse -> Bool
== :: AssociateResourceSharePermissionResponse
-> AssociateResourceSharePermissionResponse -> Bool
$c== :: AssociateResourceSharePermissionResponse
-> AssociateResourceSharePermissionResponse -> Bool
Prelude.Eq, ReadPrec [AssociateResourceSharePermissionResponse]
ReadPrec AssociateResourceSharePermissionResponse
Int -> ReadS AssociateResourceSharePermissionResponse
ReadS [AssociateResourceSharePermissionResponse]
(Int -> ReadS AssociateResourceSharePermissionResponse)
-> ReadS [AssociateResourceSharePermissionResponse]
-> ReadPrec AssociateResourceSharePermissionResponse
-> ReadPrec [AssociateResourceSharePermissionResponse]
-> Read AssociateResourceSharePermissionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateResourceSharePermissionResponse]
$creadListPrec :: ReadPrec [AssociateResourceSharePermissionResponse]
readPrec :: ReadPrec AssociateResourceSharePermissionResponse
$creadPrec :: ReadPrec AssociateResourceSharePermissionResponse
readList :: ReadS [AssociateResourceSharePermissionResponse]
$creadList :: ReadS [AssociateResourceSharePermissionResponse]
readsPrec :: Int -> ReadS AssociateResourceSharePermissionResponse
$creadsPrec :: Int -> ReadS AssociateResourceSharePermissionResponse
Prelude.Read, Int -> AssociateResourceSharePermissionResponse -> ShowS
[AssociateResourceSharePermissionResponse] -> ShowS
AssociateResourceSharePermissionResponse -> String
(Int -> AssociateResourceSharePermissionResponse -> ShowS)
-> (AssociateResourceSharePermissionResponse -> String)
-> ([AssociateResourceSharePermissionResponse] -> ShowS)
-> Show AssociateResourceSharePermissionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateResourceSharePermissionResponse] -> ShowS
$cshowList :: [AssociateResourceSharePermissionResponse] -> ShowS
show :: AssociateResourceSharePermissionResponse -> String
$cshow :: AssociateResourceSharePermissionResponse -> String
showsPrec :: Int -> AssociateResourceSharePermissionResponse -> ShowS
$cshowsPrec :: Int -> AssociateResourceSharePermissionResponse -> ShowS
Prelude.Show, (forall x.
 AssociateResourceSharePermissionResponse
 -> Rep AssociateResourceSharePermissionResponse x)
-> (forall x.
    Rep AssociateResourceSharePermissionResponse x
    -> AssociateResourceSharePermissionResponse)
-> Generic AssociateResourceSharePermissionResponse
forall x.
Rep AssociateResourceSharePermissionResponse x
-> AssociateResourceSharePermissionResponse
forall x.
AssociateResourceSharePermissionResponse
-> Rep AssociateResourceSharePermissionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateResourceSharePermissionResponse x
-> AssociateResourceSharePermissionResponse
$cfrom :: forall x.
AssociateResourceSharePermissionResponse
-> Rep AssociateResourceSharePermissionResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateResourceSharePermissionResponse' 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', 'associateResourceSharePermissionResponse_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'returnValue', 'associateResourceSharePermissionResponse_returnValue' - Indicates whether the request succeeded.
--
-- 'httpStatus', 'associateResourceSharePermissionResponse_httpStatus' - The response's http status code.
newAssociateResourceSharePermissionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateResourceSharePermissionResponse
newAssociateResourceSharePermissionResponse :: Int -> AssociateResourceSharePermissionResponse
newAssociateResourceSharePermissionResponse
  Int
pHttpStatus_ =
    AssociateResourceSharePermissionResponse' :: Maybe Text
-> Maybe Bool -> Int -> AssociateResourceSharePermissionResponse
AssociateResourceSharePermissionResponse'
      { $sel:clientToken:AssociateResourceSharePermissionResponse' :: Maybe Text
clientToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:returnValue:AssociateResourceSharePermissionResponse' :: Maybe Bool
returnValue = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AssociateResourceSharePermissionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
associateResourceSharePermissionResponse_clientToken :: Lens.Lens' AssociateResourceSharePermissionResponse (Prelude.Maybe Prelude.Text)
associateResourceSharePermissionResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> AssociateResourceSharePermissionResponse
-> f AssociateResourceSharePermissionResponse
associateResourceSharePermissionResponse_clientToken = (AssociateResourceSharePermissionResponse -> Maybe Text)
-> (AssociateResourceSharePermissionResponse
    -> Maybe Text -> AssociateResourceSharePermissionResponse)
-> Lens
     AssociateResourceSharePermissionResponse
     AssociateResourceSharePermissionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResourceSharePermissionResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:AssociateResourceSharePermissionResponse' :: AssociateResourceSharePermissionResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: AssociateResourceSharePermissionResponse
s@AssociateResourceSharePermissionResponse' {} Maybe Text
a -> AssociateResourceSharePermissionResponse
s {$sel:clientToken:AssociateResourceSharePermissionResponse' :: Maybe Text
clientToken = Maybe Text
a} :: AssociateResourceSharePermissionResponse)

-- | Indicates whether the request succeeded.
associateResourceSharePermissionResponse_returnValue :: Lens.Lens' AssociateResourceSharePermissionResponse (Prelude.Maybe Prelude.Bool)
associateResourceSharePermissionResponse_returnValue :: (Maybe Bool -> f (Maybe Bool))
-> AssociateResourceSharePermissionResponse
-> f AssociateResourceSharePermissionResponse
associateResourceSharePermissionResponse_returnValue = (AssociateResourceSharePermissionResponse -> Maybe Bool)
-> (AssociateResourceSharePermissionResponse
    -> Maybe Bool -> AssociateResourceSharePermissionResponse)
-> Lens
     AssociateResourceSharePermissionResponse
     AssociateResourceSharePermissionResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateResourceSharePermissionResponse' {Maybe Bool
returnValue :: Maybe Bool
$sel:returnValue:AssociateResourceSharePermissionResponse' :: AssociateResourceSharePermissionResponse -> Maybe Bool
returnValue} -> Maybe Bool
returnValue) (\s :: AssociateResourceSharePermissionResponse
s@AssociateResourceSharePermissionResponse' {} Maybe Bool
a -> AssociateResourceSharePermissionResponse
s {$sel:returnValue:AssociateResourceSharePermissionResponse' :: Maybe Bool
returnValue = Maybe Bool
a} :: AssociateResourceSharePermissionResponse)

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

instance
  Prelude.NFData
    AssociateResourceSharePermissionResponse