{-# 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.SecurityHub.Types.AwsCodeBuildProjectEnvironment
-- 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.SecurityHub.Types.AwsCodeBuildProjectEnvironment where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails
import Amazonka.SecurityHub.Types.AwsCodeBuildProjectEnvironmentRegistryCredential

-- | Information about the build environment for this build project.
--
-- /See:/ 'newAwsCodeBuildProjectEnvironment' smart constructor.
data AwsCodeBuildProjectEnvironment = AwsCodeBuildProjectEnvironment'
  { -- | The type of credentials CodeBuild uses to pull images in your build.
    --
    -- Valid values:
    --
    -- -   @CODEBUILD@ specifies that CodeBuild uses its own credentials. This
    --     requires that you modify your ECR repository policy to trust the
    --     CodeBuild service principal.
    --
    -- -   @SERVICE_ROLE@ specifies that CodeBuild uses your build project\'s
    --     service role.
    --
    -- When you use a cross-account or private registry image, you must use
    -- @SERVICE_ROLE@ credentials. When you use an CodeBuild curated image, you
    -- must use @CODEBUILD@ credentials.
    AwsCodeBuildProjectEnvironment -> Maybe Text
imagePullCredentialsType :: Prelude.Maybe Prelude.Text,
    -- | Whether to allow the Docker daemon to run inside a Docker container. Set
    -- to @true@ if the build project is used to build Docker images.
    AwsCodeBuildProjectEnvironment -> Maybe Bool
privilegedMode :: Prelude.Maybe Prelude.Bool,
    -- | The credentials for access to a private registry.
    AwsCodeBuildProjectEnvironment
-> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
registryCredential :: Prelude.Maybe AwsCodeBuildProjectEnvironmentRegistryCredential,
    -- | The certificate to use with this build project.
    AwsCodeBuildProjectEnvironment -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
    -- | A set of environment variables to make available to builds for the build
    -- project.
    AwsCodeBuildProjectEnvironment
-> Maybe
     [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
environmentVariables :: Prelude.Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails],
    -- | The type of build environment to use for related builds.
    --
    -- The environment type @ARM_CONTAINER@ is available only in Regions US
    -- East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland),
    -- Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and
    -- Europe (Frankfurt).
    --
    -- The environment type @LINUX_CONTAINER@ with compute type
    -- build.general1.2xlarge is available only in Regions US East (N.
    -- Virginia), US East (N. Virginia), US West (Oregon), Canada (Central),
    -- Europe (Ireland), Europe (London), Europe (Frankfurt), Asia Pacific
    -- (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific
    -- (Sydney), China (Beijing), and China (Ningxia).
    --
    -- The environment type @LINUX_GPU_CONTAINER@ is available only in Regions
    -- US East (N. Virginia), US East (N. Virginia), US West (Oregon), Canada
    -- (Central), Europe (Ireland), Europe (London), Europe (Frankfurt), Asia
    -- Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia
    -- Pacific (Sydney), China (Beijing), and China (Ningxia).
    --
    -- Valid values: @WINDOWS_CONTAINER@ | @LINUX_CONTAINER@ |
    -- @LINUX_GPU_CONTAINER@ | @ARM_CONTAINER@
    AwsCodeBuildProjectEnvironment -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsCodeBuildProjectEnvironment
-> AwsCodeBuildProjectEnvironment -> Bool
(AwsCodeBuildProjectEnvironment
 -> AwsCodeBuildProjectEnvironment -> Bool)
-> (AwsCodeBuildProjectEnvironment
    -> AwsCodeBuildProjectEnvironment -> Bool)
-> Eq AwsCodeBuildProjectEnvironment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCodeBuildProjectEnvironment
-> AwsCodeBuildProjectEnvironment -> Bool
$c/= :: AwsCodeBuildProjectEnvironment
-> AwsCodeBuildProjectEnvironment -> Bool
== :: AwsCodeBuildProjectEnvironment
-> AwsCodeBuildProjectEnvironment -> Bool
$c== :: AwsCodeBuildProjectEnvironment
-> AwsCodeBuildProjectEnvironment -> Bool
Prelude.Eq, ReadPrec [AwsCodeBuildProjectEnvironment]
ReadPrec AwsCodeBuildProjectEnvironment
Int -> ReadS AwsCodeBuildProjectEnvironment
ReadS [AwsCodeBuildProjectEnvironment]
(Int -> ReadS AwsCodeBuildProjectEnvironment)
-> ReadS [AwsCodeBuildProjectEnvironment]
-> ReadPrec AwsCodeBuildProjectEnvironment
-> ReadPrec [AwsCodeBuildProjectEnvironment]
-> Read AwsCodeBuildProjectEnvironment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCodeBuildProjectEnvironment]
$creadListPrec :: ReadPrec [AwsCodeBuildProjectEnvironment]
readPrec :: ReadPrec AwsCodeBuildProjectEnvironment
$creadPrec :: ReadPrec AwsCodeBuildProjectEnvironment
readList :: ReadS [AwsCodeBuildProjectEnvironment]
$creadList :: ReadS [AwsCodeBuildProjectEnvironment]
readsPrec :: Int -> ReadS AwsCodeBuildProjectEnvironment
$creadsPrec :: Int -> ReadS AwsCodeBuildProjectEnvironment
Prelude.Read, Int -> AwsCodeBuildProjectEnvironment -> ShowS
[AwsCodeBuildProjectEnvironment] -> ShowS
AwsCodeBuildProjectEnvironment -> String
(Int -> AwsCodeBuildProjectEnvironment -> ShowS)
-> (AwsCodeBuildProjectEnvironment -> String)
-> ([AwsCodeBuildProjectEnvironment] -> ShowS)
-> Show AwsCodeBuildProjectEnvironment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCodeBuildProjectEnvironment] -> ShowS
$cshowList :: [AwsCodeBuildProjectEnvironment] -> ShowS
show :: AwsCodeBuildProjectEnvironment -> String
$cshow :: AwsCodeBuildProjectEnvironment -> String
showsPrec :: Int -> AwsCodeBuildProjectEnvironment -> ShowS
$cshowsPrec :: Int -> AwsCodeBuildProjectEnvironment -> ShowS
Prelude.Show, (forall x.
 AwsCodeBuildProjectEnvironment
 -> Rep AwsCodeBuildProjectEnvironment x)
-> (forall x.
    Rep AwsCodeBuildProjectEnvironment x
    -> AwsCodeBuildProjectEnvironment)
-> Generic AwsCodeBuildProjectEnvironment
forall x.
Rep AwsCodeBuildProjectEnvironment x
-> AwsCodeBuildProjectEnvironment
forall x.
AwsCodeBuildProjectEnvironment
-> Rep AwsCodeBuildProjectEnvironment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCodeBuildProjectEnvironment x
-> AwsCodeBuildProjectEnvironment
$cfrom :: forall x.
AwsCodeBuildProjectEnvironment
-> Rep AwsCodeBuildProjectEnvironment x
Prelude.Generic)

-- |
-- Create a value of 'AwsCodeBuildProjectEnvironment' 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:
--
-- 'imagePullCredentialsType', 'awsCodeBuildProjectEnvironment_imagePullCredentialsType' - The type of credentials CodeBuild uses to pull images in your build.
--
-- Valid values:
--
-- -   @CODEBUILD@ specifies that CodeBuild uses its own credentials. This
--     requires that you modify your ECR repository policy to trust the
--     CodeBuild service principal.
--
-- -   @SERVICE_ROLE@ specifies that CodeBuild uses your build project\'s
--     service role.
--
-- When you use a cross-account or private registry image, you must use
-- @SERVICE_ROLE@ credentials. When you use an CodeBuild curated image, you
-- must use @CODEBUILD@ credentials.
--
-- 'privilegedMode', 'awsCodeBuildProjectEnvironment_privilegedMode' - Whether to allow the Docker daemon to run inside a Docker container. Set
-- to @true@ if the build project is used to build Docker images.
--
-- 'registryCredential', 'awsCodeBuildProjectEnvironment_registryCredential' - The credentials for access to a private registry.
--
-- 'certificate', 'awsCodeBuildProjectEnvironment_certificate' - The certificate to use with this build project.
--
-- 'environmentVariables', 'awsCodeBuildProjectEnvironment_environmentVariables' - A set of environment variables to make available to builds for the build
-- project.
--
-- 'type'', 'awsCodeBuildProjectEnvironment_type' - The type of build environment to use for related builds.
--
-- The environment type @ARM_CONTAINER@ is available only in Regions US
-- East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland),
-- Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and
-- Europe (Frankfurt).
--
-- The environment type @LINUX_CONTAINER@ with compute type
-- build.general1.2xlarge is available only in Regions US East (N.
-- Virginia), US East (N. Virginia), US West (Oregon), Canada (Central),
-- Europe (Ireland), Europe (London), Europe (Frankfurt), Asia Pacific
-- (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific
-- (Sydney), China (Beijing), and China (Ningxia).
--
-- The environment type @LINUX_GPU_CONTAINER@ is available only in Regions
-- US East (N. Virginia), US East (N. Virginia), US West (Oregon), Canada
-- (Central), Europe (Ireland), Europe (London), Europe (Frankfurt), Asia
-- Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia
-- Pacific (Sydney), China (Beijing), and China (Ningxia).
--
-- Valid values: @WINDOWS_CONTAINER@ | @LINUX_CONTAINER@ |
-- @LINUX_GPU_CONTAINER@ | @ARM_CONTAINER@
newAwsCodeBuildProjectEnvironment ::
  AwsCodeBuildProjectEnvironment
newAwsCodeBuildProjectEnvironment :: AwsCodeBuildProjectEnvironment
newAwsCodeBuildProjectEnvironment =
  AwsCodeBuildProjectEnvironment' :: Maybe Text
-> Maybe Bool
-> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
-> Maybe Text
-> Maybe
     [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
-> Maybe Text
-> AwsCodeBuildProjectEnvironment
AwsCodeBuildProjectEnvironment'
    { $sel:imagePullCredentialsType:AwsCodeBuildProjectEnvironment' :: Maybe Text
imagePullCredentialsType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:privilegedMode:AwsCodeBuildProjectEnvironment' :: Maybe Bool
privilegedMode = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:registryCredential:AwsCodeBuildProjectEnvironment' :: Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
registryCredential = Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
forall a. Maybe a
Prelude.Nothing,
      $sel:certificate:AwsCodeBuildProjectEnvironment' :: Maybe Text
certificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentVariables:AwsCodeBuildProjectEnvironment' :: Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
environmentVariables = Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
forall a. Maybe a
Prelude.Nothing,
      $sel:type':AwsCodeBuildProjectEnvironment' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of credentials CodeBuild uses to pull images in your build.
--
-- Valid values:
--
-- -   @CODEBUILD@ specifies that CodeBuild uses its own credentials. This
--     requires that you modify your ECR repository policy to trust the
--     CodeBuild service principal.
--
-- -   @SERVICE_ROLE@ specifies that CodeBuild uses your build project\'s
--     service role.
--
-- When you use a cross-account or private registry image, you must use
-- @SERVICE_ROLE@ credentials. When you use an CodeBuild curated image, you
-- must use @CODEBUILD@ credentials.
awsCodeBuildProjectEnvironment_imagePullCredentialsType :: Lens.Lens' AwsCodeBuildProjectEnvironment (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectEnvironment_imagePullCredentialsType :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectEnvironment
-> f AwsCodeBuildProjectEnvironment
awsCodeBuildProjectEnvironment_imagePullCredentialsType = (AwsCodeBuildProjectEnvironment -> Maybe Text)
-> (AwsCodeBuildProjectEnvironment
    -> Maybe Text -> AwsCodeBuildProjectEnvironment)
-> Lens
     AwsCodeBuildProjectEnvironment
     AwsCodeBuildProjectEnvironment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectEnvironment' {Maybe Text
imagePullCredentialsType :: Maybe Text
$sel:imagePullCredentialsType:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Text
imagePullCredentialsType} -> Maybe Text
imagePullCredentialsType) (\s :: AwsCodeBuildProjectEnvironment
s@AwsCodeBuildProjectEnvironment' {} Maybe Text
a -> AwsCodeBuildProjectEnvironment
s {$sel:imagePullCredentialsType:AwsCodeBuildProjectEnvironment' :: Maybe Text
imagePullCredentialsType = Maybe Text
a} :: AwsCodeBuildProjectEnvironment)

-- | Whether to allow the Docker daemon to run inside a Docker container. Set
-- to @true@ if the build project is used to build Docker images.
awsCodeBuildProjectEnvironment_privilegedMode :: Lens.Lens' AwsCodeBuildProjectEnvironment (Prelude.Maybe Prelude.Bool)
awsCodeBuildProjectEnvironment_privilegedMode :: (Maybe Bool -> f (Maybe Bool))
-> AwsCodeBuildProjectEnvironment
-> f AwsCodeBuildProjectEnvironment
awsCodeBuildProjectEnvironment_privilegedMode = (AwsCodeBuildProjectEnvironment -> Maybe Bool)
-> (AwsCodeBuildProjectEnvironment
    -> Maybe Bool -> AwsCodeBuildProjectEnvironment)
-> Lens
     AwsCodeBuildProjectEnvironment
     AwsCodeBuildProjectEnvironment
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectEnvironment' {Maybe Bool
privilegedMode :: Maybe Bool
$sel:privilegedMode:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Bool
privilegedMode} -> Maybe Bool
privilegedMode) (\s :: AwsCodeBuildProjectEnvironment
s@AwsCodeBuildProjectEnvironment' {} Maybe Bool
a -> AwsCodeBuildProjectEnvironment
s {$sel:privilegedMode:AwsCodeBuildProjectEnvironment' :: Maybe Bool
privilegedMode = Maybe Bool
a} :: AwsCodeBuildProjectEnvironment)

