{-# 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 #-}
module Amazonka.RAM.PromoteResourceShareCreatedFromPolicy
(
PromoteResourceShareCreatedFromPolicy (..),
newPromoteResourceShareCreatedFromPolicy,
promoteResourceShareCreatedFromPolicy_resourceShareArn,
PromoteResourceShareCreatedFromPolicyResponse (..),
newPromoteResourceShareCreatedFromPolicyResponse,
promoteResourceShareCreatedFromPolicyResponse_returnValue,
promoteResourceShareCreatedFromPolicyResponse_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
data PromoteResourceShareCreatedFromPolicy = PromoteResourceShareCreatedFromPolicy'
{
PromoteResourceShareCreatedFromPolicy -> Text
resourceShareArn :: Prelude.Text
}
deriving (PromoteResourceShareCreatedFromPolicy
-> PromoteResourceShareCreatedFromPolicy -> Bool
(PromoteResourceShareCreatedFromPolicy
-> PromoteResourceShareCreatedFromPolicy -> Bool)
-> (PromoteResourceShareCreatedFromPolicy
-> PromoteResourceShareCreatedFromPolicy -> Bool)
-> Eq PromoteResourceShareCreatedFromPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PromoteResourceShareCreatedFromPolicy
-> PromoteResourceShareCreatedFromPolicy -> Bool
$c/= :: PromoteResourceShareCreatedFromPolicy
-> PromoteResourceShareCreatedFromPolicy -> Bool
== :: PromoteResourceShareCreatedFromPolicy
-> PromoteResourceShareCreatedFromPolicy -> Bool
$c== :: PromoteResourceShareCreatedFromPolicy
-> PromoteResourceShareCreatedFromPolicy -> Bool
Prelude.Eq, ReadPrec [PromoteResourceShareCreatedFromPolicy]
ReadPrec PromoteResourceShareCreatedFromPolicy
Int -> ReadS PromoteResourceShareCreatedFromPolicy
ReadS [PromoteResourceShareCreatedFromPolicy]
(Int -> ReadS PromoteResourceShareCreatedFromPolicy)
-> ReadS [PromoteResourceShareCreatedFromPolicy]
-> ReadPrec PromoteResourceShareCreatedFromPolicy
-> ReadPrec [PromoteResourceShareCreatedFromPolicy]
-> Read PromoteResourceShareCreatedFromPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PromoteResourceShareCreatedFromPolicy]
$creadListPrec :: ReadPrec [PromoteResourceShareCreatedFromPolicy]
readPrec :: ReadPrec PromoteResourceShareCreatedFromPolicy
$creadPrec :: ReadPrec PromoteResourceShareCreatedFromPolicy
readList :: ReadS [PromoteResourceShareCreatedFromPolicy]
$creadList :: ReadS [PromoteResourceShareCreatedFromPolicy]
readsPrec :: Int -> ReadS PromoteResourceShareCreatedFromPolicy
$creadsPrec :: Int -> ReadS PromoteResourceShareCreatedFromPolicy
Prelude.Read, Int -> PromoteResourceShareCreatedFromPolicy -> ShowS
[PromoteResourceShareCreatedFromPolicy] -> ShowS
PromoteResourceShareCreatedFromPolicy -> String
(Int -> PromoteResourceShareCreatedFromPolicy -> ShowS)
-> (PromoteResourceShareCreatedFromPolicy -> String)
-> ([PromoteResourceShareCreatedFromPolicy] -> ShowS)
-> Show PromoteResourceShareCreatedFromPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PromoteResourceShareCreatedFromPolicy] -> ShowS
$cshowList :: [PromoteResourceShareCreatedFromPolicy] -> ShowS
show :: PromoteResourceShareCreatedFromPolicy -> String
$cshow :: PromoteResourceShareCreatedFromPolicy -> String
showsPrec :: Int -> PromoteResourceShareCreatedFromPolicy -> ShowS
$cshowsPrec :: Int -> PromoteResourceShareCreatedFromPolicy -> ShowS
Prelude.Show, (forall x.
PromoteResourceShareCreatedFromPolicy
-> Rep PromoteResourceShareCreatedFromPolicy x)
-> (forall x.
Rep PromoteResourceShareCreatedFromPolicy x
-> PromoteResourceShareCreatedFromPolicy)
-> Generic PromoteResourceShareCreatedFromPolicy
forall x.
Rep PromoteResourceShareCreatedFromPolicy x
-> PromoteResourceShareCreatedFromPolicy
forall x.
PromoteResourceShareCreatedFromPolicy
-> Rep PromoteResourceShareCreatedFromPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PromoteResourceShareCreatedFromPolicy x
-> PromoteResourceShareCreatedFromPolicy
$cfrom :: forall x.
PromoteResourceShareCreatedFromPolicy
-> Rep PromoteResourceShareCreatedFromPolicy x
Prelude.Generic)
newPromoteResourceShareCreatedFromPolicy ::
Prelude.Text ->
PromoteResourceShareCreatedFromPolicy
newPromoteResourceShareCreatedFromPolicy :: Text -> PromoteResourceShareCreatedFromPolicy
newPromoteResourceShareCreatedFromPolicy
Text
pResourceShareArn_ =
PromoteResourceShareCreatedFromPolicy' :: Text -> PromoteResourceShareCreatedFromPolicy
PromoteResourceShareCreatedFromPolicy'
{ $sel:resourceShareArn:PromoteResourceShareCreatedFromPolicy' :: Text
resourceShareArn =
Text
pResourceShareArn_
}
promoteResourceShareCreatedFromPolicy_resourceShareArn :: Lens.Lens' PromoteResourceShareCreatedFromPolicy Prelude.Text
promoteResourceShareCreatedFromPolicy_resourceShareArn :: (Text -> f Text)
-> PromoteResourceShareCreatedFromPolicy
-> f PromoteResourceShareCreatedFromPolicy
promoteResourceShareCreatedFromPolicy_resourceShareArn = (PromoteResourceShareCreatedFromPolicy -> Text)
-> (PromoteResourceShareCreatedFromPolicy
-> Text -> PromoteResourceShareCreatedFromPolicy)
-> Lens
PromoteResourceShareCreatedFromPolicy
PromoteResourceShareCreatedFromPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PromoteResourceShareCreatedFromPolicy' {Text
resourceShareArn :: Text
$sel:resourceShareArn:PromoteResourceShareCreatedFromPolicy' :: PromoteResourceShareCreatedFromPolicy -> Text
resourceShareArn} -> Text
resourceShareArn) (\s :: PromoteResourceShareCreatedFromPolicy
s@PromoteResourceShareCreatedFromPolicy' {} Text
a -> PromoteResourceShareCreatedFromPolicy
s {$sel:resourceShareArn:PromoteResourceShareCreatedFromPolicy' :: Text
resourceShareArn = Text
a} :: PromoteResourceShareCreatedFromPolicy)
instance
Core.AWSRequest
PromoteResourceShareCreatedFromPolicy
where
type
AWSResponse
PromoteResourceShareCreatedFromPolicy =
PromoteResourceShareCreatedFromPolicyResponse
request :: PromoteResourceShareCreatedFromPolicy
-> Request PromoteResourceShareCreatedFromPolicy
request = Service
-> PromoteResourceShareCreatedFromPolicy
-> Request PromoteResourceShareCreatedFromPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PromoteResourceShareCreatedFromPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse PromoteResourceShareCreatedFromPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either
String (AWSResponse PromoteResourceShareCreatedFromPolicy))
-> Logger
-> Service
-> Proxy PromoteResourceShareCreatedFromPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse PromoteResourceShareCreatedFromPolicy)))
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 Bool -> Int -> PromoteResourceShareCreatedFromPolicyResponse
PromoteResourceShareCreatedFromPolicyResponse'
(Maybe Bool
-> Int -> PromoteResourceShareCreatedFromPolicyResponse)
-> Either String (Maybe Bool)
-> Either
String (Int -> PromoteResourceShareCreatedFromPolicyResponse)
forall (f :: * -> *) a b. Functor 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 -> PromoteResourceShareCreatedFromPolicyResponse)
-> Either String Int
-> Either String PromoteResourceShareCreatedFromPolicyResponse
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
PromoteResourceShareCreatedFromPolicy
instance
Prelude.NFData
PromoteResourceShareCreatedFromPolicy
instance
Core.ToHeaders
PromoteResourceShareCreatedFromPolicy
where
toHeaders :: PromoteResourceShareCreatedFromPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PromoteResourceShareCreatedFromPolicy -> 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
PromoteResourceShareCreatedFromPolicy
where
toJSON :: PromoteResourceShareCreatedFromPolicy -> Value
toJSON = Value -> PromoteResourceShareCreatedFromPolicy -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance
Core.ToPath
PromoteResourceShareCreatedFromPolicy
where
toPath :: PromoteResourceShareCreatedFromPolicy -> ByteString
toPath =
ByteString -> PromoteResourceShareCreatedFromPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/promoteresourcesharecreatedfrompolicy"
instance
Core.ToQuery
PromoteResourceShareCreatedFromPolicy
where
toQuery :: PromoteResourceShareCreatedFromPolicy -> QueryString
toQuery PromoteResourceShareCreatedFromPolicy' {Text
resourceShareArn :: Text
$sel:resourceShareArn:PromoteResourceShareCreatedFromPolicy' :: PromoteResourceShareCreatedFromPolicy -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"resourceShareArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
resourceShareArn]
data PromoteResourceShareCreatedFromPolicyResponse = PromoteResourceShareCreatedFromPolicyResponse'
{
PromoteResourceShareCreatedFromPolicyResponse -> Maybe Bool
returnValue :: Prelude.Maybe Prelude.Bool,
PromoteResourceShareCreatedFromPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PromoteResourceShareCreatedFromPolicyResponse
-> PromoteResourceShareCreatedFromPolicyResponse -> Bool
(PromoteResourceShareCreatedFromPolicyResponse
-> PromoteResourceShareCreatedFromPolicyResponse -> Bool)
-> (PromoteResourceShareCreatedFromPolicyResponse
-> PromoteResourceShareCreatedFromPolicyResponse -> Bool)
-> Eq PromoteResourceShareCreatedFromPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PromoteResourceShareCreatedFromPolicyResponse
-> PromoteResourceShareCreatedFromPolicyResponse -> Bool
$c/= :: PromoteResourceShareCreatedFromPolicyResponse
-> PromoteResourceShareCreatedFromPolicyResponse -> Bool
== :: PromoteResourceShareCreatedFromPolicyResponse
-> PromoteResourceShareCreatedFromPolicyResponse -> Bool
$c== :: PromoteResourceShareCreatedFromPolicyResponse
-> PromoteResourceShareCreatedFromPolicyResponse -> Bool
Prelude.Eq, ReadPrec [PromoteResourceShareCreatedFromPolicyResponse]
ReadPrec PromoteResourceShareCreatedFromPolicyResponse
Int -> ReadS PromoteResourceShareCreatedFromPolicyResponse
ReadS [PromoteResourceShareCreatedFromPolicyResponse]
(Int -> ReadS PromoteResourceShareCreatedFromPolicyResponse)
-> ReadS [PromoteResourceShareCreatedFromPolicyResponse]
-> ReadPrec PromoteResourceShareCreatedFromPolicyResponse
-> ReadPrec [PromoteResourceShareCreatedFromPolicyResponse]
-> Read PromoteResourceShareCreatedFromPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PromoteResourceShareCreatedFromPolicyResponse]
$creadListPrec :: ReadPrec [PromoteResourceShareCreatedFromPolicyResponse]
readPrec :: ReadPrec PromoteResourceShareCreatedFromPolicyResponse
$creadPrec :: ReadPrec PromoteResourceShareCreatedFromPolicyResponse
readList :: ReadS [PromoteResourceShareCreatedFromPolicyResponse]
$creadList :: ReadS [PromoteResourceShareCreatedFromPolicyResponse]
readsPrec :: Int -> ReadS PromoteResourceShareCreatedFromPolicyResponse
$creadsPrec :: Int -> ReadS PromoteResourceShareCreatedFromPolicyResponse
Prelude.Read, Int -> PromoteResourceShareCreatedFromPolicyResponse -> ShowS
[PromoteResourceShareCreatedFromPolicyResponse] -> ShowS
PromoteResourceShareCreatedFromPolicyResponse -> String
(Int -> PromoteResourceShareCreatedFromPolicyResponse -> ShowS)
-> (PromoteResourceShareCreatedFromPolicyResponse -> String)
-> ([PromoteResourceShareCreatedFromPolicyResponse] -> ShowS)
-> Show PromoteResourceShareCreatedFromPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PromoteResourceShareCreatedFromPolicyResponse] -> ShowS
$cshowList :: [PromoteResourceShareCreatedFromPolicyResponse] -> ShowS
show :: PromoteResourceShareCreatedFromPolicyResponse -> String
$cshow :: PromoteResourceShareCreatedFromPolicyResponse -> String
showsPrec :: Int -> PromoteResourceShareCreatedFromPolicyResponse -> ShowS
$cshowsPrec :: Int -> PromoteResourceShareCreatedFromPolicyResponse -> ShowS
Prelude.Show, (forall x.
PromoteResourceShareCreatedFromPolicyResponse
-> Rep PromoteResourceShareCreatedFromPolicyResponse x)
-> (forall x.
Rep PromoteResourceShareCreatedFromPolicyResponse x
-> PromoteResourceShareCreatedFromPolicyResponse)
-> Generic PromoteResourceShareCreatedFromPolicyResponse
forall x.
Rep PromoteResourceShareCreatedFromPolicyResponse x
-> PromoteResourceShareCreatedFromPolicyResponse
forall x.
PromoteResourceShareCreatedFromPolicyResponse
-> Rep PromoteResourceShareCreatedFromPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PromoteResourceShareCreatedFromPolicyResponse x
-> PromoteResourceShareCreatedFromPolicyResponse
$cfrom :: forall x.
PromoteResourceShareCreatedFromPolicyResponse
-> Rep PromoteResourceShareCreatedFromPolicyResponse x
Prelude.Generic)
newPromoteResourceShareCreatedFromPolicyResponse ::
Prelude.Int ->
PromoteResourceShareCreatedFromPolicyResponse
newPromoteResourceShareCreatedFromPolicyResponse :: Int -> PromoteResourceShareCreatedFromPolicyResponse
newPromoteResourceShareCreatedFromPolicyResponse
Int
pHttpStatus_ =
PromoteResourceShareCreatedFromPolicyResponse' :: Maybe Bool -> Int -> PromoteResourceShareCreatedFromPolicyResponse
PromoteResourceShareCreatedFromPolicyResponse'
{ $sel:returnValue:PromoteResourceShareCreatedFromPolicyResponse' :: Maybe Bool
returnValue =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PromoteResourceShareCreatedFromPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
promoteResourceShareCreatedFromPolicyResponse_returnValue :: Lens.Lens' PromoteResourceShareCreatedFromPolicyResponse (Prelude.Maybe Prelude.Bool)
promoteResourceShareCreatedFromPolicyResponse_returnValue :: (Maybe Bool -> f (Maybe Bool))
-> PromoteResourceShareCreatedFromPolicyResponse
-> f PromoteResourceShareCreatedFromPolicyResponse
promoteResourceShareCreatedFromPolicyResponse_returnValue = (PromoteResourceShareCreatedFromPolicyResponse -> Maybe Bool)
-> (PromoteResourceShareCreatedFromPolicyResponse
-> Maybe Bool -> PromoteResourceShareCreatedFromPolicyResponse)
-> Lens
PromoteResourceShareCreatedFromPolicyResponse
PromoteResourceShareCreatedFromPolicyResponse
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PromoteResourceShareCreatedFromPolicyResponse' {Maybe Bool
returnValue :: Maybe Bool
$sel:returnValue:PromoteResourceShareCreatedFromPolicyResponse' :: PromoteResourceShareCreatedFromPolicyResponse -> Maybe Bool
returnValue} -> Maybe Bool
returnValue) (\s :: PromoteResourceShareCreatedFromPolicyResponse
s@PromoteResourceShareCreatedFromPolicyResponse' {} Maybe Bool
a -> PromoteResourceShareCreatedFromPolicyResponse
s {$sel:returnValue:PromoteResourceShareCreatedFromPolicyResponse' :: Maybe Bool
returnValue = Maybe Bool
a} :: PromoteResourceShareCreatedFromPolicyResponse)
promoteResourceShareCreatedFromPolicyResponse_httpStatus :: Lens.Lens' PromoteResourceShareCreatedFromPolicyResponse Prelude.Int
promoteResourceShareCreatedFromPolicyResponse_httpStatus :: (Int -> f Int)
-> PromoteResourceShareCreatedFromPolicyResponse
-> f PromoteResourceShareCreatedFromPolicyResponse
promoteResourceShareCreatedFromPolicyResponse_httpStatus = (PromoteResourceShareCreatedFromPolicyResponse -> Int)
-> (PromoteResourceShareCreatedFromPolicyResponse
-> Int -> PromoteResourceShareCreatedFromPolicyResponse)
-> Lens
PromoteResourceShareCreatedFromPolicyResponse
PromoteResourceShareCreatedFromPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PromoteResourceShareCreatedFromPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PromoteResourceShareCreatedFromPolicyResponse' :: PromoteResourceShareCreatedFromPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PromoteResourceShareCreatedFromPolicyResponse
s@PromoteResourceShareCreatedFromPolicyResponse' {} Int
a -> PromoteResourceShareCreatedFromPolicyResponse
s {$sel:httpStatus:PromoteResourceShareCreatedFromPolicyResponse' :: Int
httpStatus = Int
a} :: PromoteResourceShareCreatedFromPolicyResponse)
instance
Prelude.NFData
PromoteResourceShareCreatedFromPolicyResponse