{-# 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.Config.PutResourceConfig
(
PutResourceConfig (..),
newPutResourceConfig,
putResourceConfig_resourceName,
putResourceConfig_tags,
putResourceConfig_resourceType,
putResourceConfig_schemaVersionId,
putResourceConfig_resourceId,
putResourceConfig_configuration,
PutResourceConfigResponse (..),
newPutResourceConfigResponse,
)
where
import Amazonka.Config.Types
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
data PutResourceConfig = PutResourceConfig'
{
PutResourceConfig -> Maybe Text
resourceName :: Prelude.Maybe Prelude.Text,
PutResourceConfig -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
PutResourceConfig -> Text
resourceType :: Prelude.Text,
PutResourceConfig -> Text
schemaVersionId :: Prelude.Text,
PutResourceConfig -> Text
resourceId :: Prelude.Text,
PutResourceConfig -> Text
configuration :: Prelude.Text
}
deriving (PutResourceConfig -> PutResourceConfig -> Bool
(PutResourceConfig -> PutResourceConfig -> Bool)
-> (PutResourceConfig -> PutResourceConfig -> Bool)
-> Eq PutResourceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResourceConfig -> PutResourceConfig -> Bool
$c/= :: PutResourceConfig -> PutResourceConfig -> Bool
== :: PutResourceConfig -> PutResourceConfig -> Bool
$c== :: PutResourceConfig -> PutResourceConfig -> Bool
Prelude.Eq, ReadPrec [PutResourceConfig]
ReadPrec PutResourceConfig
Int -> ReadS PutResourceConfig
ReadS [PutResourceConfig]
(Int -> ReadS PutResourceConfig)
-> ReadS [PutResourceConfig]
-> ReadPrec PutResourceConfig
-> ReadPrec [PutResourceConfig]
-> Read PutResourceConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResourceConfig]
$creadListPrec :: ReadPrec [PutResourceConfig]
readPrec :: ReadPrec PutResourceConfig
$creadPrec :: ReadPrec PutResourceConfig
readList :: ReadS [PutResourceConfig]
$creadList :: ReadS [PutResourceConfig]
readsPrec :: Int -> ReadS PutResourceConfig
$creadsPrec :: Int -> ReadS PutResourceConfig
Prelude.Read, Int -> PutResourceConfig -> ShowS
[PutResourceConfig] -> ShowS
PutResourceConfig -> String
(Int -> PutResourceConfig -> ShowS)
-> (PutResourceConfig -> String)
-> ([PutResourceConfig] -> ShowS)
-> Show PutResourceConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResourceConfig] -> ShowS
$cshowList :: [PutResourceConfig] -> ShowS
show :: PutResourceConfig -> String
$cshow :: PutResourceConfig -> String
showsPrec :: Int -> PutResourceConfig -> ShowS
$cshowsPrec :: Int -> PutResourceConfig -> ShowS
Prelude.Show, (forall x. PutResourceConfig -> Rep PutResourceConfig x)
-> (forall x. Rep PutResourceConfig x -> PutResourceConfig)
-> Generic PutResourceConfig
forall x. Rep PutResourceConfig x -> PutResourceConfig
forall x. PutResourceConfig -> Rep PutResourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutResourceConfig x -> PutResourceConfig
$cfrom :: forall x. PutResourceConfig -> Rep PutResourceConfig x
Prelude.Generic)
newPutResourceConfig ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PutResourceConfig
newPutResourceConfig :: Text -> Text -> Text -> Text -> PutResourceConfig
newPutResourceConfig
Text
pResourceType_
Text
pSchemaVersionId_
Text
pResourceId_
Text
pConfiguration_ =
PutResourceConfig' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> Text
-> PutResourceConfig
PutResourceConfig'
{ $sel:resourceName:PutResourceConfig' :: Maybe Text
resourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:PutResourceConfig' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:PutResourceConfig' :: Text
resourceType = Text
pResourceType_,
$sel:schemaVersionId:PutResourceConfig' :: Text
schemaVersionId = Text
pSchemaVersionId_,
$sel:resourceId:PutResourceConfig' :: Text
resourceId = Text
pResourceId_,
$sel:configuration:PutResourceConfig' :: Text
configuration = Text
pConfiguration_
}
putResourceConfig_resourceName :: Lens.Lens' PutResourceConfig (Prelude.Maybe Prelude.Text)
putResourceConfig_resourceName :: (Maybe Text -> f (Maybe Text))
-> PutResourceConfig -> f PutResourceConfig
putResourceConfig_resourceName = (PutResourceConfig -> Maybe Text)
-> (PutResourceConfig -> Maybe Text -> PutResourceConfig)
-> Lens
PutResourceConfig PutResourceConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceConfig' {Maybe Text
resourceName :: Maybe Text
$sel:resourceName:PutResourceConfig' :: PutResourceConfig -> Maybe Text
resourceName} -> Maybe Text
resourceName) (\s :: PutResourceConfig
s@PutResourceConfig' {} Maybe Text
a -> PutResourceConfig
s {$sel:resourceName:PutResourceConfig' :: Maybe Text
resourceName = Maybe Text
a} :: PutResourceConfig)
putResourceConfig_tags :: Lens.Lens' PutResourceConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
putResourceConfig_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutResourceConfig -> f PutResourceConfig
putResourceConfig_tags = (PutResourceConfig -> Maybe (HashMap Text Text))
-> (PutResourceConfig
-> Maybe (HashMap Text Text) -> PutResourceConfig)
-> Lens
PutResourceConfig
PutResourceConfig
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceConfig' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:PutResourceConfig' :: PutResourceConfig -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PutResourceConfig
s@PutResourceConfig' {} Maybe (HashMap Text Text)
a -> PutResourceConfig
s {$sel:tags:PutResourceConfig' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: PutResourceConfig) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutResourceConfig -> f PutResourceConfig)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutResourceConfig
-> f PutResourceConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putResourceConfig_resourceType :: Lens.Lens' PutResourceConfig Prelude.Text
putResourceConfig_resourceType :: (Text -> f Text) -> PutResourceConfig -> f PutResourceConfig
putResourceConfig_resourceType = (PutResourceConfig -> Text)
-> (PutResourceConfig -> Text -> PutResourceConfig)
-> Lens PutResourceConfig PutResourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceConfig' {Text
resourceType :: Text
$sel:resourceType:PutResourceConfig' :: PutResourceConfig -> Text
resourceType} -> Text
resourceType) (\s :: PutResourceConfig
s@PutResourceConfig' {} Text
a -> PutResourceConfig
s {$sel:resourceType:PutResourceConfig' :: Text
resourceType = Text
a} :: PutResourceConfig)
putResourceConfig_schemaVersionId :: Lens.Lens' PutResourceConfig Prelude.Text
putResourceConfig_schemaVersionId :: (Text -> f Text) -> PutResourceConfig -> f PutResourceConfig
putResourceConfig_schemaVersionId = (PutResourceConfig -> Text)
-> (PutResourceConfig -> Text -> PutResourceConfig)
-> Lens PutResourceConfig PutResourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceConfig' {Text
schemaVersionId :: Text
$sel:schemaVersionId:PutResourceConfig' :: PutResourceConfig -> Text
schemaVersionId} -> Text
schemaVersionId) (\s :: PutResourceConfig
s@PutResourceConfig' {} Text
a -> PutResourceConfig
s {$sel:schemaVersionId:PutResourceConfig' :: Text
schemaVersionId = Text
a} :: PutResourceConfig)
putResourceConfig_resourceId :: Lens.Lens' PutResourceConfig Prelude.Text
putResourceConfig_resourceId :: (Text -> f Text) -> PutResourceConfig -> f PutResourceConfig
putResourceConfig_resourceId = (PutResourceConfig -> Text)
-> (PutResourceConfig -> Text -> PutResourceConfig)
-> Lens PutResourceConfig PutResourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceConfig' {Text
resourceId :: Text
$sel:resourceId:PutResourceConfig' :: PutResourceConfig -> Text
resourceId} -> Text
resourceId) (\s :: PutResourceConfig
s@PutResourceConfig' {} Text
a -> PutResourceConfig
s {$sel:resourceId:PutResourceConfig' :: Text
resourceId = Text
a} :: PutResourceConfig)
putResourceConfig_configuration :: Lens.Lens' PutResourceConfig Prelude.Text
putResourceConfig_configuration :: (Text -> f Text) -> PutResourceConfig -> f PutResourceConfig
putResourceConfig_configuration = (PutResourceConfig -> Text)
-> (PutResourceConfig -> Text -> PutResourceConfig)
-> Lens PutResourceConfig PutResourceConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceConfig' {Text
configuration :: Text
$sel:configuration:PutResourceConfig' :: PutResourceConfig -> Text
configuration} -> Text
configuration) (\s :: PutResourceConfig
s@PutResourceConfig' {} Text
a -> PutResourceConfig
s {$sel:configuration:PutResourceConfig' :: Text
configuration = Text
a} :: PutResourceConfig)
instance Core.AWSRequest PutResourceConfig where
type
AWSResponse PutResourceConfig =
PutResourceConfigResponse
request :: PutResourceConfig -> Request PutResourceConfig
request = Service -> PutResourceConfig -> Request PutResourceConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutResourceConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutResourceConfig)))
response =
AWSResponse PutResourceConfig
-> Logger
-> Service
-> Proxy PutResourceConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutResourceConfig)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutResourceConfig
PutResourceConfigResponse
PutResourceConfigResponse'
instance Prelude.Hashable PutResourceConfig
instance Prelude.NFData PutResourceConfig
instance Core.ToHeaders PutResourceConfig where
toHeaders :: PutResourceConfig -> [Header]
toHeaders =
[Header] -> PutResourceConfig -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"StarlingDoveService.PutResourceConfig" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutResourceConfig where
toJSON :: PutResourceConfig -> Value
toJSON PutResourceConfig' {Maybe Text
Maybe (HashMap Text Text)
Text
configuration :: Text
resourceId :: Text
schemaVersionId :: Text
resourceType :: Text
tags :: Maybe (HashMap Text Text)
resourceName :: Maybe Text
$sel:configuration:PutResourceConfig' :: PutResourceConfig -> Text
$sel:resourceId:PutResourceConfig' :: PutResourceConfig -> Text
$sel:schemaVersionId:PutResourceConfig' :: PutResourceConfig -> Text
$sel:resourceType:PutResourceConfig' :: PutResourceConfig -> Text
$sel:tags:PutResourceConfig' :: PutResourceConfig -> Maybe (HashMap Text Text)
$sel:resourceName:PutResourceConfig' :: PutResourceConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ResourceName" 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
resourceName,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SchemaVersionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
schemaVersionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"Configuration" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
configuration)
]
)
instance Core.ToPath PutResourceConfig where
toPath :: PutResourceConfig -> ByteString
toPath = ByteString -> PutResourceConfig -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutResourceConfig where
toQuery :: PutResourceConfig -> QueryString
toQuery = QueryString -> PutResourceConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutResourceConfigResponse = PutResourceConfigResponse'
{
}
deriving (PutResourceConfigResponse -> PutResourceConfigResponse -> Bool
(PutResourceConfigResponse -> PutResourceConfigResponse -> Bool)
-> (PutResourceConfigResponse -> PutResourceConfigResponse -> Bool)
-> Eq PutResourceConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResourceConfigResponse -> PutResourceConfigResponse -> Bool
$c/= :: PutResourceConfigResponse -> PutResourceConfigResponse -> Bool
== :: PutResourceConfigResponse -> PutResourceConfigResponse -> Bool
$c== :: PutResourceConfigResponse -> PutResourceConfigResponse -> Bool
Prelude.Eq, ReadPrec [PutResourceConfigResponse]
ReadPrec PutResourceConfigResponse
Int -> ReadS PutResourceConfigResponse
ReadS [PutResourceConfigResponse]
(Int -> ReadS PutResourceConfigResponse)
-> ReadS [PutResourceConfigResponse]
-> ReadPrec PutResourceConfigResponse
-> ReadPrec [PutResourceConfigResponse]
-> Read PutResourceConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResourceConfigResponse]
$creadListPrec :: ReadPrec [PutResourceConfigResponse]
readPrec :: ReadPrec PutResourceConfigResponse
$creadPrec :: ReadPrec PutResourceConfigResponse
readList :: ReadS [PutResourceConfigResponse]
$creadList :: ReadS [PutResourceConfigResponse]
readsPrec :: Int -> ReadS PutResourceConfigResponse
$creadsPrec :: Int -> ReadS PutResourceConfigResponse
Prelude.Read, Int -> PutResourceConfigResponse -> ShowS
[PutResourceConfigResponse] -> ShowS
PutResourceConfigResponse -> String
(Int -> PutResourceConfigResponse -> ShowS)
-> (PutResourceConfigResponse -> String)
-> ([PutResourceConfigResponse] -> ShowS)
-> Show PutResourceConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResourceConfigResponse] -> ShowS
$cshowList :: [PutResourceConfigResponse] -> ShowS
show :: PutResourceConfigResponse -> String
$cshow :: PutResourceConfigResponse -> String
showsPrec :: Int -> PutResourceConfigResponse -> ShowS
$cshowsPrec :: Int -> PutResourceConfigResponse -> ShowS
Prelude.Show, (forall x.
PutResourceConfigResponse -> Rep PutResourceConfigResponse x)
-> (forall x.
Rep PutResourceConfigResponse x -> PutResourceConfigResponse)
-> Generic PutResourceConfigResponse
forall x.
Rep PutResourceConfigResponse x -> PutResourceConfigResponse
forall x.
PutResourceConfigResponse -> Rep PutResourceConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutResourceConfigResponse x -> PutResourceConfigResponse
$cfrom :: forall x.
PutResourceConfigResponse -> Rep PutResourceConfigResponse x
Prelude.Generic)
newPutResourceConfigResponse ::
PutResourceConfigResponse
newPutResourceConfigResponse :: PutResourceConfigResponse
newPutResourceConfigResponse =
PutResourceConfigResponse
PutResourceConfigResponse'
instance Prelude.NFData PutResourceConfigResponse