{-# 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.RepositoryCatalogData
-- 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.ECRPublic.Types.RepositoryCatalogData 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

-- | The catalog data for a repository. This data is publicly visible in the
-- Amazon ECR Public Gallery.
--
-- /See:/ 'newRepositoryCatalogData' smart constructor.
data RepositoryCatalogData = RepositoryCatalogData'
  { -- | The longform description of the contents of the repository. This text
    -- appears in the repository details on the Amazon ECR Public Gallery.
    RepositoryCatalogData -> Maybe Text
aboutText :: Prelude.Maybe Prelude.Text,
    -- | The architecture tags that are associated with the repository.
    --
    -- Only supported operating system tags appear publicly in the Amazon ECR
    -- Public Gallery. For more information, see RepositoryCatalogDataInput.
    RepositoryCatalogData -> Maybe [Text]
architectures :: Prelude.Maybe [Prelude.Text],
    -- | The short description of the repository.
    RepositoryCatalogData -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The URL containing the logo associated with the repository.
    RepositoryCatalogData -> Maybe Text
logoUrl :: Prelude.Maybe Prelude.Text,
    -- | Whether or not the repository is certified by AWS Marketplace.
    RepositoryCatalogData -> Maybe Bool
marketplaceCertified :: Prelude.Maybe Prelude.Bool,
    -- | The operating system tags that are associated with the repository.
    --
    -- Only supported operating system tags appear publicly in the Amazon ECR
    -- Public Gallery. For more information, see RepositoryCatalogDataInput.
    RepositoryCatalogData -> Maybe [Text]
operatingSystems :: Prelude.Maybe [Prelude.Text],
    -- | The longform usage details of the contents of the repository. The usage
    -- text provides context for users of the repository.
    RepositoryCatalogData -> Maybe Text
usageText :: Prelude.Maybe Prelude.Text
  }
  deriving (RepositoryCatalogData -> RepositoryCatalogData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositoryCatalogData -> RepositoryCatalogData -> Bool
$c/= :: RepositoryCatalogData -> RepositoryCatalogData -> Bool
== :: RepositoryCatalogData -> RepositoryCatalogData -> Bool
$c== :: RepositoryCatalogData -> RepositoryCatalogData -> Bool
Prelude.Eq, ReadPrec [RepositoryCatalogData]
ReadPrec RepositoryCatalogData
Int -> ReadS RepositoryCatalogData
ReadS [RepositoryCatalogData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositoryCatalogData]
$creadListPrec :: ReadPrec [RepositoryCatalogData]
readPrec :: ReadPrec RepositoryCatalogData
$creadPrec :: ReadPrec RepositoryCatalogData
readList :: ReadS [RepositoryCatalogData]
$creadList :: ReadS [RepositoryCatalogData]
readsPrec :: Int -> ReadS RepositoryCatalogData
$creadsPrec :: Int -> ReadS RepositoryCatalogData
Prelude.Read, Int -> RepositoryCatalogData -> ShowS
[RepositoryCatalogData] -> ShowS
RepositoryCatalogData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositoryCatalogData] -> ShowS
$cshowList :: [RepositoryCatalogData] -> ShowS
show :: RepositoryCatalogData -> String
$cshow :: RepositoryCatalogData -> String
showsPrec :: Int -> RepositoryCatalogData -> ShowS
$cshowsPrec :: Int -> RepositoryCatalogData -> ShowS
Prelude.Show, forall x. Rep RepositoryCatalogData x -> RepositoryCatalogData
forall x. RepositoryCatalogData -> Rep RepositoryCatalogData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RepositoryCatalogData x -> RepositoryCatalogData
$cfrom :: forall x. RepositoryCatalogData -> Rep RepositoryCatalogData x
Prelude.Generic)

-- |
-- Create a value of 'RepositoryCatalogData' 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:
--
-- 'aboutText', 'repositoryCatalogData_aboutText' - The longform description of the contents of the repository. This text
-- appears in the repository details on the Amazon ECR Public Gallery.
--
-- 'architectures', 'repositoryCatalogData_architectures' - The architecture tags that are associated with the repository.
--
-- Only supported operating system tags appear publicly in the Amazon ECR
-- Public Gallery. For more information, see RepositoryCatalogDataInput.
--
-- 'description', 'repositoryCatalogData_description' - The short description of the repository.
--
-- 'logoUrl', 'repositoryCatalogData_logoUrl' - The URL containing the logo associated with the repository.
--
-- 'marketplaceCertified', 'repositoryCatalogData_marketplaceCertified' - Whether or not the repository is certified by AWS Marketplace.
--
-- 'operatingSystems', 'repositoryCatalogData_operatingSystems' - The operating system tags that are associated with the repository.
--
-- Only supported operating system tags appear publicly in the Amazon ECR
-- Public Gallery. For more information, see RepositoryCatalogDataInput.
--
-- 'usageText', 'repositoryCatalogData_usageText' - The longform usage details of the contents of the repository. The usage
-- text provides context for users of the repository.
newRepositoryCatalogData ::
  RepositoryCatalogData
