{-# 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.Schemas.Types.RegistrySummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Schemas.Types.RegistrySummary where

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

-- | /See:/ 'newRegistrySummary' smart constructor.
data RegistrySummary = RegistrySummary'
  { -- | The ARN of the registry.
    RegistrySummary -> Maybe Text
registryArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the registry.
    RegistrySummary -> Maybe Text
registryName :: Prelude.Maybe Prelude.Text,
    -- | Tags associated with the registry.
    RegistrySummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (RegistrySummary -> RegistrySummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegistrySummary -> RegistrySummary -> Bool
$c/= :: RegistrySummary -> RegistrySummary -> Bool
== :: RegistrySummary -> RegistrySummary -> Bool
$c== :: RegistrySummary -> RegistrySummary -> Bool
Prelude.Eq, ReadPrec [RegistrySummary]
ReadPrec RegistrySummary
Int -> ReadS RegistrySummary
ReadS [RegistrySummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegistrySummary]
$creadListPrec :: ReadPrec [RegistrySummary]
readPrec :: ReadPrec RegistrySummary
$creadPrec :: ReadPrec RegistrySummary
readList :: ReadS [RegistrySummary]
$creadList :: ReadS [RegistrySummary]
readsPrec :: Int -> ReadS RegistrySummary
$creadsPrec :: Int -> ReadS RegistrySummary
Prelude.Read, Int -> RegistrySummary -> ShowS
[RegistrySummary] -> ShowS
RegistrySummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegistrySummary] -> ShowS
$cshowList :: [RegistrySummary] -> ShowS
show :: RegistrySummary -> String
$cshow :: RegistrySummary -> String
showsPrec :: Int -> RegistrySummary -> ShowS
$cshowsPrec :: Int -> RegistrySummary -> ShowS
Prelude.Show, forall x. Rep RegistrySummary x -> RegistrySummary
forall x. RegistrySummary -> Rep RegistrySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegistrySummary x -> RegistrySummary
$cfrom :: forall x. RegistrySummary -> Rep RegistrySummary x
Prelude.Generic)

-- |
-- Create a value of 'RegistrySummary' 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:
--
-- 'registryArn', 'registrySummary_registryArn' - The ARN of the registry.
--
-- 'registryName', 'registrySummary_registryName' - The name of the registry.
--
-- 'tags', 'registrySummary_tags' - Tags associated with the registry.
newRegistrySummary ::
  RegistrySummary
newRegistrySummary :: RegistrySummary
newRegistrySummary =
  RegistrySummary'
    { $sel:registryArn:RegistrySummary' :: Maybe Text
registryArn = forall a. Maybe a
Prelude.Nothing,
      $sel:registryName:RegistrySummary' :: Maybe Text
registryName = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:RegistrySummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the registry.
registrySummary_registryArn :: Lens.Lens' RegistrySummary (Prelude.Maybe Prelude.Text)
registrySummary_registryArn :: Lens' RegistrySummary (Maybe Text)
registrySummary_registryArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegistrySummary' {Maybe Text
registryArn :: Maybe Text
$sel:registryArn:RegistrySummary' :: RegistrySummary -> Maybe Text
registryArn} -> Maybe Text
registryArn) (\s :: RegistrySummary
s@RegistrySummary' {} Maybe Text
a -> RegistrySummary
s {$sel:registryArn:RegistrySummary' :: Maybe Text
registryArn = Maybe Text
a} :: RegistrySummary)

-- | The name of the registry.
registrySummary_registryName :: Lens.Lens' RegistrySummary (Prelude.Maybe Prelude.Text)
registrySummary_registryName :: Lens' RegistrySummary (Maybe Text)
registrySummary_registryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegistrySummary' {Maybe Text
registryName :: Maybe Text
$sel:registryName:RegistrySummary' :: RegistrySummary -> Maybe Text
registryName} -> Maybe Text
registryName) (\s :: RegistrySummary
s@RegistrySummary' {} Maybe Text
a -> RegistrySummary
s {$sel:registryName:RegistrySummary' :: Maybe Text
registryName = Maybe Text
a} :: RegistrySummary)

-- | Tags associated with the registry.
registrySummary_tags :: Lens.Lens' RegistrySummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
registrySummary_tags :: Lens' RegistrySummary (Maybe (HashMap Text Text))
registrySummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegistrySummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:RegistrySummary' :: RegistrySummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: RegistrySummary
s@RegistrySummary' {} Maybe (HashMap Text Text)
a -> RegistrySummary
s {$sel:tags:RegistrySummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: RegistrySummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON RegistrySummary where
  parseJSON :: Value -> Parser RegistrySummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RegistrySummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe (HashMap Text Text) -> RegistrySummary
RegistrySummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RegistryArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RegistryName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable RegistrySummary where
  hashWithSalt :: Int -> RegistrySummary -> Int
hashWithSalt Int
_salt RegistrySummary' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
registryName :: Maybe Text
registryArn :: Maybe Text
$sel:tags:RegistrySummary' :: RegistrySummary -> Maybe (HashMap Text Text)
$sel:registryName:RegistrySummary' :: RegistrySummary -> Maybe Text
$sel:registryArn:RegistrySummary' :: RegistrySummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
registryArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
registryName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData RegistrySummary where
  rnf :: RegistrySummary -> ()
rnf RegistrySummary' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
registryName :: Maybe Text
registryArn :: Maybe Text
$sel:tags:RegistrySummary' :: RegistrySummary -> Maybe (HashMap Text Text)
$sel:registryName:RegistrySummary' :: RegistrySummary -> Maybe Text
$sel:registryArn:RegistrySummary' :: RegistrySummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
registryArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
registryName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags