{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateRepository
-- 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)
--
-- Creates a repository.
module Amazonka.CodeArtifact.CreateRepository
  ( -- * Creating a Request
    CreateRepository (..),
    newCreateRepository,

    -- * Request Lenses
    createRepository_upstreams,
    createRepository_domainOwner,
    createRepository_description,
    createRepository_tags,
    createRepository_domain,
    createRepository_repository,

    -- * Destructuring the Response
    CreateRepositoryResponse (..),
    newCreateRepositoryResponse,

    -- * Response Lenses
    createRepositoryResponse_repository,
    createRepositoryResponse_httpStatus,
  )
where

import Amazonka.CodeArtifact.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateRepository' smart constructor.
data CreateRepository = CreateRepository'
  { -- | A list of upstream repositories to associate with the repository. The
    -- order of the upstream repositories in the list determines their priority
    -- order when AWS CodeArtifact looks for a requested package version. For
    -- more information, see
    -- <https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html Working with upstream repositories>.
    CreateRepository -> Maybe [UpstreamRepository]
upstreams :: Prelude.Maybe [UpstreamRepository],
    -- | The 12-digit account number of the AWS account that owns the domain. It
    -- does not include dashes or spaces.
    CreateRepository -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
    -- | A description of the created repository.
    CreateRepository -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | One or more tag key-value pairs for the repository.
    CreateRepository -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the domain that contains the created repository.
    CreateRepository -> Text
domain :: Prelude.Text,
    -- | The name of the repository to create.
    CreateRepository -> Text
repository :: Prelude.Text
  }
  deriving (CreateRepository -> CreateRepository -> Bool
(CreateRepository -> CreateRepository -> Bool)
-> (CreateRepository -> CreateRepository -> Bool)
-> Eq CreateRepository
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRepository -> CreateRepository -> Bool
$c/= :: CreateRepository -> CreateRepository -> Bool
== :: CreateRepository -> CreateRepository -> Bool
$c== :: CreateRepository -> CreateRepository -> Bool
Prelude.Eq, ReadPrec [CreateRepository]
ReadPrec CreateRepository
Int -> ReadS CreateRepository
ReadS [CreateRepository]
(Int -> ReadS CreateRepository)
-> ReadS [CreateRepository]
-> ReadPrec CreateRepository
-> ReadPrec [CreateRepository]
-> Read CreateRepository
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRepository]
$creadListPrec :: ReadPrec [CreateRepository]
readPrec :: ReadPrec CreateRepository
$creadPrec :: ReadPrec CreateRepository
readList :: ReadS [CreateRepository]
$creadList :: ReadS [CreateRepository]
readsPrec :: Int -> ReadS CreateRepository
$creadsPrec :: Int -> ReadS CreateRepository
Prelude.Read, Int -> CreateRepository -> ShowS
[CreateRepository] -> ShowS
CreateRepository -> String
(Int -> CreateRepository -> ShowS)
-> (CreateRepository -> String)
-> ([CreateRepository] -> ShowS)
-> Show CreateRepository
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRepository] -> ShowS
$cshowList :: [CreateRepository] -> ShowS
show :: CreateRepository -> String
$cshow :: CreateRepository -> String
showsPrec :: Int -> CreateRepository -> ShowS
$cshowsPrec :: Int -> CreateRepository -> ShowS
Prelude.Show, (forall x. CreateRepository -> Rep CreateRepository x)
-> (forall x. Rep CreateRepository x -> CreateRepository)
-> Generic CreateRepository
forall x. Rep CreateRepository x -> CreateRepository
forall x. CreateRepository -> Rep CreateRepository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRepository x -> CreateRepository
$cfrom :: forall x. CreateRepository -> Rep CreateRepository x
Prelude.Generic)

-- |
-- Create a value of 'CreateRepository' 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:
--
-- 'upstreams', 'createRepository_upstreams' - A list of upstream repositories to associate with the repository. The
-- order of the upstream repositories in the list determines their priority
-- order when AWS CodeArtifact looks for a requested package version. For
-- more information, see
-- <https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html Working with upstream repositories>.
--
-- 'domainOwner', 'createRepository_domainOwner' - The 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
--
-- 'description', 'createRepository_description' - A description of the created repository.
--
-- 'tags', 'createRepository_tags' - One or more tag key-value pairs for the repository.
--
-- 'domain', 'createRepository_domain' - The name of the domain that contains the created repository.
--
-- 'repository', 'createRepository_repository' - The name of the repository to create.
newCreateRepository ::
  -- | 'domain'
  Prelude.Text ->
  -- | 'repository'
  Prelude.Text ->
  CreateRepository
newCreateRepository :: Text -> Text -> CreateRepository
newCreateRepository Text
pDomain_ Text
pRepository_ =
  CreateRepository' :: Maybe [UpstreamRepository]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> CreateRepository
CreateRepository'
    { $sel:upstreams:CreateRepository' :: Maybe [UpstreamRepository]
upstreams = Maybe [UpstreamRepository]
forall a. Maybe a
Prelude.Nothing,
      $sel:domainOwner:CreateRepository' :: Maybe Text
domainOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateRepository' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateRepository' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:domain:CreateRepository' :: Text
domain = Text
pDomain_,
      $sel:repository:CreateRepository' :: Text
repository = Text
pRepository_
    }

-- | A list of upstream repositories to associate with the repository. The
-- order of the upstream repositories in the list determines their priority
-- order when AWS CodeArtifact looks for a requested package version. For
-- more information, see
-- <https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html Working with upstream repositories>.
createRepository_upstreams :: Lens.Lens' CreateRepository (Prelude.Maybe [UpstreamRepository])
createRepository_upstreams :: (Maybe [UpstreamRepository] -> f (Maybe [UpstreamRepository]))
-> CreateRepository -> f CreateRepository
createRepository_upstreams = (CreateRepository -> Maybe [UpstreamRepository])
-> (CreateRepository
    -> Maybe [UpstreamRepository] -> CreateRepository)
-> Lens
     CreateRepository
     CreateRepository
     (Maybe [UpstreamRepository])
     (Maybe [UpstreamRepository])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRepository' {Maybe [UpstreamRepository]
upstreams :: Maybe [UpstreamRepository]
$sel:upstreams:CreateRepository' :: CreateRepository -> Maybe [UpstreamRepository]
upstreams} -> Maybe [UpstreamRepository]
upstreams) (\s :: CreateRepository
s@CreateRepository' {} Maybe [UpstreamRepository]
a -> CreateRepository
s {$sel:upstreams:CreateRepository' :: Maybe [UpstreamRepository]
upstreams = Maybe [UpstreamRepository]
a} :: CreateRepository) ((Maybe [UpstreamRepository] -> f (Maybe [UpstreamRepository]))
 -> CreateRepository -> f CreateRepository)
-> ((Maybe [UpstreamRepository] -> f (Maybe [UpstreamRepository]))
    -> Maybe [UpstreamRepository] -> f (Maybe [UpstreamRepository]))
-> (Maybe [UpstreamRepository] -> f (Maybe [UpstreamRepository]))
-> CreateRepository
-> f CreateRepository
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UpstreamRepository]
  [UpstreamRepository]
  [UpstreamRepository]
  [UpstreamRepository]
-> Iso
     (Maybe [UpstreamRepository])
     (Maybe [UpstreamRepository])
     (Maybe [UpstreamRepository])
     (Maybe [UpstreamRepository])
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 AnIso
  [UpstreamRepository]
  [UpstreamRepository]
  [UpstreamRepository]
  [UpstreamRepository]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | A description of the created repository.
createRepository_description :: Lens.Lens' CreateRepository (Prelude.Maybe Prelude.Text)
createRepository_description :: (Maybe Text -> f (Maybe Text))
-> CreateRepository -> f CreateRepository
createRepository_description = (CreateRepository -> Maybe Text)
-> (CreateRepository -> Maybe Text -> CreateRepository)
-> Lens CreateRepository CreateRepository (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRepository' {Maybe Text
description :: Maybe Text
$sel:description:CreateRepository' :: CreateRepository -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateRepository
s@CreateRepository' {} Maybe Text
a -> CreateRepository
s {$sel:description:CreateRepository' :: Maybe Text
description = Maybe Text
a} :: CreateRepository)

-- | One or more tag key-value pairs for the repository.
createRepository_tags :: Lens.Lens' CreateRepository (Prelude.Maybe [Tag])
createRepository_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRepository -> f CreateRepository
createRepository_tags = (CreateRepository -> Maybe [Tag])
-> (CreateRepository -> Maybe [Tag] -> CreateRepository)
-> Lens
     CreateRepository CreateRepository (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRepository' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateRepository' :: CreateRepository -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateRepository
s@CreateRepository' {} Maybe [Tag]
a -> CreateRepository
s {$sel:tags:CreateRepository' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateRepository) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateRepository -> f CreateRepository)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRepository
-> f CreateRepository
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The name of the repository to create.
createRepository_repository :: Lens.Lens' CreateRepository Prelude.Text
createRepository_repository :: (Text -> f Text) -> CreateRepository -> f CreateRepository
createRepository_repository = (CreateRepository -> Text)
-> (CreateRepository -> Text -> CreateRepository)
-> Lens CreateRepository CreateRepository Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRepository' {Text
repository :: Text
$sel:repository:CreateRepository' :: CreateRepository -> Text
repository} -> Text
repository) (\s :: CreateRepository
s@CreateRepository' {} Text
a -> CreateRepository
s {$sel:repository:CreateRepository' :: Text
repository = Text
a} :: CreateRepository)

