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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 ARN of the repository.
    RepositorySummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The 12-digit account number of the AWS account that owns the domain. It
    -- does not include dashes or spaces.
    RepositorySummary -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the domain that contains the repository.
    RepositorySummary -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository.
    RepositorySummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The AWS account ID that manages the repository.
    RepositorySummary -> Maybe Text
administratorAccount :: Prelude.Maybe Prelude.Text,
    -- | The description of the repository.
    RepositorySummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (RepositorySummary -> RepositorySummary -> Bool
(RepositorySummary -> RepositorySummary -> Bool)
-> (RepositorySummary -> RepositorySummary -> Bool)
-> Eq RepositorySummary
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]
(Int -> ReadS RepositorySummary)
-> ReadS [RepositorySummary]
-> ReadPrec RepositorySummary
-> ReadPrec [RepositorySummary]
-> Read 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
(Int -> RepositorySummary -> ShowS)
-> (RepositorySummary -> String)
-> ([RepositorySummary] -> ShowS)
-> Show RepositorySummary
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. RepositorySummary -> Rep RepositorySummary x)
-> (forall x. Rep RepositorySummary x -> RepositorySummary)
-> Generic RepositorySummary
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:
--
-- 'arn', 'repositorySummary_arn' - The ARN of the repository.
--
-- 'domainOwner', 'repositorySummary_domainOwner' - The 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
--
-- 'domainName', 'repositorySummary_domainName' - The name of the domain that contains the repository.
--
-- 'name', 'repositorySummary_name' - The name of the repository.
--
-- 'administratorAccount', 'repositorySummary_administratorAccount' - The AWS account ID that manages the repository.
--
-- 'description', 'repositorySummary_description' - The description of the repository.
newRepositorySummary ::
  RepositorySummary
newRepositorySummary :: RepositorySummary
newRepositorySummary =
  RepositorySummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RepositorySummary
RepositorySummary'
    { $sel:arn:RepositorySummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainOwner:RepositorySummary' :: Maybe Text
domainOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:RepositorySummary' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:RepositorySummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:administratorAccount:RepositorySummary' :: Maybe Text
administratorAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:RepositorySummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the repository.
repositorySummary_arn :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_arn :: (Maybe Text -> f (Maybe Text))
-> RepositorySummary -> f RepositorySummary
repositorySummary_arn = (RepositorySummary -> Maybe Text)
-> (RepositorySummary -> Maybe Text -> RepositorySummary)
-> Lens
     RepositorySummary RepositorySummary (Maybe Text) (Maybe Text)
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 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
repositorySummary_domainOwner :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_domainOwner :: (Maybe Text -> f (Maybe Text))
-> RepositorySummary -> f RepositorySummary
repositorySummary_domainOwner = (RepositorySummary -> Maybe Text)
-> (RepositorySummary -> Maybe Text -> RepositorySummary)
-> Lens
     RepositorySummary RepositorySummary (Maybe Text) (Maybe Text)
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 domain that contains the repository.
repositorySummary_domainName :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_domainName :: (Maybe Text -> f (Maybe Text))
-> RepositorySummary -> f RepositorySummary
repositorySummary_domainName = (RepositorySummary -> Maybe Text)
-> (RepositorySummary -> Maybe Text -> RepositorySummary)
-> Lens
     RepositorySummary RepositorySummary (Maybe Text) (Maybe Text)
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 name of the repository.
repositorySummary_name :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_name :: (Maybe Text -> f (Maybe Text))
-> RepositorySummary -> f RepositorySummary
repositorySummary_name = (RepositorySummary -> Maybe Text)
-> (RepositorySummary -> Maybe Text -> RepositorySummary)
-> Lens
     RepositorySummary RepositorySummary (Maybe Text) (Maybe Text)
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)

-- | The AWS account ID that manages the repository.
repositorySummary_administratorAccount :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_administratorAccount :: (Maybe Text -> f (Maybe Text))
-> RepositorySummary -> f RepositorySummary
repositorySummary_administratorAccount = (RepositorySummary -> Maybe Text)
-> (RepositorySummary -> Maybe Text -> RepositorySummary)
-> Lens
     RepositorySummary RepositorySummary (Maybe Text) (Maybe Text)
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 description of the repository.
repositorySummary_description :: Lens.Lens' RepositorySummary (Prelude.Maybe Prelude.Text)
repositorySummary_description :: (Maybe Text -> f (Maybe Text))
-> RepositorySummary -> f RepositorySummary
repositorySummary_description = (RepositorySummary -> Maybe Text)
-> (RepositorySummary -> Maybe Text -> RepositorySummary)
-> Lens
     RepositorySummary RepositorySummary (Maybe Text) (Maybe Text)
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)

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

instance Prelude.Hashable RepositorySummary

instance Prelude.NFData RepositorySummary