newRepositoryCatalogData :: RepositoryCatalogData
newRepositoryCatalogData =
  RepositoryCatalogData'
    { $sel:aboutText:RepositoryCatalogData' :: Maybe Text
aboutText = forall a. Maybe a
Prelude.Nothing,
      $sel:architectures:RepositoryCatalogData' :: Maybe [Text]
architectures = forall a. Maybe a
Prelude.Nothing,
      $sel:description:RepositoryCatalogData' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:logoUrl:RepositoryCatalogData' :: Maybe Text
logoUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:marketplaceCertified:RepositoryCatalogData' :: Maybe Bool
marketplaceCertified = forall a. Maybe a
Prelude.Nothing,
      $sel:operatingSystems:RepositoryCatalogData' :: Maybe [Text]
operatingSystems = forall a. Maybe a
Prelude.Nothing,
      $sel:usageText:RepositoryCatalogData' :: Maybe Text
usageText = forall a. Maybe a
Prelude.Nothing
    }

-- | The longform description of the contents of the repository. This text
-- appears in the repository details on the Amazon ECR Public Gallery.
repositoryCatalogData_aboutText :: Lens.Lens' RepositoryCatalogData (Prelude.Maybe Prelude.Text)
repositoryCatalogData_aboutText :: Lens' RepositoryCatalogData (Maybe Text)
repositoryCatalogData_aboutText = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryCatalogData' {Maybe Text
aboutText :: Maybe Text
$sel:aboutText:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
aboutText} -> Maybe Text
aboutText) (\s :: RepositoryCatalogData
s@RepositoryCatalogData' {} Maybe Text
a -> RepositoryCatalogData
s {$sel:aboutText:RepositoryCatalogData' :: Maybe Text
aboutText = Maybe Text
a} :: RepositoryCatalogData)

-- | The architecture tags that are associated with the repository.
--
-- Only supported operating system tags appear publicly in the Amazon ECR
-- Public Gallery. For more information, see RepositoryCatalogDataInput.
repositoryCatalogData_architectures :: Lens.Lens' RepositoryCatalogData (Prelude.Maybe [Prelude.Text])
repositoryCatalogData_architectures :: Lens' RepositoryCatalogData (Maybe [Text])
repositoryCatalogData_architectures = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryCatalogData' {Maybe [Text]
architectures :: Maybe [Text]
$sel:architectures:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe [Text]
architectures} -> Maybe [Text]
architectures) (\s :: RepositoryCatalogData
s@RepositoryCatalogData' {} Maybe [Text]
a -> RepositoryCatalogData
s {$sel:architectures:RepositoryCatalogData' :: Maybe [Text]
architectures = Maybe [Text]
a} :: RepositoryCatalogData) 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

-- | The short description of the repository.
repositoryCatalogData_description :: Lens.Lens' RepositoryCatalogData (Prelude.Maybe Prelude.Text)
repositoryCatalogData_description :: Lens' RepositoryCatalogData (Maybe Text)
repositoryCatalogData_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryCatalogData' {Maybe Text
description :: Maybe Text
$sel:description:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
description} -> Maybe Text
description) (\s :: RepositoryCatalogData
s@RepositoryCatalogData' {} Maybe Text
a -> RepositoryCatalogData
s {$sel:description:RepositoryCatalogData' :: Maybe Text
description = Maybe Text
a} :: RepositoryCatalogData)

-- | The URL containing the logo associated with the repository.
repositoryCatalogData_logoUrl :: Lens.Lens' RepositoryCatalogData (Prelude.Maybe Prelude.Text)
repositoryCatalogData_logoUrl :: Lens' RepositoryCatalogData (Maybe Text)
repositoryCatalogData_logoUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryCatalogData' {Maybe Text
logoUrl :: Maybe Text
$sel:logoUrl:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
logoUrl} -> Maybe Text
logoUrl) (\s :: RepositoryCatalogData
s@RepositoryCatalogData' {} Maybe Text
a -> RepositoryCatalogData
s {$sel:logoUrl:RepositoryCatalogData' :: Maybe Text
logoUrl = Maybe Text
a} :: RepositoryCatalogData)

