{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ECRPublic.Types.RegistryCatalogData
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ECRPublic.Types.RegistryCatalogData where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The metadata for a public registry.
--
-- /See:/ 'newRegistryCatalogData' smart constructor.
data RegistryCatalogData = RegistryCatalogData'
  { -- | The display name for a public registry. This appears on the Amazon ECR
    -- Public Gallery.
    --
    -- Only accounts that have the verified account badge can have a registry
    -- display name.
    RegistryCatalogData -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text
  }
  deriving (RegistryCatalogData -> RegistryCatalogData -> Bool
(RegistryCatalogData -> RegistryCatalogData -> Bool)
-> (RegistryCatalogData -> RegistryCatalogData -> Bool)
-> Eq RegistryCatalogData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegistryCatalogData -> RegistryCatalogData -> Bool
$c/= :: RegistryCatalogData -> RegistryCatalogData -> Bool
== :: RegistryCatalogData -> RegistryCatalogData -> Bool
$c== :: RegistryCatalogData -> RegistryCatalogData -> Bool
Prelude.Eq, ReadPrec [RegistryCatalogData]
ReadPrec RegistryCatalogData
Int -> ReadS RegistryCatalogData
ReadS [RegistryCatalogData]
(Int -> ReadS RegistryCatalogData)
-> ReadS [RegistryCatalogData]
-> ReadPrec RegistryCatalogData
-> ReadPrec [RegistryCatalogData]
-> Read RegistryCatalogData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegistryCatalogData]
$creadListPrec :: ReadPrec [RegistryCatalogData]
readPrec :: ReadPrec RegistryCatalogData
$creadPrec :: ReadPrec RegistryCatalogData
readList :: ReadS [RegistryCatalogData]
$creadList :: ReadS [RegistryCatalogData]
readsPrec :: Int -> ReadS RegistryCatalogData
$creadsPrec :: Int -> ReadS RegistryCatalogData
Prelude.Read, Int -> RegistryCatalogData -> ShowS
[RegistryCatalogData] -> ShowS
RegistryCatalogData -> String
(Int -> RegistryCatalogData -> ShowS)
-> (RegistryCatalogData -> String)
-> ([RegistryCatalogData] -> ShowS)
-> Show RegistryCatalogData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegistryCatalogData] -> ShowS
$cshowList :: [RegistryCatalogData] -> ShowS
show :: RegistryCatalogData -> String
$cshow :: RegistryCatalogData -> String
showsPrec :: Int -> RegistryCatalogData -> ShowS
$cshowsPrec :: Int -> RegistryCatalogData -> ShowS
Prelude.Show, (forall x. RegistryCatalogData -> Rep RegistryCatalogData x)
-> (forall x. Rep RegistryCatalogData x -> RegistryCatalogData)
-> Generic RegistryCatalogData
forall x. Rep RegistryCatalogData x -> RegistryCatalogData
forall x. RegistryCatalogData -> Rep RegistryCatalogData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegistryCatalogData x -> RegistryCatalogData
$cfrom :: forall x. RegistryCatalogData -> Rep RegistryCatalogData x
Prelude.Generic)

-- |
-- Create a value of 'RegistryCatalogData' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'displayName', 'registryCatalogData_displayName' - The display name for a public registry. This appears on the Amazon ECR
-- Public Gallery.
--
-- Only accounts that have the verified account badge can have a registry
-- display name.
newRegistryCatalogData ::
  RegistryCatalogData
newRegistryCatalogData :: RegistryCatalogData
newRegistryCatalogData =
  RegistryCatalogData' :: Maybe Text -> RegistryCatalogData
RegistryCatalogData' {$sel:displayName:RegistryCatalogData' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The display name for a public registry. This appears on the Amazon ECR
-- Public Gallery.
--
-- Only accounts that have the verified account badge can have a registry
-- display name.
registryCatalogData_displayName :: Lens.Lens' RegistryCatalogData (Prelude.Maybe Prelude.Text)
registryCatalogData_displayName :: (Maybe Text -> f (Maybe Text))
-> RegistryCatalogData -> f RegistryCatalogData
registryCatalogData_displayName = (RegistryCatalogData -> Maybe Text)
-> (RegistryCatalogData -> Maybe Text -> RegistryCatalogData)
-> Lens
     RegistryCatalogData RegistryCatalogData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegistryCatalogData' {Maybe Text
displayName :: Maybe Text
$sel:displayName:RegistryCatalogData' :: RegistryCatalogData -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: RegistryCatalogData
s@RegistryCatalogData' {} Maybe Text
a -> RegistryCatalogData
s {$sel:displayName:RegistryCatalogData' :: Maybe Text
displayName = Maybe Text
a} :: RegistryCatalogData)

instance Core.FromJSON RegistryCatalogData where
  parseJSON :: Value -> Parser RegistryCatalogData
parseJSON =
    String
-> (Object -> Parser RegistryCatalogData)
-> Value
-> Parser RegistryCatalogData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RegistryCatalogData"
      ( \Object
x ->
          Maybe Text -> RegistryCatalogData
RegistryCatalogData'
            (Maybe Text -> RegistryCatalogData)
-> Parser (Maybe Text) -> Parser RegistryCatalogData
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"displayName")
      )

instance Prelude.Hashable RegistryCatalogData

instance Prelude.NFData RegistryCatalogData