instance Core.AWSRequest CreateRepository where
  type
    AWSResponse CreateRepository =
      CreateRepositoryResponse
  request :: CreateRepository -> Request CreateRepository
request = Service -> CreateRepository -> Request CreateRepository
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateRepository
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRepository)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateRepository))
-> Logger
-> Service
-> Proxy CreateRepository
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRepository)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe RepositoryDescription -> Int -> CreateRepositoryResponse
CreateRepositoryResponse'
            (Maybe RepositoryDescription -> Int -> CreateRepositoryResponse)
-> Either String (Maybe RepositoryDescription)
-> Either String (Int -> CreateRepositoryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RepositoryDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"repository")
            Either String (Int -> CreateRepositoryResponse)
-> Either String Int -> Either String CreateRepositoryResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateRepository

instance Prelude.NFData CreateRepository

instance Core.ToHeaders CreateRepository where
  toHeaders :: CreateRepository -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateRepository -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateRepository where
  toJSON :: CreateRepository -> Value
toJSON CreateRepository' {Maybe [Tag]
Maybe [UpstreamRepository]
Maybe Text
Text
repository :: Text
domain :: Text
tags :: Maybe [Tag]
description :: Maybe Text
domainOwner :: Maybe Text
upstreams :: Maybe [UpstreamRepository]
$sel:repository:CreateRepository' :: CreateRepository -> Text
$sel:domain:CreateRepository' :: CreateRepository -> Text
$sel:tags:CreateRepository' :: CreateRepository -> Maybe [Tag]
$sel:description:CreateRepository' :: CreateRepository -> Maybe Text
$sel:domainOwner:CreateRepository' :: CreateRepository -> Maybe Text
$sel:upstreams:CreateRepository' :: CreateRepository -> Maybe [UpstreamRepository]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"upstreams" Text -> [UpstreamRepository] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([UpstreamRepository] -> Pair)
-> Maybe [UpstreamRepository] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [UpstreamRepository]
upstreams,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags
          ]
      )

instance Core.ToPath CreateRepository where
  toPath :: CreateRepository -> ByteString
toPath = ByteString -> CreateRepository -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/repository"

instance Core.ToQuery CreateRepository where
  toQuery :: CreateRepository -> QueryString
toQuery CreateRepository' {Maybe [Tag]
Maybe [UpstreamRepository]
Maybe Text
Text
repository :: Text
domain :: Text
tags :: Maybe [Tag]
description :: Maybe Text
domainOwner :: Maybe Text
upstreams :: Maybe [UpstreamRepository]
$sel:repository:CreateRepository' :: CreateRepository -> Text
$sel:domain:CreateRepository' :: CreateRepository -> Text
$sel:tags:CreateRepository' :: CreateRepository -> Maybe [Tag]
$sel:description:CreateRepository' :: CreateRepository -> Maybe Text
$sel:domainOwner:CreateRepository' :: CreateRepository -> Maybe Text
$sel:upstreams:CreateRepository' :: CreateRepository -> Maybe [UpstreamRepository]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"domain-owner" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
domainOwner,
        ByteString
"domain" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domain,
        ByteString
"repository" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
repository
      ]

