{-# 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.CodeStar.CreateProject
-- 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 project, including project resources. This action creates a
-- project based on a submitted project request. A set of source code files
-- and a toolchain template file can be included with the project request.
-- If these are not provided, an empty project is created.
module Amazonka.CodeStar.CreateProject
  ( -- * Creating a Request
    CreateProject (..),
    newCreateProject,

    -- * Request Lenses
    createProject_sourceCode,
    createProject_toolchain,
    createProject_clientRequestToken,
    createProject_description,
    createProject_tags,
    createProject_name,
    createProject_id,

    -- * Destructuring the Response
    CreateProjectResponse (..),
    newCreateProjectResponse,

    -- * Response Lenses
    createProjectResponse_projectTemplateId,
    createProjectResponse_clientRequestToken,
    createProjectResponse_httpStatus,
    createProjectResponse_id,
    createProjectResponse_arn,
  )
where

import Amazonka.CodeStar.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:/ 'newCreateProject' smart constructor.
data CreateProject = CreateProject'
  { -- | A list of the Code objects submitted with the project request. If this
    -- parameter is specified, the request must also include the toolchain
    -- parameter.
    CreateProject -> Maybe [Code]
sourceCode :: Prelude.Maybe [Code],
    -- | The name of the toolchain template file submitted with the project
    -- request. If this parameter is specified, the request must also include
    -- the sourceCode parameter.
    CreateProject -> Maybe Toolchain
toolchain :: Prelude.Maybe Toolchain,
    -- | A user- or system-generated token that identifies the entity that
    -- requested project creation. This token can be used to repeat the
    -- request.
    CreateProject -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The description of the project, if any.
    CreateProject -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The tags created for the project.
    CreateProject -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The display name for the project to be created in AWS CodeStar.
    CreateProject -> Sensitive Text
name :: Core.Sensitive Prelude.Text,
    -- | The ID of the project to be created in AWS CodeStar.
    CreateProject -> Text
id :: Prelude.Text
  }
  deriving (CreateProject -> CreateProject -> Bool
(CreateProject -> CreateProject -> Bool)
-> (CreateProject -> CreateProject -> Bool) -> Eq CreateProject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProject -> CreateProject -> Bool
$c/= :: CreateProject -> CreateProject -> Bool
== :: CreateProject -> CreateProject -> Bool
$c== :: CreateProject -> CreateProject -> Bool
Prelude.Eq, Int -> CreateProject -> ShowS
[CreateProject] -> ShowS
CreateProject -> String
(Int -> CreateProject -> ShowS)
-> (CreateProject -> String)
-> ([CreateProject] -> ShowS)
-> Show CreateProject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProject] -> ShowS
$cshowList :: [CreateProject] -> ShowS
show :: CreateProject -> String
$cshow :: CreateProject -> String
showsPrec :: Int -> CreateProject -> ShowS
$cshowsPrec :: Int -> CreateProject -> ShowS
Prelude.Show, (forall x. CreateProject -> Rep CreateProject x)
-> (forall x. Rep CreateProject x -> CreateProject)
-> Generic CreateProject
forall x. Rep CreateProject x -> CreateProject
forall x. CreateProject -> Rep CreateProject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProject x -> CreateProject
$cfrom :: forall x. CreateProject -> Rep CreateProject x
Prelude.Generic)

-- |
-- Create a value of 'CreateProject' 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:
--
-- 'sourceCode', 'createProject_sourceCode' - A list of the Code objects submitted with the project request. If this
-- parameter is specified, the request must also include the toolchain
-- parameter.
--
-- 'toolchain', 'createProject_toolchain' - The name of the toolchain template file submitted with the project
-- request. If this parameter is specified, the request must also include
-- the sourceCode parameter.
--
-- 'clientRequestToken', 'createProject_clientRequestToken' - A user- or system-generated token that identifies the entity that
-- requested project creation. This token can be used to repeat the
-- request.
--
-- 'description', 'createProject_description' - The description of the project, if any.
--
-- 'tags', 'createProject_tags' - The tags created for the project.
--
-- 'name', 'createProject_name' - The display name for the project to be created in AWS CodeStar.
--
-- 'id', 'createProject_id' - The ID of the project to be created in AWS CodeStar.
newCreateProject ::
  -- | 'name'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  CreateProject
