{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ECRPublic.Types.Registry where
import qualified Amazonka.Core as Core
import Amazonka.ECRPublic.Types.RegistryAlias
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Registry = Registry'
{
Registry -> Text
registryId :: Prelude.Text,
Registry -> Text
registryArn :: Prelude.Text,
Registry -> Text
registryUri :: Prelude.Text,
Registry -> Bool
verified :: Prelude.Bool,
Registry -> [RegistryAlias]
aliases :: [RegistryAlias]
}
deriving (Registry -> Registry -> Bool
(Registry -> Registry -> Bool)
-> (Registry -> Registry -> Bool) -> Eq Registry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Registry -> Registry -> Bool
$c/= :: Registry -> Registry -> Bool
== :: Registry -> Registry -> Bool
$c== :: Registry -> Registry -> Bool
Prelude.Eq, ReadPrec [Registry]
ReadPrec Registry
Int -> ReadS Registry
ReadS [Registry]
(Int -> ReadS Registry)
-> ReadS [Registry]
-> ReadPrec Registry
-> ReadPrec [Registry]
-> Read Registry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Registry]
$creadListPrec :: ReadPrec [Registry]
readPrec :: ReadPrec Registry
$creadPrec :: ReadPrec Registry
readList :: ReadS [Registry]
$creadList :: ReadS [Registry]
readsPrec :: Int -> ReadS Registry
$creadsPrec :: Int -> ReadS Registry
Prelude.Read, Int -> Registry -> ShowS
[Registry] -> ShowS
Registry -> String
(Int -> Registry -> ShowS)
-> (Registry -> String) -> ([Registry] -> ShowS) -> Show Registry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Registry] -> ShowS
$cshowList :: [Registry] -> ShowS
show :: Registry -> String
$cshow :: Registry -> String
showsPrec :: Int -> Registry -> ShowS
$cshowsPrec :: Int -> Registry -> ShowS
Prelude.Show, (forall x. Registry -> Rep Registry x)
-> (forall x. Rep Registry x -> Registry) -> Generic Registry
forall x. Rep Registry x -> Registry
forall x. Registry -> Rep Registry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Registry x -> Registry
$cfrom :: forall x. Registry -> Rep Registry x
Prelude.Generic)
newRegistry ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Bool ->
Registry
newRegistry :: Text -> Text -> Text -> Bool -> Registry
newRegistry
Text
pRegistryId_
Text
pRegistryArn_
Text
pRegistryUri_
Bool
pVerified_ =
Registry' :: Text -> Text -> Text -> Bool -> [RegistryAlias] -> Registry
Registry'
{ $sel:registryId:Registry' :: Text
registryId = Text
pRegistryId_,
$sel:registryArn:Registry' :: Text
registryArn = Text
pRegistryArn_,
$sel:registryUri:Registry' :: Text
registryUri = Text
pRegistryUri_,
$sel:verified:Registry' :: Bool
verified = Bool
pVerified_,
$sel:aliases:Registry' :: [RegistryAlias]
aliases = [RegistryAlias]
forall a. Monoid a => a
Prelude.mempty
}
registry_registryId :: Lens.Lens' Registry Prelude.Text
registry_registryId :: (Text -> f Text) -> Registry -> f Registry
registry_registryId = (Registry -> Text)
-> (Registry -> Text -> Registry)
-> Lens Registry Registry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Registry' {Text
registryId :: Text
$sel:registryId:Registry' :: Registry -> Text
registryId} -> Text
registryId) (\s :: Registry
s@Registry' {} Text
a -> Registry
s {$sel:registryId:Registry' :: Text
registryId = Text
a} :: Registry)
registry_registryArn :: Lens.Lens' Registry Prelude.Text
registry_registryArn :: (Text -> f Text) -> Registry -> f Registry
registry_registryArn = (Registry -> Text)
-> (Registry -> Text -> Registry)
-> Lens Registry Registry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Registry' {Text
registryArn :: Text
$sel:registryArn:Registry' :: Registry -> Text
registryArn} -> Text
registryArn) (\s :: Registry
s@Registry' {} Text
a -> Registry
s {$sel:registryArn:Registry' :: Text
registryArn = Text
a} :: Registry)
registry_registryUri :: Lens.Lens' Registry Prelude.Text
registry_registryUri :: (Text -> f Text) -> Registry -> f Registry
registry_registryUri = (Registry -> Text)
-> (Registry -> Text -> Registry)
-> Lens Registry Registry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Registry' {Text
registryUri :: Text
$sel:registryUri:Registry' :: Registry -> Text
registryUri} -> Text
registryUri) (\s :: Registry
s@Registry' {} Text
a -> Registry
s {$sel:registryUri:Registry' :: Text
registryUri = Text
a} :: Registry)
registry_verified :: Lens.Lens' Registry Prelude.Bool
registry_verified :: (Bool -> f Bool) -> Registry -> f Registry
registry_verified = (Registry -> Bool)
-> (Registry -> Bool -> Registry)
-> Lens Registry Registry Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Registry' {Bool
verified :: Bool
$sel:verified:Registry' :: Registry -> Bool
verified} -> Bool
verified) (\s :: Registry
s@Registry' {} Bool
a -> Registry
s {$sel:verified:Registry' :: Bool
verified = Bool
a} :: Registry)
registry_aliases :: Lens.Lens' Registry [RegistryAlias]
registry_aliases :: ([RegistryAlias] -> f [RegistryAlias]) -> Registry -> f Registry
registry_aliases = (Registry -> [RegistryAlias])
-> (Registry -> [RegistryAlias] -> Registry)
-> Lens Registry Registry [RegistryAlias] [RegistryAlias]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Registry' {[RegistryAlias]
aliases :: [RegistryAlias]
$sel:aliases:Registry' :: Registry -> [RegistryAlias]
aliases} -> [RegistryAlias]
aliases) (\s :: Registry
s@Registry' {} [RegistryAlias]
a -> Registry
s {$sel:aliases:Registry' :: [RegistryAlias]
aliases = [RegistryAlias]
a} :: Registry) (([RegistryAlias] -> f [RegistryAlias]) -> Registry -> f Registry)
-> (([RegistryAlias] -> f [RegistryAlias])
-> [RegistryAlias] -> f [RegistryAlias])
-> ([RegistryAlias] -> f [RegistryAlias])
-> Registry
-> f Registry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RegistryAlias] -> f [RegistryAlias])
-> [RegistryAlias] -> f [RegistryAlias]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Registry where
parseJSON :: Value -> Parser Registry
parseJSON =
String -> (Object -> Parser Registry) -> Value -> Parser Registry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Registry"
( \Object
x ->
Text -> Text -> Text -> Bool -> [RegistryAlias] -> Registry
Registry'
(Text -> Text -> Text -> Bool -> [RegistryAlias] -> Registry)
-> Parser Text
-> Parser (Text -> Text -> Bool -> [RegistryAlias] -> Registry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"registryId")
Parser (Text -> Text -> Bool -> [RegistryAlias] -> Registry)
-> Parser Text
-> Parser (Text -> Bool -> [RegistryAlias] -> Registry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"registryArn")
Parser (Text -> Bool -> [RegistryAlias] -> Registry)
-> Parser Text -> Parser (Bool -> [RegistryAlias] -> Registry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"registryUri")
Parser (Bool -> [RegistryAlias] -> Registry)
-> Parser Bool -> Parser ([RegistryAlias] -> Registry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"verified")
Parser ([RegistryAlias] -> Registry)
-> Parser [RegistryAlias] -> Parser Registry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [RegistryAlias])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"aliases" Parser (Maybe [RegistryAlias])
-> [RegistryAlias] -> Parser [RegistryAlias]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [RegistryAlias]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Registry
instance Prelude.NFData Registry