-- | The credentials for access to a private registry.
awsCodeBuildProjectEnvironment_registryCredential :: Lens.Lens' AwsCodeBuildProjectEnvironment (Prelude.Maybe AwsCodeBuildProjectEnvironmentRegistryCredential)
awsCodeBuildProjectEnvironment_registryCredential :: (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
 -> f (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential))
-> AwsCodeBuildProjectEnvironment
-> f AwsCodeBuildProjectEnvironment
awsCodeBuildProjectEnvironment_registryCredential = (AwsCodeBuildProjectEnvironment
 -> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential)
-> (AwsCodeBuildProjectEnvironment
    -> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
    -> AwsCodeBuildProjectEnvironment)
-> Lens
     AwsCodeBuildProjectEnvironment
     AwsCodeBuildProjectEnvironment
     (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential)
     (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectEnvironment' {Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
registryCredential :: Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
$sel:registryCredential:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment
-> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
registryCredential} -> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
registryCredential) (\s :: AwsCodeBuildProjectEnvironment
s@AwsCodeBuildProjectEnvironment' {} Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
a -> AwsCodeBuildProjectEnvironment
s {$sel:registryCredential:AwsCodeBuildProjectEnvironment' :: Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
registryCredential = Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
a} :: AwsCodeBuildProjectEnvironment)

