{-# 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.ECR.PutReplicationConfiguration
(
PutReplicationConfiguration (..),
newPutReplicationConfiguration,
putReplicationConfiguration_replicationConfiguration,
PutReplicationConfigurationResponse (..),
newPutReplicationConfigurationResponse,
putReplicationConfigurationResponse_replicationConfiguration,
putReplicationConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ECR.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
data PutReplicationConfiguration = PutReplicationConfiguration'
{
PutReplicationConfiguration -> ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
}
deriving (PutReplicationConfiguration -> PutReplicationConfiguration -> Bool
(PutReplicationConfiguration
-> PutReplicationConfiguration -> Bool)
-> (PutReplicationConfiguration
-> PutReplicationConfiguration -> Bool)
-> Eq PutReplicationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutReplicationConfiguration -> PutReplicationConfiguration -> Bool
$c/= :: PutReplicationConfiguration -> PutReplicationConfiguration -> Bool
== :: PutReplicationConfiguration -> PutReplicationConfiguration -> Bool
$c== :: PutReplicationConfiguration -> PutReplicationConfiguration -> Bool
Prelude.Eq, ReadPrec [PutReplicationConfiguration]
ReadPrec PutReplicationConfiguration
Int -> ReadS PutReplicationConfiguration
ReadS [PutReplicationConfiguration]
(Int -> ReadS PutReplicationConfiguration)
-> ReadS [PutReplicationConfiguration]
-> ReadPrec PutReplicationConfiguration
-> ReadPrec [PutReplicationConfiguration]
-> Read PutReplicationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutReplicationConfiguration]
$creadListPrec :: ReadPrec [PutReplicationConfiguration]
readPrec :: ReadPrec PutReplicationConfiguration
$creadPrec :: ReadPrec PutReplicationConfiguration
readList :: ReadS [PutReplicationConfiguration]
$creadList :: ReadS [PutReplicationConfiguration]
readsPrec :: Int -> ReadS PutReplicationConfiguration
$creadsPrec :: Int -> ReadS PutReplicationConfiguration
Prelude.Read, Int -> PutReplicationConfiguration -> ShowS
[PutReplicationConfiguration] -> ShowS
PutReplicationConfiguration -> String
(Int -> PutReplicationConfiguration -> ShowS)
-> (PutReplicationConfiguration -> String)
-> ([PutReplicationConfiguration] -> ShowS)
-> Show PutReplicationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutReplicationConfiguration] -> ShowS
$cshowList :: [PutReplicationConfiguration] -> ShowS
show :: PutReplicationConfiguration -> String
$cshow :: PutReplicationConfiguration -> String
showsPrec :: Int -> PutReplicationConfiguration -> ShowS
$cshowsPrec :: Int -> PutReplicationConfiguration -> ShowS
Prelude.Show, (forall x.
PutReplicationConfiguration -> Rep PutReplicationConfiguration x)
-> (forall x.
Rep PutReplicationConfiguration x -> PutReplicationConfiguration)
-> Generic PutReplicationConfiguration
forall x.
Rep PutReplicationConfiguration x -> PutReplicationConfiguration
forall x.
PutReplicationConfiguration -> Rep PutReplicationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutReplicationConfiguration x -> PutReplicationConfiguration
$cfrom :: forall x.
PutReplicationConfiguration -> Rep PutReplicationConfiguration x
Prelude.Generic)
newPutReplicationConfiguration ::
ReplicationConfiguration ->
PutReplicationConfiguration
newPutReplicationConfiguration :: ReplicationConfiguration -> PutReplicationConfiguration
newPutReplicationConfiguration
ReplicationConfiguration
pReplicationConfiguration_ =
PutReplicationConfiguration' :: ReplicationConfiguration -> PutReplicationConfiguration
PutReplicationConfiguration'
{ $sel:replicationConfiguration:PutReplicationConfiguration' :: ReplicationConfiguration
replicationConfiguration =
ReplicationConfiguration
pReplicationConfiguration_
}
putReplicationConfiguration_replicationConfiguration :: Lens.Lens' PutReplicationConfiguration ReplicationConfiguration
putReplicationConfiguration_replicationConfiguration :: (ReplicationConfiguration -> f ReplicationConfiguration)
-> PutReplicationConfiguration -> f PutReplicationConfiguration
putReplicationConfiguration_replicationConfiguration = (PutReplicationConfiguration -> ReplicationConfiguration)
-> (PutReplicationConfiguration
-> ReplicationConfiguration -> PutReplicationConfiguration)
-> Lens
PutReplicationConfiguration
PutReplicationConfiguration
ReplicationConfiguration
ReplicationConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutReplicationConfiguration' {ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
$sel:replicationConfiguration:PutReplicationConfiguration' :: PutReplicationConfiguration -> ReplicationConfiguration
replicationConfiguration} -> ReplicationConfiguration
replicationConfiguration) (\s :: PutReplicationConfiguration
s@PutReplicationConfiguration' {} ReplicationConfiguration
a -> PutReplicationConfiguration
s {$sel:replicationConfiguration:PutReplicationConfiguration' :: ReplicationConfiguration
replicationConfiguration = ReplicationConfiguration
a} :: PutReplicationConfiguration)
instance Core.AWSRequest PutReplicationConfiguration where
type
AWSResponse PutReplicationConfiguration =
PutReplicationConfigurationResponse
request :: PutReplicationConfiguration -> Request PutReplicationConfiguration
request = Service
-> PutReplicationConfiguration
-> Request PutReplicationConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutReplicationConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutReplicationConfiguration))
-> Logger
-> Service
-> Proxy PutReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutReplicationConfiguration)))
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 ReplicationConfiguration
-> Int -> PutReplicationConfigurationResponse
PutReplicationConfigurationResponse'
(Maybe ReplicationConfiguration
-> Int -> PutReplicationConfigurationResponse)
-> Either String (Maybe ReplicationConfiguration)
-> Either String (Int -> PutReplicationConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Key -> Either String (Maybe ReplicationConfiguration)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"replicationConfiguration")
Either String (Int -> PutReplicationConfigurationResponse)
-> Either String Int
-> Either String PutReplicationConfigurationResponse
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 PutReplicationConfiguration
instance Prelude.NFData PutReplicationConfiguration
instance Core.ToHeaders PutReplicationConfiguration where
toHeaders :: PutReplicationConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutReplicationConfiguration -> 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
"AmazonEC2ContainerRegistry_V20150921.PutReplicationConfiguration" ::
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 PutReplicationConfiguration where
toJSON :: PutReplicationConfiguration -> Value
toJSON PutReplicationConfiguration' {ReplicationConfiguration
replicationConfiguration :: ReplicationConfiguration
$sel:replicationConfiguration:PutReplicationConfiguration' :: PutReplicationConfiguration -> ReplicationConfiguration
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Key
"replicationConfiguration"
Key -> ReplicationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= ReplicationConfiguration
replicationConfiguration
)
]
)
instance Core.ToPath PutReplicationConfiguration where
toPath :: PutReplicationConfiguration -> ByteString
toPath = ByteString -> PutReplicationConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutReplicationConfiguration where
toQuery :: PutReplicationConfiguration -> QueryString
toQuery = QueryString -> PutReplicationConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutReplicationConfigurationResponse = PutReplicationConfigurationResponse'
{
PutReplicationConfigurationResponse
-> Maybe ReplicationConfiguration
replicationConfiguration :: Prelude.Maybe ReplicationConfiguration,
PutReplicationConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutReplicationConfigurationResponse
-> PutReplicationConfigurationResponse -> Bool
(PutReplicationConfigurationResponse
-> PutReplicationConfigurationResponse -> Bool)
-> (PutReplicationConfigurationResponse
-> PutReplicationConfigurationResponse -> Bool)
-> Eq PutReplicationConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutReplicationConfigurationResponse
-> PutReplicationConfigurationResponse -> Bool
$c/= :: PutReplicationConfigurationResponse
-> PutReplicationConfigurationResponse -> Bool
== :: PutReplicationConfigurationResponse
-> PutReplicationConfigurationResponse -> Bool
$c== :: PutReplicationConfigurationResponse
-> PutReplicationConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutReplicationConfigurationResponse]
ReadPrec PutReplicationConfigurationResponse
Int -> ReadS PutReplicationConfigurationResponse
ReadS [PutReplicationConfigurationResponse]
(Int -> ReadS PutReplicationConfigurationResponse)
-> ReadS [PutReplicationConfigurationResponse]
-> ReadPrec PutReplicationConfigurationResponse
-> ReadPrec [PutReplicationConfigurationResponse]
-> Read PutReplicationConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutReplicationConfigurationResponse]
$creadListPrec :: ReadPrec [PutReplicationConfigurationResponse]
readPrec :: ReadPrec PutReplicationConfigurationResponse
$creadPrec :: ReadPrec PutReplicationConfigurationResponse
readList :: ReadS [PutReplicationConfigurationResponse]
$creadList :: ReadS [PutReplicationConfigurationResponse]
readsPrec :: Int -> ReadS PutReplicationConfigurationResponse
$creadsPrec :: Int -> ReadS PutReplicationConfigurationResponse
Prelude.Read, Int -> PutReplicationConfigurationResponse -> ShowS
[PutReplicationConfigurationResponse] -> ShowS
PutReplicationConfigurationResponse -> String
(Int -> PutReplicationConfigurationResponse -> ShowS)
-> (PutReplicationConfigurationResponse -> String)
-> ([PutReplicationConfigurationResponse] -> ShowS)
-> Show PutReplicationConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutReplicationConfigurationResponse] -> ShowS
$cshowList :: [PutReplicationConfigurationResponse] -> ShowS
show :: PutReplicationConfigurationResponse -> String
$cshow :: PutReplicationConfigurationResponse -> String
showsPrec :: Int -> PutReplicationConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutReplicationConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutReplicationConfigurationResponse
-> Rep PutReplicationConfigurationResponse x)
-> (forall x.
Rep PutReplicationConfigurationResponse x
-> PutReplicationConfigurationResponse)
-> Generic PutReplicationConfigurationResponse
forall x.
Rep PutReplicationConfigurationResponse x
-> PutReplicationConfigurationResponse
forall x.
PutReplicationConfigurationResponse
-> Rep PutReplicationConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutReplicationConfigurationResponse x
-> PutReplicationConfigurationResponse
$cfrom :: forall x.
PutReplicationConfigurationResponse
-> Rep PutReplicationConfigurationResponse x
Prelude.Generic)
newPutReplicationConfigurationResponse ::
Prelude.Int ->
PutReplicationConfigurationResponse
newPutReplicationConfigurationResponse :: Int -> PutReplicationConfigurationResponse
newPutReplicationConfigurationResponse Int
pHttpStatus_ =
PutReplicationConfigurationResponse' :: Maybe ReplicationConfiguration
-> Int -> PutReplicationConfigurationResponse
PutReplicationConfigurationResponse'
{ $sel:replicationConfiguration:PutReplicationConfigurationResponse' :: Maybe ReplicationConfiguration
replicationConfiguration =
Maybe ReplicationConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutReplicationConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putReplicationConfigurationResponse_replicationConfiguration :: Lens.Lens' PutReplicationConfigurationResponse (Prelude.Maybe ReplicationConfiguration)
putReplicationConfigurationResponse_replicationConfiguration :: (Maybe ReplicationConfiguration
-> f (Maybe ReplicationConfiguration))
-> PutReplicationConfigurationResponse
-> f PutReplicationConfigurationResponse
putReplicationConfigurationResponse_replicationConfiguration = (PutReplicationConfigurationResponse
-> Maybe ReplicationConfiguration)
-> (PutReplicationConfigurationResponse
-> Maybe ReplicationConfiguration
-> PutReplicationConfigurationResponse)
-> Lens
PutReplicationConfigurationResponse
PutReplicationConfigurationResponse
(Maybe ReplicationConfiguration)
(Maybe ReplicationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutReplicationConfigurationResponse' {Maybe ReplicationConfiguration
replicationConfiguration :: Maybe ReplicationConfiguration
$sel:replicationConfiguration:PutReplicationConfigurationResponse' :: PutReplicationConfigurationResponse
-> Maybe ReplicationConfiguration
replicationConfiguration} -> Maybe ReplicationConfiguration
replicationConfiguration) (\s :: PutReplicationConfigurationResponse
s@PutReplicationConfigurationResponse' {} Maybe ReplicationConfiguration
a -> PutReplicationConfigurationResponse
s {$sel:replicationConfiguration:PutReplicationConfigurationResponse' :: Maybe ReplicationConfiguration
replicationConfiguration = Maybe ReplicationConfiguration
a} :: PutReplicationConfigurationResponse)
putReplicationConfigurationResponse_httpStatus :: Lens.Lens' PutReplicationConfigurationResponse Prelude.Int
putReplicationConfigurationResponse_httpStatus :: (Int -> f Int)
-> PutReplicationConfigurationResponse
-> f PutReplicationConfigurationResponse
putReplicationConfigurationResponse_httpStatus = (PutReplicationConfigurationResponse -> Int)
-> (PutReplicationConfigurationResponse
-> Int -> PutReplicationConfigurationResponse)
-> Lens
PutReplicationConfigurationResponse
PutReplicationConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutReplicationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutReplicationConfigurationResponse' :: PutReplicationConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutReplicationConfigurationResponse
s@PutReplicationConfigurationResponse' {} Int
a -> PutReplicationConfigurationResponse
s {$sel:httpStatus:PutReplicationConfigurationResponse' :: Int
httpStatus = Int
a} :: PutReplicationConfigurationResponse)
instance
Prelude.NFData
PutReplicationConfigurationResponse