-- | /See:/ 'newCreateRepositoryResponse' smart constructor.
data CreateRepositoryResponse = CreateRepositoryResponse'
  { -- | Information about the created repository after processing the request.
    CreateRepositoryResponse -> Maybe RepositoryDescription
repository :: Prelude.Maybe RepositoryDescription,
    -- | The response's http status code.
    CreateRepositoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateRepositoryResponse -> CreateRepositoryResponse -> Bool
(CreateRepositoryResponse -> CreateRepositoryResponse -> Bool)
-> (CreateRepositoryResponse -> CreateRepositoryResponse -> Bool)
-> Eq CreateRepositoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRepositoryResponse -> CreateRepositoryResponse -> Bool
$c/= :: CreateRepositoryResponse -> CreateRepositoryResponse -> Bool
== :: CreateRepositoryResponse -> CreateRepositoryResponse -> Bool
$c== :: CreateRepositoryResponse -> CreateRepositoryResponse -> Bool
Prelude.Eq, ReadPrec [CreateRepositoryResponse]
ReadPrec CreateRepositoryResponse
Int -> ReadS CreateRepositoryResponse
ReadS [CreateRepositoryResponse]
(Int -> ReadS CreateRepositoryResponse)
-> ReadS [CreateRepositoryResponse]
-> ReadPrec CreateRepositoryResponse
-> ReadPrec [CreateRepositoryResponse]
-> Read CreateRepositoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRepositoryResponse]
$creadListPrec :: ReadPrec [CreateRepositoryResponse]
readPrec :: ReadPrec CreateRepositoryResponse
$creadPrec :: ReadPrec CreateRepositoryResponse
readList :: ReadS [CreateRepositoryResponse]
$creadList :: ReadS [CreateRepositoryResponse]
readsPrec :: Int -> ReadS CreateRepositoryResponse
$creadsPrec :: Int -> ReadS CreateRepositoryResponse
Prelude.Read, Int -> CreateRepositoryResponse -> ShowS
[CreateRepositoryResponse] -> ShowS
CreateRepositoryResponse -> String
(Int -> CreateRepositoryResponse -> ShowS)
-> (CreateRepositoryResponse -> String)
-> ([CreateRepositoryResponse] -> ShowS)
-> Show CreateRepositoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRepositoryResponse] -> ShowS
$cshowList :: [CreateRepositoryResponse] -> ShowS
show :: CreateRepositoryResponse -> String
$cshow :: CreateRepositoryResponse -> String
showsPrec :: Int -> CreateRepositoryResponse -> ShowS
$cshowsPrec :: Int -> CreateRepositoryResponse -> ShowS
Prelude.Show, (forall x.
 CreateRepositoryResponse -> Rep CreateRepositoryResponse x)
-> (forall x.
    Rep CreateRepositoryResponse x -> CreateRepositoryResponse)
-> Generic CreateRepositoryResponse
forall x.
Rep CreateRepositoryResponse x -> CreateRepositoryResponse
forall x.
CreateRepositoryResponse -> Rep CreateRepositoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRepositoryResponse x -> CreateRepositoryResponse
$cfrom :: forall x.
CreateRepositoryResponse -> Rep CreateRepositoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateRepositoryResponse' 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:
--
-- 'repository', 'createRepositoryResponse_repository' - Information about the created repository after processing the request.
--
-- 'httpStatus', 'createRepositoryResponse_httpStatus' - The response's http status code.
newCreateRepositoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRepositoryResponse
newCreateRepositoryResponse :: Int -> CreateRepositoryResponse
newCreateRepositoryResponse Int
pHttpStatus_ =
  CreateRepositoryResponse' :: Maybe RepositoryDescription -> Int -> CreateRepositoryResponse
CreateRepositoryResponse'
    { $sel:repository:CreateRepositoryResponse' :: Maybe RepositoryDescription
repository =
        Maybe RepositoryDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateRepositoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the created repository after processing the request.
createRepositoryResponse_repository :: Lens.Lens' CreateRepositoryResponse (Prelude.Maybe RepositoryDescription)
createRepositoryResponse_repository :: (Maybe RepositoryDescription -> f (Maybe RepositoryDescription))
-> CreateRepositoryResponse -> f CreateRepositoryResponse
createRepositoryResponse_repository = (CreateRepositoryResponse -> Maybe RepositoryDescription)
-> (CreateRepositoryResponse
    -> Maybe RepositoryDescription -> CreateRepositoryResponse)
-> Lens
     CreateRepositoryResponse
     CreateRepositoryResponse
     (Maybe RepositoryDescription)
     (Maybe RepositoryDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRepositoryResponse' {Maybe RepositoryDescription
repository :: Maybe RepositoryDescription
$sel:repository:CreateRepositoryResponse' :: CreateRepositoryResponse -> Maybe RepositoryDescription
repository} -> Maybe RepositoryDescription
repository) (\s :: CreateRepositoryResponse
s@CreateRepositoryResponse' {} Maybe RepositoryDescription
a -> CreateRepositoryResponse
s {$sel:repository:CreateRepositoryResponse' :: Maybe RepositoryDescription
repository = Maybe RepositoryDescription
a} :: CreateRepositoryResponse)

-- | The response's http status code.
createRepositoryResponse_httpStatus :: Lens.Lens' CreateRepositoryResponse Prelude.Int
createRepositoryResponse_httpStatus :: (Int -> f Int)
-> CreateRepositoryResponse -> f CreateRepositoryResponse
createRepositoryResponse_httpStatus = (CreateRepositoryResponse -> Int)
-> (CreateRepositoryResponse -> Int -> CreateRepositoryResponse)
-> Lens CreateRepositoryResponse CreateRepositoryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRepositoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateRepositoryResponse' :: CreateRepositoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateRepositoryResponse
s@CreateRepositoryResponse' {} Int
a -> CreateRepositoryResponse
s {$sel:httpStatus:CreateRepositoryResponse' :: Int
httpStatus = Int
a} :: CreateRepositoryResponse)

instance Prelude.NFData CreateRepositoryResponse