{-# 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.CodeArtifact.Types.RepositorySummary
-- 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.CodeArtifact.Types.RepositorySummary 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

-- | Details about a repository, including its Amazon Resource Name (ARN),
-- description, and domain information. The
-- <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListRepositories.html ListRepositories>
-- operation returns a list of @RepositorySummary@ objects.
--
-- /See:/ 'newRepositorySummary' smart constructor.
data RepositorySummary = RepositorySummary'
  { -- | The Amazon Web Services account ID that manages the repository.
    RepositorySummary -> Maybe Text
administratorAccount :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the repository.
    RepositorySummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The description of the repository.
    RepositorySummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the domain that contains the repository.
    RepositorySummary -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The 12-digit account number of the Amazon Web Services account that owns
    -- the domain. It does not include dashes or spaces.
    RepositorySummary -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository.
    RepositorySummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (RepositorySummary -> RepositorySummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositorySummary -> RepositorySummary -> Bool
$c/= :: RepositorySummary -> RepositorySummary -> Bool
== :: RepositorySummary -> RepositorySummary -> Bool
$c== :: RepositorySummary -> RepositorySummary -> Bool
Prelude.Eq, ReadPrec [RepositorySummary]
ReadPrec RepositorySummary
Int -> ReadS RepositorySummary
ReadS [RepositorySummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositorySummary]
$creadListPrec :: ReadPrec [RepositorySummary]
readPrec :: ReadPrec RepositorySummary
$creadPrec :: ReadPrec RepositorySummary
readList :: ReadS [RepositorySummary]
$creadList :: ReadS [RepositorySummary]
readsPrec :: Int -> ReadS RepositorySummary
$creadsPrec :: Int -> ReadS RepositorySummary
Prelude.Read, Int -> RepositorySummary -> ShowS
[RepositorySummary] -> ShowS
RepositorySummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositorySummary] -> ShowS
$cshowList :: [RepositorySummary] -> ShowS
show :: RepositorySummary -> String
$cshow :: RepositorySummary -> String
showsPrec :: Int -> RepositorySummary -> ShowS
$cshowsPrec :: Int -> RepositorySummary -> ShowS
Prelude.Show, forall x. Rep RepositorySummary x -> RepositorySummary
forall x. RepositorySummary -> Rep RepositorySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RepositorySummary x -> RepositorySummary
$cfrom :: forall x. RepositorySummary -> Rep RepositorySummary x
Prelude.Generic)

-- |
-- Create a value of 'RepositorySummary' 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:
--
-- 'administratorAccount', 'repositorySummary_administratorAccount' - The Amazon Web Services account ID that manages the repository.
--
-- 'arn', 'repositorySummary_arn' - The ARN of the repository.
--
-- 'description', 'repositorySummary_description' - The description of the repository.
--
-- 'domainName', 'repositorySummary_domainName' - The name of the domain that contains the repository.
--
-- 'domainOwner', 'repositorySummary_domainOwner' - The 12-digit account number of the Amazon Web Services account that owns
-- the domain. It does not include dashes or spaces.
--
-- 'name', 'repositorySummary_name' - The name of the repository.
newRepositorySummary ::
  RepositorySummary
newRepositorySummary :: RepositorySummary
newRepositorySummary =
  RepositorySummary'
    { $sel:administratorAccount:RepositorySummary' :: Maybe Text
administratorAccount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:arn:RepositorySummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:RepositorySummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:RepositorySummary' :: Maybe Text
domainName = forall a. Maybe a
Prelude.Nothing,
      $sel:domainOwner:RepositorySummary' :: Maybe Text
domainOwner = forall a. Maybe a
Prelude.Nothing,
      $sel:name:RepositorySummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Web Services account ID that manages the repository.
repositorySummary_administratorAccount :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_administratorAccount :: Lens' RepositorySummary (Maybe Text)
repositorySummary_administratorAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositorySummary' {Maybe Text
administratorAccount :: Maybe Text
$sel:administratorAccount:RepositorySummary' :: RepositorySummary -> Maybe Text
administratorAccount} -> Maybe Text
administratorAccount) (\s :: RepositorySummary
s@RepositorySummary' {} Maybe Text
a -> RepositorySummary
s {$sel:administratorAccount:RepositorySummary' :: Maybe Text
administratorAccount = Maybe Text
a} :: RepositorySummary)

-- | The ARN of the repository.
repositorySummary_arn :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_arn :: Lens' RepositorySummary (Maybe Text)
repositorySummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositorySummary' {Maybe Text
arn :: Maybe Text
$sel:arn:RepositorySummary' :: RepositorySummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: RepositorySummary
s@RepositorySummary' {} Maybe Text
a -> RepositorySummary
s {$sel:arn:RepositorySummary' :: Maybe Text
arn = Maybe Text
a} :: RepositorySummary)

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

-- | The name of the domain that contains the repository.
repositorySummary_domainName :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_domainName :: Lens' RepositorySummary (Maybe Text)
repositorySummary_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositorySummary' {Maybe Text
domainName :: Maybe Text
$sel:domainName:RepositorySummary' :: RepositorySummary -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: RepositorySummary
s@RepositorySummary' {} Maybe Text
a -> RepositorySummary
s {$sel:domainName:RepositorySummary' :: Maybe Text
domainName = Maybe Text
a} :: RepositorySummary)

-- | The 12-digit account number of the Amazon Web Services account that owns
-- the domain. It does not include dashes or spaces.
repositorySummary_domainOwner :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_domainOwner :: Lens' RepositorySummary (Maybe Text)
repositorySummary_domainOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositorySummary' {Maybe Text
domainOwner :: Maybe Text
$sel:domainOwner:RepositorySummary' :: RepositorySummary -> Maybe Text
domainOwner} -> Maybe Text
domainOwner) (\s :: RepositorySummary
s@RepositorySummary' {} Maybe Text
a -> RepositorySummary
s {$sel:domainOwner:RepositorySummary' :: Maybe Text
domainOwner = Maybe Text
a} :: RepositorySummary)

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

instance Data.FromJSON RepositorySummary where
  parseJSON :: Value -> Parser RepositorySummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RepositorySummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RepositorySummary
RepositorySummary'
            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
"administratorAccount")
            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
"arn")
            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
"domainName")
            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
"domainOwner")
            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
"name")
      )

instance Prelude.Hashable RepositorySummary where
  hashWithSalt :: Int -> RepositorySummary -> Int
hashWithSalt Int
_salt RepositorySummary' {Maybe Text
name :: Maybe Text
domainOwner :: Maybe Text
domainName :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
administratorAccount :: Maybe Text
$sel:name:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:domainOwner:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:domainName:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:description:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:arn:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:administratorAccount:RepositorySummary' :: RepositorySummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
administratorAccount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainOwner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData RepositorySummary where
  rnf :: RepositorySummary -> ()
rnf RepositorySummary' {Maybe Text
name :: Maybe Text
domainOwner :: Maybe Text
domainName :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
administratorAccount :: Maybe Text
$sel:name:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:domainOwner:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:domainName:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:description:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:arn:RepositorySummary' :: RepositorySummary -> Maybe Text
$sel:administratorAccount:RepositorySummary' :: RepositorySummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
administratorAccount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      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
domainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainOwner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name