{-# 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.DescribeRegistry
(
DescribeRegistry (..),
newDescribeRegistry,
DescribeRegistryResponse (..),
newDescribeRegistryResponse,
describeRegistryResponse_replicationConfiguration,
describeRegistryResponse_registryId,
describeRegistryResponse_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 DescribeRegistry = DescribeRegistry'
{
}
deriving (DescribeRegistry -> DescribeRegistry -> Bool
(DescribeRegistry -> DescribeRegistry -> Bool)
-> (DescribeRegistry -> DescribeRegistry -> Bool)
-> Eq DescribeRegistry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRegistry -> DescribeRegistry -> Bool
$c/= :: DescribeRegistry -> DescribeRegistry -> Bool
== :: DescribeRegistry -> DescribeRegistry -> Bool
$c== :: DescribeRegistry -> DescribeRegistry -> Bool
Prelude.Eq, ReadPrec [DescribeRegistry]
ReadPrec DescribeRegistry
Int -> ReadS DescribeRegistry
ReadS [DescribeRegistry]
(Int -> ReadS DescribeRegistry)
-> ReadS [DescribeRegistry]
-> ReadPrec DescribeRegistry
-> ReadPrec [DescribeRegistry]
-> Read DescribeRegistry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRegistry]
$creadListPrec :: ReadPrec [DescribeRegistry]
readPrec :: ReadPrec DescribeRegistry
$creadPrec :: ReadPrec DescribeRegistry
readList :: ReadS [DescribeRegistry]
$creadList :: ReadS [DescribeRegistry]
readsPrec :: Int -> ReadS DescribeRegistry
$creadsPrec :: Int -> ReadS DescribeRegistry
Prelude.Read, Int -> DescribeRegistry -> ShowS
[DescribeRegistry] -> ShowS
DescribeRegistry -> String
(Int -> DescribeRegistry -> ShowS)
-> (DescribeRegistry -> String)
-> ([DescribeRegistry] -> ShowS)
-> Show DescribeRegistry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRegistry] -> ShowS
$cshowList :: [DescribeRegistry] -> ShowS
show :: DescribeRegistry -> String
$cshow :: DescribeRegistry -> String
showsPrec :: Int -> DescribeRegistry -> ShowS
$cshowsPrec :: Int -> DescribeRegistry -> ShowS
Prelude.Show, (forall x. DescribeRegistry -> Rep DescribeRegistry x)
-> (forall x. Rep DescribeRegistry x -> DescribeRegistry)
-> Generic DescribeRegistry
forall x. Rep DescribeRegistry x -> DescribeRegistry
forall x. DescribeRegistry -> Rep DescribeRegistry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRegistry x -> DescribeRegistry
$cfrom :: forall x. DescribeRegistry -> Rep DescribeRegistry x
Prelude.Generic)
newDescribeRegistry ::
DescribeRegistry
newDescribeRegistry :: DescribeRegistry
newDescribeRegistry = DescribeRegistry
DescribeRegistry'
instance Core.AWSRequest DescribeRegistry where
type
AWSResponse DescribeRegistry =
DescribeRegistryResponse
request :: DescribeRegistry -> Request DescribeRegistry
request = Service -> DescribeRegistry -> Request DescribeRegistry
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRegistry
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeRegistry)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRegistry))
-> Logger
-> Service
-> Proxy DescribeRegistry
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeRegistry)))
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
-> Maybe Text -> Int -> DescribeRegistryResponse
DescribeRegistryResponse'
(Maybe ReplicationConfiguration
-> Maybe Text -> Int -> DescribeRegistryResponse)
-> Either String (Maybe ReplicationConfiguration)
-> Either String (Maybe Text -> Int -> DescribeRegistryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ReplicationConfiguration)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"replicationConfiguration")
Either String (Maybe Text -> Int -> DescribeRegistryResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeRegistryResponse)
forall (f :: * -> *) a b. Applicative f => 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
"registryId")
Either String (Int -> DescribeRegistryResponse)
-> Either String Int -> Either String DescribeRegistryResponse
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 DescribeRegistry
instance Prelude.NFData DescribeRegistry
instance Core.ToHeaders DescribeRegistry where
toHeaders :: DescribeRegistry -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeRegistry -> 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.DescribeRegistry" ::
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 DescribeRegistry where
toJSON :: DescribeRegistry -> Value
toJSON = Value -> DescribeRegistry -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DescribeRegistry where
toPath :: DescribeRegistry -> ByteString
toPath = ByteString -> DescribeRegistry -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeRegistry where
toQuery :: DescribeRegistry -> QueryString
toQuery = QueryString -> DescribeRegistry -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeRegistryResponse = DescribeRegistryResponse'
{
DescribeRegistryResponse -> Maybe ReplicationConfiguration
replicationConfiguration :: Prelude.Maybe ReplicationConfiguration,
DescribeRegistryResponse -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
DescribeRegistryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRegistryResponse -> DescribeRegistryResponse -> Bool
(DescribeRegistryResponse -> DescribeRegistryResponse -> Bool)
-> (DescribeRegistryResponse -> DescribeRegistryResponse -> Bool)
-> Eq DescribeRegistryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRegistryResponse -> DescribeRegistryResponse -> Bool
$c/= :: DescribeRegistryResponse -> DescribeRegistryResponse -> Bool
== :: DescribeRegistryResponse -> DescribeRegistryResponse -> Bool
$c== :: DescribeRegistryResponse -> DescribeRegistryResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRegistryResponse]
ReadPrec DescribeRegistryResponse
Int -> ReadS DescribeRegistryResponse
ReadS [DescribeRegistryResponse]
(Int -> ReadS DescribeRegistryResponse)
-> ReadS [DescribeRegistryResponse]
-> ReadPrec DescribeRegistryResponse
-> ReadPrec [DescribeRegistryResponse]
-> Read DescribeRegistryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRegistryResponse]
$creadListPrec :: ReadPrec [DescribeRegistryResponse]
readPrec :: ReadPrec DescribeRegistryResponse
$creadPrec :: ReadPrec DescribeRegistryResponse
readList :: ReadS [DescribeRegistryResponse]
$creadList :: ReadS [DescribeRegistryResponse]
readsPrec :: Int -> ReadS DescribeRegistryResponse
$creadsPrec :: Int -> ReadS DescribeRegistryResponse
Prelude.Read, Int -> DescribeRegistryResponse -> ShowS
[DescribeRegistryResponse] -> ShowS
DescribeRegistryResponse -> String
(Int -> DescribeRegistryResponse -> ShowS)
-> (DescribeRegistryResponse -> String)
-> ([DescribeRegistryResponse] -> ShowS)
-> Show DescribeRegistryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRegistryResponse] -> ShowS
$cshowList :: [DescribeRegistryResponse] -> ShowS
show :: DescribeRegistryResponse -> String
$cshow :: DescribeRegistryResponse -> String
showsPrec :: Int -> DescribeRegistryResponse -> ShowS
$cshowsPrec :: Int -> DescribeRegistryResponse -> ShowS
Prelude.Show, (forall x.
DescribeRegistryResponse -> Rep DescribeRegistryResponse x)
-> (forall x.
Rep DescribeRegistryResponse x -> DescribeRegistryResponse)
-> Generic DescribeRegistryResponse
forall x.
Rep DescribeRegistryResponse x -> DescribeRegistryResponse
forall x.
DescribeRegistryResponse -> Rep DescribeRegistryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRegistryResponse x -> DescribeRegistryResponse
$cfrom :: forall x.
DescribeRegistryResponse -> Rep DescribeRegistryResponse x
Prelude.Generic)
newDescribeRegistryResponse ::
Prelude.Int ->
DescribeRegistryResponse
newDescribeRegistryResponse :: Int -> DescribeRegistryResponse
newDescribeRegistryResponse Int
pHttpStatus_ =
DescribeRegistryResponse' :: Maybe ReplicationConfiguration
-> Maybe Text -> Int -> DescribeRegistryResponse
DescribeRegistryResponse'
{ $sel:replicationConfiguration:DescribeRegistryResponse' :: Maybe ReplicationConfiguration
replicationConfiguration =
Maybe ReplicationConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:registryId:DescribeRegistryResponse' :: Maybe Text
registryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRegistryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRegistryResponse_replicationConfiguration :: Lens.Lens' DescribeRegistryResponse (Prelude.Maybe ReplicationConfiguration)
describeRegistryResponse_replicationConfiguration :: (Maybe ReplicationConfiguration
-> f (Maybe ReplicationConfiguration))
-> DescribeRegistryResponse -> f DescribeRegistryResponse
describeRegistryResponse_replicationConfiguration = (DescribeRegistryResponse -> Maybe ReplicationConfiguration)
-> (DescribeRegistryResponse
-> Maybe ReplicationConfiguration -> DescribeRegistryResponse)
-> Lens
DescribeRegistryResponse
DescribeRegistryResponse
(Maybe ReplicationConfiguration)
(Maybe ReplicationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRegistryResponse' {Maybe ReplicationConfiguration
replicationConfiguration :: Maybe ReplicationConfiguration
$sel:replicationConfiguration:DescribeRegistryResponse' :: DescribeRegistryResponse -> Maybe ReplicationConfiguration
replicationConfiguration} -> Maybe ReplicationConfiguration
replicationConfiguration) (\s :: DescribeRegistryResponse
s@DescribeRegistryResponse' {} Maybe ReplicationConfiguration
a -> DescribeRegistryResponse
s {$sel:replicationConfiguration:DescribeRegistryResponse' :: Maybe ReplicationConfiguration
replicationConfiguration = Maybe ReplicationConfiguration
a} :: DescribeRegistryResponse)
describeRegistryResponse_registryId :: Lens.Lens' DescribeRegistryResponse (Prelude.Maybe Prelude.Text)
describeRegistryResponse_registryId :: (Maybe Text -> f (Maybe Text))
-> DescribeRegistryResponse -> f DescribeRegistryResponse
describeRegistryResponse_registryId = (DescribeRegistryResponse -> Maybe Text)
-> (DescribeRegistryResponse
-> Maybe Text -> DescribeRegistryResponse)
-> Lens
DescribeRegistryResponse
DescribeRegistryResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRegistryResponse' {Maybe Text
registryId :: Maybe Text
$sel:registryId:DescribeRegistryResponse' :: DescribeRegistryResponse -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: DescribeRegistryResponse
s@DescribeRegistryResponse' {} Maybe Text
a -> DescribeRegistryResponse
s {$sel:registryId:DescribeRegistryResponse' :: Maybe Text
registryId = Maybe Text
a} :: DescribeRegistryResponse)
describeRegistryResponse_httpStatus :: Lens.Lens' DescribeRegistryResponse Prelude.Int
describeRegistryResponse_httpStatus :: (Int -> f Int)
-> DescribeRegistryResponse -> f DescribeRegistryResponse
describeRegistryResponse_httpStatus = (DescribeRegistryResponse -> Int)
-> (DescribeRegistryResponse -> Int -> DescribeRegistryResponse)
-> Lens DescribeRegistryResponse DescribeRegistryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRegistryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRegistryResponse' :: DescribeRegistryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRegistryResponse
s@DescribeRegistryResponse' {} Int
a -> DescribeRegistryResponse
s {$sel:httpStatus:DescribeRegistryResponse' :: Int
httpStatus = Int
a} :: DescribeRegistryResponse)
instance Prelude.NFData DescribeRegistryResponse