newCreateProject :: Text -> Text -> CreateProject
newCreateProject Text
pName_ Text
pId_ =
  CreateProject' :: Maybe [Code]
-> Maybe Toolchain
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (HashMap Text Text)
-> Sensitive Text
-> Text
-> CreateProject
CreateProject'
    { $sel:sourceCode:CreateProject' :: Maybe [Code]
sourceCode = Maybe [Code]
forall a. Maybe a
Prelude.Nothing,
      $sel:toolchain:CreateProject' :: Maybe Toolchain
toolchain = Maybe Toolchain
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateProject' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateProject' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateProject' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateProject' :: Sensitive Text
name = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pName_,
      $sel:id:CreateProject' :: Text
id = Text
pId_
    }

-- | A list of the Code objects submitted with the project request. If this
-- parameter is specified, the request must also include the toolchain
-- parameter.
createProject_sourceCode :: Lens.Lens' CreateProject (Prelude.Maybe [Code])
createProject_sourceCode :: (Maybe [Code] -> f (Maybe [Code]))
-> CreateProject -> f CreateProject
createProject_sourceCode = (CreateProject -> Maybe [Code])
-> (CreateProject -> Maybe [Code] -> CreateProject)
-> Lens CreateProject CreateProject (Maybe [Code]) (Maybe [Code])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe [Code]
sourceCode :: Maybe [Code]
$sel:sourceCode:CreateProject' :: CreateProject -> Maybe [Code]
sourceCode} -> Maybe [Code]
sourceCode) (\s :: CreateProject
s@CreateProject' {} Maybe [Code]
a -> CreateProject
s {$sel:sourceCode:CreateProject' :: Maybe [Code]
sourceCode = Maybe [Code]
a} :: CreateProject) ((Maybe [Code] -> f (Maybe [Code]))
 -> CreateProject -> f CreateProject)
-> ((Maybe [Code] -> f (Maybe [Code]))
    -> Maybe [Code] -> f (Maybe [Code]))
-> (Maybe [Code] -> f (Maybe [Code]))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Code] [Code] [Code] [Code]
-> Iso (Maybe [Code]) (Maybe [Code]) (Maybe [Code]) (Maybe [Code])
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 [Code] [Code] [Code] [Code]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the toolchain template file submitted with the project
-- request. If this parameter is specified, the request must also include
-- the sourceCode parameter.
createProject_toolchain :: Lens.Lens' CreateProject (Prelude.Maybe Toolchain)
createProject_toolchain :: (Maybe Toolchain -> f (Maybe Toolchain))
-> CreateProject -> f CreateProject
createProject_toolchain = (CreateProject -> Maybe Toolchain)
-> (CreateProject -> Maybe Toolchain -> CreateProject)
-> Lens
     CreateProject CreateProject (Maybe Toolchain) (Maybe Toolchain)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Toolchain
toolchain :: Maybe Toolchain
$sel:toolchain:CreateProject' :: CreateProject -> Maybe Toolchain
toolchain} -> Maybe Toolchain
toolchain) (\s :: CreateProject
s@CreateProject' {} Maybe Toolchain
a -> CreateProject
s {$sel:toolchain:CreateProject' :: Maybe Toolchain
toolchain = Maybe Toolchain
a} :: CreateProject)

