{-# 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.ECRPublic.PutRegistryCatalogData
(
PutRegistryCatalogData (..),
newPutRegistryCatalogData,
putRegistryCatalogData_displayName,
PutRegistryCatalogDataResponse (..),
newPutRegistryCatalogDataResponse,
putRegistryCatalogDataResponse_httpStatus,
putRegistryCatalogDataResponse_registryCatalogData,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ECRPublic.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 PutRegistryCatalogData = PutRegistryCatalogData'
{
PutRegistryCatalogData -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text
}
deriving (PutRegistryCatalogData -> PutRegistryCatalogData -> Bool
(PutRegistryCatalogData -> PutRegistryCatalogData -> Bool)
-> (PutRegistryCatalogData -> PutRegistryCatalogData -> Bool)
-> Eq PutRegistryCatalogData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRegistryCatalogData -> PutRegistryCatalogData -> Bool
$c/= :: PutRegistryCatalogData -> PutRegistryCatalogData -> Bool
== :: PutRegistryCatalogData -> PutRegistryCatalogData -> Bool
$c== :: PutRegistryCatalogData -> PutRegistryCatalogData -> Bool
Prelude.Eq, ReadPrec [PutRegistryCatalogData]
ReadPrec PutRegistryCatalogData
Int -> ReadS PutRegistryCatalogData
ReadS [PutRegistryCatalogData]
(Int -> ReadS PutRegistryCatalogData)
-> ReadS [PutRegistryCatalogData]
-> ReadPrec PutRegistryCatalogData
-> ReadPrec [PutRegistryCatalogData]
-> Read PutRegistryCatalogData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRegistryCatalogData]
$creadListPrec :: ReadPrec [PutRegistryCatalogData]
readPrec :: ReadPrec PutRegistryCatalogData
$creadPrec :: ReadPrec PutRegistryCatalogData
readList :: ReadS [PutRegistryCatalogData]
$creadList :: ReadS [PutRegistryCatalogData]
readsPrec :: Int -> ReadS PutRegistryCatalogData
$creadsPrec :: Int -> ReadS PutRegistryCatalogData
Prelude.Read, Int -> PutRegistryCatalogData -> ShowS
[PutRegistryCatalogData] -> ShowS
PutRegistryCatalogData -> String
(Int -> PutRegistryCatalogData -> ShowS)
-> (PutRegistryCatalogData -> String)
-> ([PutRegistryCatalogData] -> ShowS)
-> Show PutRegistryCatalogData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRegistryCatalogData] -> ShowS
$cshowList :: [PutRegistryCatalogData] -> ShowS
show :: PutRegistryCatalogData -> String
$cshow :: PutRegistryCatalogData -> String
showsPrec :: Int -> PutRegistryCatalogData -> ShowS
$cshowsPrec :: Int -> PutRegistryCatalogData -> ShowS
Prelude.Show, (forall x. PutRegistryCatalogData -> Rep PutRegistryCatalogData x)
-> (forall x.
Rep PutRegistryCatalogData x -> PutRegistryCatalogData)
-> Generic PutRegistryCatalogData
forall x. Rep PutRegistryCatalogData x -> PutRegistryCatalogData
forall x. PutRegistryCatalogData -> Rep PutRegistryCatalogData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRegistryCatalogData x -> PutRegistryCatalogData
$cfrom :: forall x. PutRegistryCatalogData -> Rep PutRegistryCatalogData x
Prelude.Generic)
newPutRegistryCatalogData ::
PutRegistryCatalogData
newPutRegistryCatalogData :: PutRegistryCatalogData
newPutRegistryCatalogData =
PutRegistryCatalogData' :: Maybe Text -> PutRegistryCatalogData
PutRegistryCatalogData'
{ $sel:displayName:PutRegistryCatalogData' :: Maybe Text
displayName =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
putRegistryCatalogData_displayName :: Lens.Lens' PutRegistryCatalogData (Prelude.Maybe Prelude.Text)
putRegistryCatalogData_displayName :: (Maybe Text -> f (Maybe Text))
-> PutRegistryCatalogData -> f PutRegistryCatalogData
putRegistryCatalogData_displayName = (PutRegistryCatalogData -> Maybe Text)
-> (PutRegistryCatalogData -> Maybe Text -> PutRegistryCatalogData)
-> Lens
PutRegistryCatalogData
PutRegistryCatalogData
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRegistryCatalogData' {Maybe Text
displayName :: Maybe Text
$sel:displayName:PutRegistryCatalogData' :: PutRegistryCatalogData -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: PutRegistryCatalogData
s@PutRegistryCatalogData' {} Maybe Text
a -> PutRegistryCatalogData
s {$sel:displayName:PutRegistryCatalogData' :: Maybe Text
displayName = Maybe Text
a} :: PutRegistryCatalogData)
instance Core.AWSRequest PutRegistryCatalogData where
type
AWSResponse PutRegistryCatalogData =
PutRegistryCatalogDataResponse
request :: PutRegistryCatalogData -> Request PutRegistryCatalogData
request = Service -> PutRegistryCatalogData -> Request PutRegistryCatalogData
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutRegistryCatalogData
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutRegistryCatalogData)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutRegistryCatalogData))
-> Logger
-> Service
-> Proxy PutRegistryCatalogData
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutRegistryCatalogData)))
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 ->
Int -> RegistryCatalogData -> PutRegistryCatalogDataResponse
PutRegistryCatalogDataResponse'
(Int -> RegistryCatalogData -> PutRegistryCatalogDataResponse)
-> Either String Int
-> Either
String (RegistryCatalogData -> PutRegistryCatalogDataResponse)
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))
Either
String (RegistryCatalogData -> PutRegistryCatalogDataResponse)
-> Either String RegistryCatalogData
-> Either String PutRegistryCatalogDataResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String RegistryCatalogData
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"registryCatalogData")
)
instance Prelude.Hashable PutRegistryCatalogData
instance Prelude.NFData PutRegistryCatalogData
instance Core.ToHeaders PutRegistryCatalogData where
toHeaders :: PutRegistryCatalogData -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutRegistryCatalogData -> 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
"SpencerFrontendService.PutRegistryCatalogData" ::
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 PutRegistryCatalogData where
toJSON :: PutRegistryCatalogData -> Value
toJSON PutRegistryCatalogData' {Maybe Text
displayName :: Maybe Text
$sel:displayName:PutRegistryCatalogData' :: PutRegistryCatalogData -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"displayName" 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
displayName]
)
instance Core.ToPath PutRegistryCatalogData where
toPath :: PutRegistryCatalogData -> ByteString
toPath = ByteString -> PutRegistryCatalogData -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutRegistryCatalogData where
toQuery :: PutRegistryCatalogData -> QueryString
toQuery = QueryString -> PutRegistryCatalogData -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutRegistryCatalogDataResponse = PutRegistryCatalogDataResponse'
{
PutRegistryCatalogDataResponse -> Int
httpStatus :: Prelude.Int,
PutRegistryCatalogDataResponse -> RegistryCatalogData
registryCatalogData :: RegistryCatalogData
}
deriving (PutRegistryCatalogDataResponse
-> PutRegistryCatalogDataResponse -> Bool
(PutRegistryCatalogDataResponse
-> PutRegistryCatalogDataResponse -> Bool)
-> (PutRegistryCatalogDataResponse
-> PutRegistryCatalogDataResponse -> Bool)
-> Eq PutRegistryCatalogDataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRegistryCatalogDataResponse
-> PutRegistryCatalogDataResponse -> Bool
$c/= :: PutRegistryCatalogDataResponse
-> PutRegistryCatalogDataResponse -> Bool
== :: PutRegistryCatalogDataResponse
-> PutRegistryCatalogDataResponse -> Bool
$c== :: PutRegistryCatalogDataResponse
-> PutRegistryCatalogDataResponse -> Bool
Prelude.Eq, ReadPrec [PutRegistryCatalogDataResponse]
ReadPrec PutRegistryCatalogDataResponse
Int -> ReadS PutRegistryCatalogDataResponse
ReadS [PutRegistryCatalogDataResponse]
(Int -> ReadS PutRegistryCatalogDataResponse)
-> ReadS [PutRegistryCatalogDataResponse]
-> ReadPrec PutRegistryCatalogDataResponse
-> ReadPrec [PutRegistryCatalogDataResponse]
-> Read PutRegistryCatalogDataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRegistryCatalogDataResponse]
$creadListPrec :: ReadPrec [PutRegistryCatalogDataResponse]
readPrec :: ReadPrec PutRegistryCatalogDataResponse
$creadPrec :: ReadPrec PutRegistryCatalogDataResponse
readList :: ReadS [PutRegistryCatalogDataResponse]
$creadList :: ReadS [PutRegistryCatalogDataResponse]
readsPrec :: Int -> ReadS PutRegistryCatalogDataResponse
$creadsPrec :: Int -> ReadS PutRegistryCatalogDataResponse
Prelude.Read, Int -> PutRegistryCatalogDataResponse -> ShowS
[PutRegistryCatalogDataResponse] -> ShowS
PutRegistryCatalogDataResponse -> String
(Int -> PutRegistryCatalogDataResponse -> ShowS)
-> (PutRegistryCatalogDataResponse -> String)
-> ([PutRegistryCatalogDataResponse] -> ShowS)
-> Show PutRegistryCatalogDataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRegistryCatalogDataResponse] -> ShowS
$cshowList :: [PutRegistryCatalogDataResponse] -> ShowS
show :: PutRegistryCatalogDataResponse -> String
$cshow :: PutRegistryCatalogDataResponse -> String
showsPrec :: Int -> PutRegistryCatalogDataResponse -> ShowS
$cshowsPrec :: Int -> PutRegistryCatalogDataResponse -> ShowS
Prelude.Show, (forall x.
PutRegistryCatalogDataResponse
-> Rep PutRegistryCatalogDataResponse x)
-> (forall x.
Rep PutRegistryCatalogDataResponse x
-> PutRegistryCatalogDataResponse)
-> Generic PutRegistryCatalogDataResponse
forall x.
Rep PutRegistryCatalogDataResponse x
-> PutRegistryCatalogDataResponse
forall x.
PutRegistryCatalogDataResponse
-> Rep PutRegistryCatalogDataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutRegistryCatalogDataResponse x
-> PutRegistryCatalogDataResponse
$cfrom :: forall x.
PutRegistryCatalogDataResponse
-> Rep PutRegistryCatalogDataResponse x
Prelude.Generic)
newPutRegistryCatalogDataResponse ::
Prelude.Int ->
RegistryCatalogData ->
PutRegistryCatalogDataResponse
newPutRegistryCatalogDataResponse :: Int -> RegistryCatalogData -> PutRegistryCatalogDataResponse
newPutRegistryCatalogDataResponse
Int
pHttpStatus_
RegistryCatalogData
pRegistryCatalogData_ =
PutRegistryCatalogDataResponse' :: Int -> RegistryCatalogData -> PutRegistryCatalogDataResponse
PutRegistryCatalogDataResponse'
{ $sel:httpStatus:PutRegistryCatalogDataResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:registryCatalogData:PutRegistryCatalogDataResponse' :: RegistryCatalogData
registryCatalogData = RegistryCatalogData
pRegistryCatalogData_
}
putRegistryCatalogDataResponse_httpStatus :: Lens.Lens' PutRegistryCatalogDataResponse Prelude.Int
putRegistryCatalogDataResponse_httpStatus :: (Int -> f Int)
-> PutRegistryCatalogDataResponse
-> f PutRegistryCatalogDataResponse
putRegistryCatalogDataResponse_httpStatus = (PutRegistryCatalogDataResponse -> Int)
-> (PutRegistryCatalogDataResponse
-> Int -> PutRegistryCatalogDataResponse)
-> Lens
PutRegistryCatalogDataResponse
PutRegistryCatalogDataResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRegistryCatalogDataResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutRegistryCatalogDataResponse' :: PutRegistryCatalogDataResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutRegistryCatalogDataResponse
s@PutRegistryCatalogDataResponse' {} Int
a -> PutRegistryCatalogDataResponse
s {$sel:httpStatus:PutRegistryCatalogDataResponse' :: Int
httpStatus = Int
a} :: PutRegistryCatalogDataResponse)
putRegistryCatalogDataResponse_registryCatalogData :: Lens.Lens' PutRegistryCatalogDataResponse RegistryCatalogData
putRegistryCatalogDataResponse_registryCatalogData :: (RegistryCatalogData -> f RegistryCatalogData)
-> PutRegistryCatalogDataResponse
-> f PutRegistryCatalogDataResponse
putRegistryCatalogDataResponse_registryCatalogData = (PutRegistryCatalogDataResponse -> RegistryCatalogData)
-> (PutRegistryCatalogDataResponse
-> RegistryCatalogData -> PutRegistryCatalogDataResponse)
-> Lens
PutRegistryCatalogDataResponse
PutRegistryCatalogDataResponse
RegistryCatalogData
RegistryCatalogData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRegistryCatalogDataResponse' {RegistryCatalogData
registryCatalogData :: RegistryCatalogData
$sel:registryCatalogData:PutRegistryCatalogDataResponse' :: PutRegistryCatalogDataResponse -> RegistryCatalogData
registryCatalogData} -> RegistryCatalogData
registryCatalogData) (\s :: PutRegistryCatalogDataResponse
s@PutRegistryCatalogDataResponse' {} RegistryCatalogData
a -> PutRegistryCatalogDataResponse
s {$sel:registryCatalogData:PutRegistryCatalogDataResponse' :: RegistryCatalogData
registryCatalogData = RegistryCatalogData
a} :: PutRegistryCatalogDataResponse)
instance
Prelude.NFData
PutRegistryCatalogDataResponse