-- | Whether or not the repository is certified by AWS Marketplace.
repositoryCatalogData_marketplaceCertified :: Lens.Lens' RepositoryCatalogData (Prelude.Maybe Prelude.Bool)
repositoryCatalogData_marketplaceCertified :: Lens' RepositoryCatalogData (Maybe Bool)
repositoryCatalogData_marketplaceCertified = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryCatalogData' {Maybe Bool
marketplaceCertified :: Maybe Bool
$sel:marketplaceCertified:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Bool
marketplaceCertified} -> Maybe Bool
marketplaceCertified) (\s :: RepositoryCatalogData
s@RepositoryCatalogData' {} Maybe Bool
a -> RepositoryCatalogData
s {$sel:marketplaceCertified:RepositoryCatalogData' :: Maybe Bool
marketplaceCertified = Maybe Bool
a} :: RepositoryCatalogData)

-- | The operating system tags that are associated with the repository.
--
-- Only supported operating system tags appear publicly in the Amazon ECR
-- Public Gallery. For more information, see RepositoryCatalogDataInput.
repositoryCatalogData_operatingSystems :: Lens.Lens' RepositoryCatalogData (Prelude.Maybe [Prelude.Text])
repositoryCatalogData_operatingSystems :: Lens' RepositoryCatalogData (Maybe [Text])
repositoryCatalogData_operatingSystems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryCatalogData' {Maybe [Text]
operatingSystems :: Maybe [Text]
$sel:operatingSystems:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe [Text]
operatingSystems} -> Maybe [Text]
operatingSystems) (\s :: RepositoryCatalogData
s@RepositoryCatalogData' {} Maybe [Text]
a -> RepositoryCatalogData
s {$sel:operatingSystems:RepositoryCatalogData' :: Maybe [Text]
operatingSystems = Maybe [Text]
a} :: RepositoryCatalogData) 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

-- | The longform usage details of the contents of the repository. The usage
-- text provides context for users of the repository.
repositoryCatalogData_usageText :: Lens.Lens' RepositoryCatalogData (Prelude.Maybe Prelude.Text)
repositoryCatalogData_usageText :: Lens' RepositoryCatalogData (Maybe Text)
repositoryCatalogData_usageText = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryCatalogData' {Maybe Text
usageText :: Maybe Text
$sel:usageText:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
usageText} -> Maybe Text
usageText) (\s :: RepositoryCatalogData
s@RepositoryCatalogData' {} Maybe Text
a -> RepositoryCatalogData
s {$sel:usageText:RepositoryCatalogData' :: Maybe Text
usageText = Maybe Text
a} :: RepositoryCatalogData)

instance Data.FromJSON RepositoryCatalogData where
  parseJSON :: Value -> Parser RepositoryCatalogData
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RepositoryCatalogData"
      ( \Object
x ->
          Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> RepositoryCatalogData
RepositoryCatalogData'
            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
"aboutText")
            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
"architectures" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"description")
            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
"logoUrl")
            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
"marketplaceCertified")
            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
"operatingSystems"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"usageText")
      )

instance Prelude.Hashable RepositoryCatalogData where
  hashWithSalt :: Int -> RepositoryCatalogData -> Int
hashWithSalt Int
_salt RepositoryCatalogData' {Maybe Bool
Maybe [Text]
Maybe Text
usageText :: Maybe Text
operatingSystems :: Maybe [Text]
marketplaceCertified :: Maybe Bool
logoUrl :: Maybe Text
description :: Maybe Text
architectures :: Maybe [Text]
aboutText :: Maybe Text
$sel:usageText:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
$sel:operatingSystems:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe [Text]
$sel:marketplaceCertified:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Bool
$sel:logoUrl:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
$sel:description:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
$sel:architectures:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe [Text]
$sel:aboutText:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aboutText
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
architectures
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logoUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
marketplaceCertified
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
operatingSystems
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
usageText

instance Prelude.NFData RepositoryCatalogData where
  rnf :: RepositoryCatalogData -> ()
rnf RepositoryCatalogData' {Maybe Bool
Maybe [Text]
Maybe Text
usageText :: Maybe Text
operatingSystems :: Maybe [Text]
marketplaceCertified :: Maybe Bool
logoUrl :: Maybe Text
description :: Maybe Text
architectures :: Maybe [Text]
aboutText :: Maybe Text
$sel:usageText:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
$sel:operatingSystems:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe [Text]
$sel:marketplaceCertified:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Bool
$sel:logoUrl:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
$sel:description:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
$sel:architectures:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe [Text]
$sel:aboutText:RepositoryCatalogData' :: RepositoryCatalogData -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aboutText
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
architectures
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logoUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
marketplaceCertified
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
operatingSystems
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
usageText