-- | A user- or system-generated token that identifies the entity that
-- requested project creation. This token can be used to repeat the
-- request.
createProject_clientRequestToken :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Text)
createProject_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> CreateProject -> f CreateProject
createProject_clientRequestToken = (CreateProject -> Maybe Text)
-> (CreateProject -> Maybe Text -> CreateProject)
-> Lens CreateProject CreateProject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateProject' :: CreateProject -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateProject
s@CreateProject' {} Maybe Text
a -> CreateProject
s {$sel:clientRequestToken:CreateProject' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateProject)

-- | The description of the project, if any.
createProject_description :: Lens.Lens' CreateProject (Prelude.Maybe Prelude.Text)
createProject_description :: (Maybe Text -> f (Maybe Text)) -> CreateProject -> f CreateProject
createProject_description = (CreateProject -> Maybe (Sensitive Text))
-> (CreateProject -> Maybe (Sensitive Text) -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:CreateProject' :: CreateProject -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: CreateProject
s@CreateProject' {} Maybe (Sensitive Text)
a -> CreateProject
s {$sel:description:CreateProject' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: CreateProject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateProject -> f CreateProject)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The tags created for the project.
createProject_tags :: Lens.Lens' CreateProject (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createProject_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateProject -> f CreateProject
createProject_tags = (CreateProject -> Maybe (HashMap Text Text))
-> (CreateProject -> Maybe (HashMap Text Text) -> CreateProject)
-> Lens
     CreateProject
     CreateProject
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateProject' :: CreateProject -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateProject
s@CreateProject' {} Maybe (HashMap Text Text)
a -> CreateProject
s {$sel:tags:CreateProject' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateProject) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateProject -> f CreateProject)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The display name for the project to be created in AWS CodeStar.
createProject_name :: Lens.Lens' CreateProject Prelude.Text
createProject_name :: (Text -> f Text) -> CreateProject -> f CreateProject
createProject_name = (CreateProject -> Sensitive Text)
-> (CreateProject -> Sensitive Text -> CreateProject)
-> Lens
     CreateProject CreateProject (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Sensitive Text
name :: Sensitive Text
$sel:name:CreateProject' :: CreateProject -> Sensitive Text
name} -> Sensitive Text
name) (\s :: CreateProject
s@CreateProject' {} Sensitive Text
a -> CreateProject
s {$sel:name:CreateProject' :: Sensitive Text
name = Sensitive Text
a} :: CreateProject) ((Sensitive Text -> f (Sensitive Text))
 -> CreateProject -> f CreateProject)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateProject
-> f CreateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The ID of the project to be created in AWS CodeStar.
createProject_id :: Lens.Lens' CreateProject Prelude.Text
createProject_id :: (Text -> f Text) -> CreateProject -> f CreateProject
createProject_id = (CreateProject -> Text)
-> (CreateProject -> Text -> CreateProject)
-> Lens CreateProject CreateProject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProject' {Text
id :: Text
$sel:id:CreateProject' :: CreateProject -> Text
id} -> Text
id) (\s :: CreateProject
s@CreateProject' {} Text
a -> CreateProject
s {$sel:id:CreateProject' :: Text
id = Text
a} :: CreateProject)

instance Core.AWSRequest CreateProject where
  type
    AWSResponse CreateProject =
      CreateProjectResponse
  request :: CreateProject -> Request CreateProject
request = Service -> CreateProject -> Request CreateProject
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProject)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateProject))
-> Logger
-> Service
-> Proxy CreateProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProject)))
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 Text
-> Maybe Text -> Int -> Text -> Text -> CreateProjectResponse
CreateProjectResponse'
            (Maybe Text
 -> Maybe Text -> Int -> Text -> Text -> CreateProjectResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> Text -> Text -> CreateProjectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"projectTemplateId")
            Either
  String (Maybe Text -> Int -> Text -> Text -> CreateProjectResponse)
-> Either String (Maybe Text)
-> Either String (Int -> Text -> Text -> CreateProjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clientRequestToken")
            Either String (Int -> Text -> Text -> CreateProjectResponse)
-> Either String Int
-> Either String (Text -> Text -> CreateProjectResponse)
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))
            Either String (Text -> Text -> CreateProjectResponse)
-> Either String Text
-> Either String (Text -> CreateProjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"id")
            Either String (Text -> CreateProjectResponse)
-> Either String Text -> Either String CreateProjectResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"arn")
      )

instance Prelude.Hashable CreateProject

instance Prelude.NFData CreateProject

instance Core.ToHeaders CreateProject where
  toHeaders :: CreateProject -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateProject -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeStar_20170419.CreateProject" ::
                          Prelude.ByteString
                      ),
            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 CreateProject where
  toJSON :: CreateProject -> Value
toJSON CreateProject' {Maybe [Code]
Maybe Text
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe Toolchain
Text
Sensitive Text
id :: Text
name :: Sensitive Text
tags :: Maybe (HashMap Text Text)
description :: Maybe (Sensitive Text)
clientRequestToken :: Maybe Text
toolchain :: Maybe Toolchain
sourceCode :: Maybe [Code]
$sel:id:CreateProject' :: CreateProject -> Text
$sel:name:CreateProject' :: CreateProject -> Sensitive Text
$sel:tags:CreateProject' :: CreateProject -> Maybe (HashMap Text Text)
$sel:description:CreateProject' :: CreateProject -> Maybe (Sensitive Text)
$sel:clientRequestToken:CreateProject' :: CreateProject -> Maybe Text
$sel:toolchain:CreateProject' :: CreateProject -> Maybe Toolchain
$sel:sourceCode:CreateProject' :: CreateProject -> Maybe [Code]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"sourceCode" Text -> [Code] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Code] -> Pair) -> Maybe [Code] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Code]
sourceCode,
            (Text
"toolchain" Text -> Toolchain -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Toolchain -> Pair) -> Maybe Toolchain -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Toolchain
toolchain,
            (Text
"clientRequestToken" 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
clientRequestToken,
            (Text
"description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)
          ]
      )

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