-- | The certificate to use with this build project.
awsCodeBuildProjectEnvironment_certificate :: Lens.Lens' AwsCodeBuildProjectEnvironment (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectEnvironment_certificate :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectEnvironment
-> f AwsCodeBuildProjectEnvironment
awsCodeBuildProjectEnvironment_certificate = (AwsCodeBuildProjectEnvironment -> Maybe Text)
-> (AwsCodeBuildProjectEnvironment
    -> Maybe Text -> AwsCodeBuildProjectEnvironment)
-> Lens
     AwsCodeBuildProjectEnvironment
     AwsCodeBuildProjectEnvironment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectEnvironment' {Maybe Text
certificate :: Maybe Text
$sel:certificate:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: AwsCodeBuildProjectEnvironment
s@AwsCodeBuildProjectEnvironment' {} Maybe Text
a -> AwsCodeBuildProjectEnvironment
s {$sel:certificate:AwsCodeBuildProjectEnvironment' :: Maybe Text
certificate = Maybe Text
a} :: AwsCodeBuildProjectEnvironment)

-- | A set of environment variables to make available to builds for the build
-- project.
awsCodeBuildProjectEnvironment_environmentVariables :: Lens.Lens' AwsCodeBuildProjectEnvironment (Prelude.Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
awsCodeBuildProjectEnvironment_environmentVariables :: (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
 -> f (Maybe
         [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]))