instance Core.ToQuery CreateProject where
  toQuery :: CreateProject -> QueryString
toQuery = QueryString -> CreateProject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateProjectResponse' smart constructor.
data CreateProjectResponse = CreateProjectResponse'
  { -- | Reserved for future use.
    CreateProjectResponse -> Maybe Text
projectTemplateId :: Prelude.Maybe Prelude.Text,
    -- | A user- or system-generated token that identifies the entity that
    -- requested project creation.
    CreateProjectResponse -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateProjectResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the project.
    CreateProjectResponse -> Text
id :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the created project.
    CreateProjectResponse -> Text
arn :: Prelude.Text
  }
  deriving (CreateProjectResponse -> CreateProjectResponse -> Bool
(CreateProjectResponse -> CreateProjectResponse -> Bool)
-> (CreateProjectResponse -> CreateProjectResponse -> Bool)
-> Eq CreateProjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProjectResponse -> CreateProjectResponse -> Bool
$c/= :: CreateProjectResponse -> CreateProjectResponse -> Bool
== :: CreateProjectResponse -> CreateProjectResponse -> Bool
$c== :: CreateProjectResponse -> CreateProjectResponse -> Bool
Prelude.Eq, ReadPrec [CreateProjectResponse]
ReadPrec CreateProjectResponse
Int -> ReadS CreateProjectResponse
ReadS [CreateProjectResponse]
(Int -> ReadS CreateProjectResponse)
-> ReadS [CreateProjectResponse]
-> ReadPrec CreateProjectResponse
-> ReadPrec [CreateProjectResponse]
-> Read CreateProjectResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProjectResponse]
$creadListPrec :: ReadPrec [CreateProjectResponse]
readPrec :: ReadPrec CreateProjectResponse
$creadPrec :: ReadPrec CreateProjectResponse
readList :: ReadS [CreateProjectResponse]
$creadList :: ReadS [CreateProjectResponse]
readsPrec :: Int -> ReadS CreateProjectResponse
$creadsPrec :: Int -> ReadS CreateProjectResponse
Prelude.Read, Int -> CreateProjectResponse -> ShowS
[CreateProjectResponse] -> ShowS
CreateProjectResponse -> String
(Int -> CreateProjectResponse -> ShowS)
-> (CreateProjectResponse -> String)
-> ([CreateProjectResponse] -> ShowS)
-> Show CreateProjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProjectResponse] -> ShowS
$cshowList :: [CreateProjectResponse] -> ShowS
show :: CreateProjectResponse -> String
$cshow :: CreateProjectResponse -> String
showsPrec :: Int -> CreateProjectResponse -> ShowS
$cshowsPrec :: Int -> CreateProjectResponse -> ShowS
Prelude.Show, (forall x. CreateProjectResponse -> Rep CreateProjectResponse x)
-> (forall x. Rep CreateProjectResponse x -> CreateProjectResponse)
-> Generic CreateProjectResponse
forall x. Rep CreateProjectResponse x -> CreateProjectResponse
forall x. CreateProjectResponse -> Rep CreateProjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProjectResponse x -> CreateProjectResponse
$cfrom :: forall x. CreateProjectResponse -> Rep CreateProjectResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateProjectResponse' 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:
--
-- 'projectTemplateId', 'createProjectResponse_projectTemplateId' - Reserved for future use.
--
-- 'clientRequestToken', 'createProjectResponse_clientRequestToken' - A user- or system-generated token that identifies the entity that
-- requested project creation.
--
-- 'httpStatus', 'createProjectResponse_httpStatus' - The response's http status code.
--
-- 'id', 'createProjectResponse_id' - The ID of the project.
--
-- 'arn', 'createProjectResponse_arn' - The Amazon Resource Name (ARN) of the created project.
newCreateProjectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'id'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  CreateProjectResponse
newCreateProjectResponse :: Int -> Text -> Text -> CreateProjectResponse
newCreateProjectResponse Int
pHttpStatus_ Text
pId_ Text
pArn_ =
  CreateProjectResponse' :: Maybe Text
-> Maybe Text -> Int -> Text -> Text -> CreateProjectResponse
CreateProjectResponse'
    { $sel:projectTemplateId:CreateProjectResponse' :: Maybe Text
projectTemplateId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateProjectResponse' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateProjectResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:id:CreateProjectResponse' :: Text
id = Text
pId_,
      $sel:arn:CreateProjectResponse' :: Text
arn = Text
pArn_
    }

-- | Reserved for future use.
createProjectResponse_projectTemplateId :: Lens.Lens' CreateProjectResponse (Prelude.Maybe Prelude.Text)
createProjectResponse_projectTemplateId :: (Maybe Text -> f (Maybe Text))
-> CreateProjectResponse -> f CreateProjectResponse
createProjectResponse_projectTemplateId = (CreateProjectResponse -> Maybe Text)
-> (CreateProjectResponse -> Maybe Text -> CreateProjectResponse)
-> Lens
     CreateProjectResponse
     CreateProjectResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProjectResponse' {Maybe Text
projectTemplateId :: Maybe Text
$sel:projectTemplateId:CreateProjectResponse' :: CreateProjectResponse -> Maybe Text
projectTemplateId} -> Maybe Text
projectTemplateId) (\s :: CreateProjectResponse
s@CreateProjectResponse' {} Maybe Text
a -> CreateProjectResponse
s {$sel:projectTemplateId:CreateProjectResponse' :: Maybe Text
projectTemplateId = Maybe Text
a} :: CreateProjectResponse)

-- | A user- or system-generated token that identifies the entity that
-- requested project creation.
createProjectResponse_clientRequestToken :: Lens.Lens' CreateProjectResponse (Prelude.Maybe Prelude.Text)
createProjectResponse_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateProjectResponse -> f CreateProjectResponse
createProjectResponse_clientRequestToken = (CreateProjectResponse -> Maybe Text)
-> (CreateProjectResponse -> Maybe Text -> CreateProjectResponse)
-> Lens
     CreateProjectResponse
     CreateProjectResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProjectResponse' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateProjectResponse' :: CreateProjectResponse -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateProjectResponse
s@CreateProjectResponse' {} Maybe Text
a -> CreateProjectResponse
s {$sel:clientRequestToken:CreateProjectResponse' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateProjectResponse)

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

-- | The ID of the project.
createProjectResponse_id :: Lens.Lens' CreateProjectResponse Prelude.Text
createProjectResponse_id :: (Text -> f Text)
-> CreateProjectResponse -> f CreateProjectResponse
createProjectResponse_id = (CreateProjectResponse -> Text)
-> (CreateProjectResponse -> Text -> CreateProjectResponse)
-> Lens CreateProjectResponse CreateProjectResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProjectResponse' {Text
id :: Text
$sel:id:CreateProjectResponse' :: CreateProjectResponse -> Text
id} -> Text
id) (\s :: CreateProjectResponse
s@CreateProjectResponse' {} Text
a -> CreateProjectResponse
s {$sel:id:CreateProjectResponse' :: Text
id = Text
a} :: CreateProjectResponse)

-- | The Amazon Resource Name (ARN) of the created project.
createProjectResponse_arn :: Lens.Lens' CreateProjectResponse Prelude.Text
createProjectResponse_arn :: (Text -> f Text)
-> CreateProjectResponse -> f CreateProjectResponse
createProjectResponse_arn = (CreateProjectResponse -> Text)
-> (CreateProjectResponse -> Text -> CreateProjectResponse)
-> Lens CreateProjectResponse CreateProjectResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProjectResponse' {Text
arn :: Text
$sel:arn:CreateProjectResponse' :: CreateProjectResponse -> Text
arn} -> Text
arn) (\s :: CreateProjectResponse
s@CreateProjectResponse' {} Text
a -> CreateProjectResponse
s {$sel:arn:CreateProjectResponse' :: Text
arn = Text
a} :: CreateProjectResponse)

instance Prelude.NFData CreateProjectResponse