-> AwsCodeBuildProjectEnvironment
-> f AwsCodeBuildProjectEnvironment
awsCodeBuildProjectEnvironment_environmentVariables = (AwsCodeBuildProjectEnvironment
 -> Maybe
      [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
-> (AwsCodeBuildProjectEnvironment
    -> Maybe
         [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
    -> AwsCodeBuildProjectEnvironment)
-> Lens
     AwsCodeBuildProjectEnvironment
     AwsCodeBuildProjectEnvironment
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectEnvironment' {Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
environmentVariables :: Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
$sel:environmentVariables:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment
-> Maybe
     [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
environmentVariables} -> Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
environmentVariables) (\s :: AwsCodeBuildProjectEnvironment
s@AwsCodeBuildProjectEnvironment' {} Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
a -> AwsCodeBuildProjectEnvironment
s {$sel:environmentVariables:AwsCodeBuildProjectEnvironment' :: Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
environmentVariables = Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
a} :: AwsCodeBuildProjectEnvironment) ((Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
  -> f (Maybe
          [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]))
 -> AwsCodeBuildProjectEnvironment
 -> f AwsCodeBuildProjectEnvironment)
-> ((Maybe
       [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
     -> f (Maybe
             [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]))
    -> Maybe
         [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
    -> f (Maybe
            [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]))
-> (Maybe
      [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
    -> f (Maybe
            [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]))
-> AwsCodeBuildProjectEnvironment
-> f AwsCodeBuildProjectEnvironment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
-> Iso
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
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
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
  [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of build environment to use for related builds.
--
-- The environment type @ARM_CONTAINER@ is available only in Regions US
-- East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland),
-- Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and
-- Europe (Frankfurt).
--
-- The environment type @LINUX_CONTAINER@ with compute type
-- build.general1.2xlarge is available only in Regions US East (N.
-- Virginia), US East (N. Virginia), US West (Oregon), Canada (Central),
-- Europe (Ireland), Europe (London), Europe (Frankfurt), Asia Pacific
-- (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific
-- (Sydney), China (Beijing), and China (Ningxia).
--
-- The environment type @LINUX_GPU_CONTAINER@ is available only in Regions
-- US East (N. Virginia), US East (N. Virginia), US West (Oregon), Canada
-- (Central), Europe (Ireland), Europe (London), Europe (Frankfurt), Asia
-- Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia
-- Pacific (Sydney), China (Beijing), and China (Ningxia).
--
-- Valid values: @WINDOWS_CONTAINER@ | @LINUX_CONTAINER@ |
-- @LINUX_GPU_CONTAINER@ | @ARM_CONTAINER@
awsCodeBuildProjectEnvironment_type :: Lens.Lens' AwsCodeBuildProjectEnvironment (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectEnvironment_type :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectEnvironment
-> f AwsCodeBuildProjectEnvironment
awsCodeBuildProjectEnvironment_type = (AwsCodeBuildProjectEnvironment -> Maybe Text)
-> (AwsCodeBuildProjectEnvironment
    -> Maybe Text -> AwsCodeBuildProjectEnvironment)
-> Lens
     AwsCodeBuildProjectEnvironment
     AwsCodeBuildProjectEnvironment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectEnvironment' {Maybe Text
type' :: Maybe Text
$sel:type':AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Text
type'} -> Maybe Text
type') (\s :: AwsCodeBuildProjectEnvironment
s@AwsCodeBuildProjectEnvironment' {} Maybe Text
a -> AwsCodeBuildProjectEnvironment
s {$sel:type':AwsCodeBuildProjectEnvironment' :: Maybe Text
type' = Maybe Text
a} :: AwsCodeBuildProjectEnvironment)

instance Core.FromJSON AwsCodeBuildProjectEnvironment where
  parseJSON :: Value -> Parser AwsCodeBuildProjectEnvironment
parseJSON =
    String
-> (Object -> Parser AwsCodeBuildProjectEnvironment)
-> Value
-> Parser AwsCodeBuildProjectEnvironment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsCodeBuildProjectEnvironment"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
-> Maybe Text
-> Maybe
     [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
-> Maybe Text
-> AwsCodeBuildProjectEnvironment
AwsCodeBuildProjectEnvironment'
            (Maybe Text
 -> Maybe Bool
 -> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
 -> Maybe Text
 -> Maybe
      [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
 -> Maybe Text
 -> AwsCodeBuildProjectEnvironment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
      -> Maybe Text
      -> Maybe
           [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
      -> Maybe Text
      -> AwsCodeBuildProjectEnvironment)
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
"ImagePullCredentialsType")
            Parser
  (Maybe Bool
   -> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
   -> Maybe Text
   -> Maybe
        [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
   -> Maybe Text
   -> AwsCodeBuildProjectEnvironment)
-> Parser (Maybe Bool)
-> Parser
     (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
      -> Maybe Text
      -> Maybe
           [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
      -> Maybe Text
      -> AwsCodeBuildProjectEnvironment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PrivilegedMode")
            Parser
  (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
   -> Maybe Text
   -> Maybe
        [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
   -> Maybe Text
   -> AwsCodeBuildProjectEnvironment)
-> Parser (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential)
-> Parser
     (Maybe Text
      -> Maybe
           [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
      -> Maybe Text
      -> AwsCodeBuildProjectEnvironment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe AwsCodeBuildProjectEnvironmentRegistryCredential)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RegistryCredential")
            Parser
  (Maybe Text
   -> Maybe
        [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
   -> Maybe Text
   -> AwsCodeBuildProjectEnvironment)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
      -> Maybe Text -> AwsCodeBuildProjectEnvironment)
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
"Certificate")
            Parser
  (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
   -> Maybe Text -> AwsCodeBuildProjectEnvironment)
-> Parser
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
-> Parser (Maybe Text -> AwsCodeBuildProjectEnvironment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser
     (Maybe
        (Maybe
           [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnvironmentVariables"
                            Parser
  (Maybe
     (Maybe
        [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]))
-> Maybe
     [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
-> Parser
     (Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> AwsCodeBuildProjectEnvironment)
-> Parser (Maybe Text) -> Parser AwsCodeBuildProjectEnvironment
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
"Type")
      )

instance
  Prelude.Hashable
    AwsCodeBuildProjectEnvironment

instance
  Prelude.NFData
    AwsCodeBuildProjectEnvironment

instance Core.ToJSON AwsCodeBuildProjectEnvironment where
  toJSON :: AwsCodeBuildProjectEnvironment -> Value
toJSON AwsCodeBuildProjectEnvironment' {Maybe Bool
Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
Maybe Text
Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
type' :: Maybe Text
environmentVariables :: Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
certificate :: Maybe Text
registryCredential :: Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
privilegedMode :: Maybe Bool
imagePullCredentialsType :: Maybe Text
$sel:type':AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Text
$sel:environmentVariables:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment
-> Maybe
     [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
$sel:certificate:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Text
$sel:registryCredential:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment
-> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
$sel:privilegedMode:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Bool
$sel:imagePullCredentialsType:AwsCodeBuildProjectEnvironment' :: AwsCodeBuildProjectEnvironment -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ImagePullCredentialsType" 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
imagePullCredentialsType,
            (Text
"PrivilegedMode" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
privilegedMode,
            (Text
"RegistryCredential" Text -> AwsCodeBuildProjectEnvironmentRegistryCredential -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsCodeBuildProjectEnvironmentRegistryCredential -> Pair)
-> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsCodeBuildProjectEnvironmentRegistryCredential
registryCredential,
            (Text
"Certificate" 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
certificate,
            (Text
"EnvironmentVariables" Text
-> [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
 -> Pair)
-> Maybe
     [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsCodeBuildProjectEnvironmentEnvironmentVariablesDetails]
environmentVariables,
            (Text
"Type" 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
type'
          ]
      )