{-# 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.ImageBuilder.UpdateImagePipeline
-- 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)
--
-- Updates an image pipeline. Image pipelines enable you to automate the
-- creation and distribution of images.
--
-- UpdateImagePipeline does not support selective updates for the pipeline.
-- You must specify all of the required properties in the update request,
-- not just the properties that have changed.
module Amazonka.ImageBuilder.UpdateImagePipeline
  ( -- * Creating a Request
    UpdateImagePipeline (..),
    newUpdateImagePipeline,

    -- * Request Lenses
    updateImagePipeline_status,
    updateImagePipeline_containerRecipeArn,
    updateImagePipeline_imageTestsConfiguration,
    updateImagePipeline_schedule,
    updateImagePipeline_enhancedImageMetadataEnabled,
    updateImagePipeline_distributionConfigurationArn,
    updateImagePipeline_imageRecipeArn,
    updateImagePipeline_description,
    updateImagePipeline_imagePipelineArn,
    updateImagePipeline_infrastructureConfigurationArn,
    updateImagePipeline_clientToken,

    -- * Destructuring the Response
    UpdateImagePipelineResponse (..),
    newUpdateImagePipelineResponse,

    -- * Response Lenses
    updateImagePipelineResponse_requestId,
    updateImagePipelineResponse_clientToken,
    updateImagePipelineResponse_imagePipelineArn,
    updateImagePipelineResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types
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:/ 'newUpdateImagePipeline' smart constructor.
data UpdateImagePipeline = UpdateImagePipeline'
  { -- | The status of the image pipeline.
    UpdateImagePipeline -> Maybe PipelineStatus
status :: Prelude.Maybe PipelineStatus,
    -- | The Amazon Resource Name (ARN) of the container pipeline to update.
    UpdateImagePipeline -> Maybe Text
containerRecipeArn :: Prelude.Maybe Prelude.Text,
    -- | The image test configuration of the image pipeline.
    UpdateImagePipeline -> Maybe ImageTestsConfiguration
imageTestsConfiguration :: Prelude.Maybe ImageTestsConfiguration,
    -- | The schedule of the image pipeline.
    UpdateImagePipeline -> Maybe Schedule
schedule :: Prelude.Maybe Schedule,
    -- | Collects additional information about the image being created, including
    -- the operating system (OS) version and package list. This information is
    -- used to enhance the overall experience of using EC2 Image Builder.
    -- Enabled by default.
    UpdateImagePipeline -> Maybe Bool
enhancedImageMetadataEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) of the distribution configuration that
    -- will be used to configure and distribute images updated by this image
    -- pipeline.
    UpdateImagePipeline -> Maybe Text
distributionConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the image recipe that will be used to
    -- configure images updated by this image pipeline.
    UpdateImagePipeline -> Maybe Text
imageRecipeArn :: Prelude.Maybe Prelude.Text,
    -- | The description of the image pipeline.
    UpdateImagePipeline -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the image pipeline that you want to
    -- update.
    UpdateImagePipeline -> Text
imagePipelineArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the infrastructure configuration that
    -- will be used to build images updated by this image pipeline.
    UpdateImagePipeline -> Text
infrastructureConfigurationArn :: Prelude.Text,
    -- | The idempotency token used to make this request idempotent.
    UpdateImagePipeline -> Text
clientToken :: Prelude.Text
  }
  deriving (UpdateImagePipeline -> UpdateImagePipeline -> Bool
(UpdateImagePipeline -> UpdateImagePipeline -> Bool)
-> (UpdateImagePipeline -> UpdateImagePipeline -> Bool)
-> Eq UpdateImagePipeline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateImagePipeline -> UpdateImagePipeline -> Bool
$c/= :: UpdateImagePipeline -> UpdateImagePipeline -> Bool
== :: UpdateImagePipeline -> UpdateImagePipeline -> Bool
$c== :: UpdateImagePipeline -> UpdateImagePipeline -> Bool
Prelude.Eq, ReadPrec [UpdateImagePipeline]
ReadPrec UpdateImagePipeline
Int -> ReadS UpdateImagePipeline
ReadS [UpdateImagePipeline]
(Int -> ReadS UpdateImagePipeline)
-> ReadS [UpdateImagePipeline]
-> ReadPrec UpdateImagePipeline
-> ReadPrec [UpdateImagePipeline]
-> Read UpdateImagePipeline
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateImagePipeline]
$creadListPrec :: ReadPrec [UpdateImagePipeline]
readPrec :: ReadPrec UpdateImagePipeline
$creadPrec :: ReadPrec UpdateImagePipeline
readList :: ReadS [UpdateImagePipeline]
$creadList :: ReadS [UpdateImagePipeline]
readsPrec :: Int -> ReadS UpdateImagePipeline
$creadsPrec :: Int -> ReadS UpdateImagePipeline
Prelude.Read, Int -> UpdateImagePipeline -> ShowS
[UpdateImagePipeline] -> ShowS
UpdateImagePipeline -> String
(Int -> UpdateImagePipeline -> ShowS)
-> (UpdateImagePipeline -> String)
-> ([UpdateImagePipeline] -> ShowS)
-> Show UpdateImagePipeline
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateImagePipeline] -> ShowS
$cshowList :: [UpdateImagePipeline] -> ShowS
show :: UpdateImagePipeline -> String
$cshow :: UpdateImagePipeline -> String
showsPrec :: Int -> UpdateImagePipeline -> ShowS
$cshowsPrec :: Int -> UpdateImagePipeline -> ShowS
Prelude.Show, (forall x. UpdateImagePipeline -> Rep UpdateImagePipeline x)
-> (forall x. Rep UpdateImagePipeline x -> UpdateImagePipeline)
-> Generic UpdateImagePipeline
forall x. Rep UpdateImagePipeline x -> UpdateImagePipeline
forall x. UpdateImagePipeline -> Rep UpdateImagePipeline x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateImagePipeline x -> UpdateImagePipeline
$cfrom :: forall x. UpdateImagePipeline -> Rep UpdateImagePipeline x
Prelude.Generic)

-- |
-- Create a value of 'UpdateImagePipeline' 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:
--
-- 'status', 'updateImagePipeline_status' - The status of the image pipeline.
--
-- 'containerRecipeArn', 'updateImagePipeline_containerRecipeArn' - The Amazon Resource Name (ARN) of the container pipeline to update.
--
-- 'imageTestsConfiguration', 'updateImagePipeline_imageTestsConfiguration' - The image test configuration of the image pipeline.
--
-- 'schedule', 'updateImagePipeline_schedule' - The schedule of the image pipeline.
--
-- 'enhancedImageMetadataEnabled', 'updateImagePipeline_enhancedImageMetadataEnabled' - Collects additional information about the image being created, including
-- the operating system (OS) version and package list. This information is
-- used to enhance the overall experience of using EC2 Image Builder.
-- Enabled by default.
--
-- 'distributionConfigurationArn', 'updateImagePipeline_distributionConfigurationArn' - The Amazon Resource Name (ARN) of the distribution configuration that
-- will be used to configure and distribute images updated by this image
-- pipeline.
--
-- 'imageRecipeArn', 'updateImagePipeline_imageRecipeArn' - The Amazon Resource Name (ARN) of the image recipe that will be used to
-- configure images updated by this image pipeline.
--
-- 'description', 'updateImagePipeline_description' - The description of the image pipeline.
--
-- 'imagePipelineArn', 'updateImagePipeline_imagePipelineArn' - The Amazon Resource Name (ARN) of the image pipeline that you want to
-- update.
--
-- 'infrastructureConfigurationArn', 'updateImagePipeline_infrastructureConfigurationArn' - The Amazon Resource Name (ARN) of the infrastructure configuration that
-- will be used to build images updated by this image pipeline.
--
-- 'clientToken', 'updateImagePipeline_clientToken' - The idempotency token used to make this request idempotent.
newUpdateImagePipeline ::
  -- | 'imagePipelineArn'
  Prelude.Text ->
  -- | 'infrastructureConfigurationArn'
  Prelude.Text ->
  -- | 'clientToken'
  Prelude.Text ->
  UpdateImagePipeline
newUpdateImagePipeline :: Text -> Text -> Text -> UpdateImagePipeline
newUpdateImagePipeline
  Text
pImagePipelineArn_
  Text
pInfrastructureConfigurationArn_
  Text
pClientToken_ =
    UpdateImagePipeline' :: Maybe PipelineStatus
-> Maybe Text
-> Maybe ImageTestsConfiguration
-> Maybe Schedule
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> Text
-> UpdateImagePipeline
UpdateImagePipeline'
      { $sel:status:UpdateImagePipeline' :: Maybe PipelineStatus
status = Maybe PipelineStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:containerRecipeArn:UpdateImagePipeline' :: Maybe Text
containerRecipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:imageTestsConfiguration:UpdateImagePipeline' :: Maybe ImageTestsConfiguration
imageTestsConfiguration = Maybe ImageTestsConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:schedule:UpdateImagePipeline' :: Maybe Schedule
schedule = Maybe Schedule
forall a. Maybe a
Prelude.Nothing,
        $sel:enhancedImageMetadataEnabled:UpdateImagePipeline' :: Maybe Bool
enhancedImageMetadataEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:distributionConfigurationArn:UpdateImagePipeline' :: Maybe Text
distributionConfigurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:imageRecipeArn:UpdateImagePipeline' :: Maybe Text
imageRecipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateImagePipeline' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:imagePipelineArn:UpdateImagePipeline' :: Text
imagePipelineArn = Text
pImagePipelineArn_,
        $sel:infrastructureConfigurationArn:UpdateImagePipeline' :: Text
infrastructureConfigurationArn =
          Text
pInfrastructureConfigurationArn_,
        $sel:clientToken:UpdateImagePipeline' :: Text
clientToken = Text
pClientToken_
      }

-- | The status of the image pipeline.
updateImagePipeline_status :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe PipelineStatus)
updateImagePipeline_status :: (Maybe PipelineStatus -> f (Maybe PipelineStatus))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_status = (UpdateImagePipeline -> Maybe PipelineStatus)
-> (UpdateImagePipeline
    -> Maybe PipelineStatus -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline
     UpdateImagePipeline
     (Maybe PipelineStatus)
     (Maybe PipelineStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe PipelineStatus
status :: Maybe PipelineStatus
$sel:status:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe PipelineStatus
status} -> Maybe PipelineStatus
status) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe PipelineStatus
a -> UpdateImagePipeline
s {$sel:status:UpdateImagePipeline' :: Maybe PipelineStatus
status = Maybe PipelineStatus
a} :: UpdateImagePipeline)

-- | The Amazon Resource Name (ARN) of the container pipeline to update.
updateImagePipeline_containerRecipeArn :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe Prelude.Text)
updateImagePipeline_containerRecipeArn :: (Maybe Text -> f (Maybe Text))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_containerRecipeArn = (UpdateImagePipeline -> Maybe Text)
-> (UpdateImagePipeline -> Maybe Text -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline UpdateImagePipeline (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe Text
containerRecipeArn :: Maybe Text
$sel:containerRecipeArn:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
containerRecipeArn} -> Maybe Text
containerRecipeArn) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe Text
a -> UpdateImagePipeline
s {$sel:containerRecipeArn:UpdateImagePipeline' :: Maybe Text
containerRecipeArn = Maybe Text
a} :: UpdateImagePipeline)

-- | The image test configuration of the image pipeline.
updateImagePipeline_imageTestsConfiguration :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe ImageTestsConfiguration)
updateImagePipeline_imageTestsConfiguration :: (Maybe ImageTestsConfiguration
 -> f (Maybe ImageTestsConfiguration))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_imageTestsConfiguration = (UpdateImagePipeline -> Maybe ImageTestsConfiguration)
-> (UpdateImagePipeline
    -> Maybe ImageTestsConfiguration -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline
     UpdateImagePipeline
     (Maybe ImageTestsConfiguration)
     (Maybe ImageTestsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe ImageTestsConfiguration
imageTestsConfiguration :: Maybe ImageTestsConfiguration
$sel:imageTestsConfiguration:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe ImageTestsConfiguration
imageTestsConfiguration} -> Maybe ImageTestsConfiguration
imageTestsConfiguration) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe ImageTestsConfiguration
a -> UpdateImagePipeline
s {$sel:imageTestsConfiguration:UpdateImagePipeline' :: Maybe ImageTestsConfiguration
imageTestsConfiguration = Maybe ImageTestsConfiguration
a} :: UpdateImagePipeline)

-- | The schedule of the image pipeline.
updateImagePipeline_schedule :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe Schedule)
updateImagePipeline_schedule :: (Maybe Schedule -> f (Maybe Schedule))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_schedule = (UpdateImagePipeline -> Maybe Schedule)
-> (UpdateImagePipeline -> Maybe Schedule -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline
     UpdateImagePipeline
     (Maybe Schedule)
     (Maybe Schedule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe Schedule
schedule :: Maybe Schedule
$sel:schedule:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Schedule
schedule} -> Maybe Schedule
schedule) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe Schedule
a -> UpdateImagePipeline
s {$sel:schedule:UpdateImagePipeline' :: Maybe Schedule
schedule = Maybe Schedule
a} :: UpdateImagePipeline)

-- | Collects additional information about the image being created, including
-- the operating system (OS) version and package list. This information is
-- used to enhance the overall experience of using EC2 Image Builder.
-- Enabled by default.
updateImagePipeline_enhancedImageMetadataEnabled :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe Prelude.Bool)
updateImagePipeline_enhancedImageMetadataEnabled :: (Maybe Bool -> f (Maybe Bool))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_enhancedImageMetadataEnabled = (UpdateImagePipeline -> Maybe Bool)
-> (UpdateImagePipeline -> Maybe Bool -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline UpdateImagePipeline (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe Bool
enhancedImageMetadataEnabled :: Maybe Bool
$sel:enhancedImageMetadataEnabled:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Bool
enhancedImageMetadataEnabled} -> Maybe Bool
enhancedImageMetadataEnabled) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe Bool
a -> UpdateImagePipeline
s {$sel:enhancedImageMetadataEnabled:UpdateImagePipeline' :: Maybe Bool
enhancedImageMetadataEnabled = Maybe Bool
a} :: UpdateImagePipeline)

-- | The Amazon Resource Name (ARN) of the distribution configuration that
-- will be used to configure and distribute images updated by this image
-- pipeline.
updateImagePipeline_distributionConfigurationArn :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe Prelude.Text)
updateImagePipeline_distributionConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_distributionConfigurationArn = (UpdateImagePipeline -> Maybe Text)
-> (UpdateImagePipeline -> Maybe Text -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline UpdateImagePipeline (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe Text
distributionConfigurationArn :: Maybe Text
$sel:distributionConfigurationArn:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
distributionConfigurationArn} -> Maybe Text
distributionConfigurationArn) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe Text
a -> UpdateImagePipeline
s {$sel:distributionConfigurationArn:UpdateImagePipeline' :: Maybe Text
distributionConfigurationArn = Maybe Text
a} :: UpdateImagePipeline)

-- | The Amazon Resource Name (ARN) of the image recipe that will be used to
-- configure images updated by this image pipeline.
updateImagePipeline_imageRecipeArn :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe Prelude.Text)
updateImagePipeline_imageRecipeArn :: (Maybe Text -> f (Maybe Text))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_imageRecipeArn = (UpdateImagePipeline -> Maybe Text)
-> (UpdateImagePipeline -> Maybe Text -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline UpdateImagePipeline (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe Text
imageRecipeArn :: Maybe Text
$sel:imageRecipeArn:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
imageRecipeArn} -> Maybe Text
imageRecipeArn) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe Text
a -> UpdateImagePipeline
s {$sel:imageRecipeArn:UpdateImagePipeline' :: Maybe Text
imageRecipeArn = Maybe Text
a} :: UpdateImagePipeline)

-- | The description of the image pipeline.
updateImagePipeline_description :: Lens.Lens' UpdateImagePipeline (Prelude.Maybe Prelude.Text)
updateImagePipeline_description :: (Maybe Text -> f (Maybe Text))
-> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_description = (UpdateImagePipeline -> Maybe Text)
-> (UpdateImagePipeline -> Maybe Text -> UpdateImagePipeline)
-> Lens
     UpdateImagePipeline UpdateImagePipeline (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Maybe Text
description :: Maybe Text
$sel:description:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Maybe Text
a -> UpdateImagePipeline
s {$sel:description:UpdateImagePipeline' :: Maybe Text
description = Maybe Text
a} :: UpdateImagePipeline)

-- | The Amazon Resource Name (ARN) of the image pipeline that you want to
-- update.
updateImagePipeline_imagePipelineArn :: Lens.Lens' UpdateImagePipeline Prelude.Text
updateImagePipeline_imagePipelineArn :: (Text -> f Text) -> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_imagePipelineArn = (UpdateImagePipeline -> Text)
-> (UpdateImagePipeline -> Text -> UpdateImagePipeline)
-> Lens UpdateImagePipeline UpdateImagePipeline Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Text
imagePipelineArn :: Text
$sel:imagePipelineArn:UpdateImagePipeline' :: UpdateImagePipeline -> Text
imagePipelineArn} -> Text
imagePipelineArn) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Text
a -> UpdateImagePipeline
s {$sel:imagePipelineArn:UpdateImagePipeline' :: Text
imagePipelineArn = Text
a} :: UpdateImagePipeline)

-- | The Amazon Resource Name (ARN) of the infrastructure configuration that
-- will be used to build images updated by this image pipeline.
updateImagePipeline_infrastructureConfigurationArn :: Lens.Lens' UpdateImagePipeline Prelude.Text
updateImagePipeline_infrastructureConfigurationArn :: (Text -> f Text) -> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_infrastructureConfigurationArn = (UpdateImagePipeline -> Text)
-> (UpdateImagePipeline -> Text -> UpdateImagePipeline)
-> Lens UpdateImagePipeline UpdateImagePipeline Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Text
infrastructureConfigurationArn :: Text
$sel:infrastructureConfigurationArn:UpdateImagePipeline' :: UpdateImagePipeline -> Text
infrastructureConfigurationArn} -> Text
infrastructureConfigurationArn) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Text
a -> UpdateImagePipeline
s {$sel:infrastructureConfigurationArn:UpdateImagePipeline' :: Text
infrastructureConfigurationArn = Text
a} :: UpdateImagePipeline)

-- | The idempotency token used to make this request idempotent.
updateImagePipeline_clientToken :: Lens.Lens' UpdateImagePipeline Prelude.Text
updateImagePipeline_clientToken :: (Text -> f Text) -> UpdateImagePipeline -> f UpdateImagePipeline
updateImagePipeline_clientToken = (UpdateImagePipeline -> Text)
-> (UpdateImagePipeline -> Text -> UpdateImagePipeline)
-> Lens UpdateImagePipeline UpdateImagePipeline Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipeline' {Text
clientToken :: Text
$sel:clientToken:UpdateImagePipeline' :: UpdateImagePipeline -> Text
clientToken} -> Text
clientToken) (\s :: UpdateImagePipeline
s@UpdateImagePipeline' {} Text
a -> UpdateImagePipeline
s {$sel:clientToken:UpdateImagePipeline' :: Text
clientToken = Text
a} :: UpdateImagePipeline)

instance Core.AWSRequest UpdateImagePipeline where
  type
    AWSResponse UpdateImagePipeline =
      UpdateImagePipelineResponse
  request :: UpdateImagePipeline -> Request UpdateImagePipeline
request = Service -> UpdateImagePipeline -> Request UpdateImagePipeline
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateImagePipeline
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateImagePipeline)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateImagePipeline))
-> Logger
-> Service
-> Proxy UpdateImagePipeline
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateImagePipeline)))
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 -> Maybe Text -> Int -> UpdateImagePipelineResponse
UpdateImagePipelineResponse'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Int -> UpdateImagePipelineResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> UpdateImagePipelineResponse)
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
"requestId")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> UpdateImagePipelineResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> UpdateImagePipelineResponse)
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
"clientToken")
            Either String (Maybe Text -> Int -> UpdateImagePipelineResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateImagePipelineResponse)
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
"imagePipelineArn")
            Either String (Int -> UpdateImagePipelineResponse)
-> Either String Int -> Either String UpdateImagePipelineResponse
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 UpdateImagePipeline

instance Prelude.NFData UpdateImagePipeline

instance Core.ToHeaders UpdateImagePipeline where
  toHeaders :: UpdateImagePipeline -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateImagePipeline -> 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 UpdateImagePipeline where
  toJSON :: UpdateImagePipeline -> Value
toJSON UpdateImagePipeline' {Maybe Bool
Maybe Text
Maybe ImageTestsConfiguration
Maybe PipelineStatus
Maybe Schedule
Text
clientToken :: Text
infrastructureConfigurationArn :: Text
imagePipelineArn :: Text
description :: Maybe Text
imageRecipeArn :: Maybe Text
distributionConfigurationArn :: Maybe Text
enhancedImageMetadataEnabled :: Maybe Bool
schedule :: Maybe Schedule
imageTestsConfiguration :: Maybe ImageTestsConfiguration
containerRecipeArn :: Maybe Text
status :: Maybe PipelineStatus
$sel:clientToken:UpdateImagePipeline' :: UpdateImagePipeline -> Text
$sel:infrastructureConfigurationArn:UpdateImagePipeline' :: UpdateImagePipeline -> Text
$sel:imagePipelineArn:UpdateImagePipeline' :: UpdateImagePipeline -> Text
$sel:description:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
$sel:imageRecipeArn:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
$sel:distributionConfigurationArn:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
$sel:enhancedImageMetadataEnabled:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Bool
$sel:schedule:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Schedule
$sel:imageTestsConfiguration:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe ImageTestsConfiguration
$sel:containerRecipeArn:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe Text
$sel:status:UpdateImagePipeline' :: UpdateImagePipeline -> Maybe PipelineStatus
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"status" Text -> PipelineStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PipelineStatus -> Pair) -> Maybe PipelineStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PipelineStatus
status,
            (Text
"containerRecipeArn" 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
containerRecipeArn,
            (Text
"imageTestsConfiguration" Text -> ImageTestsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ImageTestsConfiguration -> Pair)
-> Maybe ImageTestsConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImageTestsConfiguration
imageTestsConfiguration,
            (Text
"schedule" Text -> Schedule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Schedule -> Pair) -> Maybe Schedule -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Schedule
schedule,
            (Text
"enhancedImageMetadataEnabled" 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
enhancedImageMetadataEnabled,
            (Text
"distributionConfigurationArn" 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
distributionConfigurationArn,
            (Text
"imageRecipeArn" 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
imageRecipeArn,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"imagePipelineArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imagePipelineArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"infrastructureConfigurationArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
infrastructureConfigurationArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

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

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

-- | /See:/ 'newUpdateImagePipelineResponse' smart constructor.
data UpdateImagePipelineResponse = UpdateImagePipelineResponse'
  { -- | The request ID that uniquely identifies this request.
    UpdateImagePipelineResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The idempotency token used to make this request idempotent.
    UpdateImagePipelineResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the image pipeline that was updated by
    -- this request.
    UpdateImagePipelineResponse -> Maybe Text
imagePipelineArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateImagePipelineResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateImagePipelineResponse -> UpdateImagePipelineResponse -> Bool
(UpdateImagePipelineResponse
 -> UpdateImagePipelineResponse -> Bool)
-> (UpdateImagePipelineResponse
    -> UpdateImagePipelineResponse -> Bool)
-> Eq UpdateImagePipelineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateImagePipelineResponse -> UpdateImagePipelineResponse -> Bool
$c/= :: UpdateImagePipelineResponse -> UpdateImagePipelineResponse -> Bool
== :: UpdateImagePipelineResponse -> UpdateImagePipelineResponse -> Bool
$c== :: UpdateImagePipelineResponse -> UpdateImagePipelineResponse -> Bool
Prelude.Eq, ReadPrec [UpdateImagePipelineResponse]
ReadPrec UpdateImagePipelineResponse
Int -> ReadS UpdateImagePipelineResponse
ReadS [UpdateImagePipelineResponse]
(Int -> ReadS UpdateImagePipelineResponse)
-> ReadS [UpdateImagePipelineResponse]
-> ReadPrec UpdateImagePipelineResponse
-> ReadPrec [UpdateImagePipelineResponse]
-> Read UpdateImagePipelineResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateImagePipelineResponse]
$creadListPrec :: ReadPrec [UpdateImagePipelineResponse]
readPrec :: ReadPrec UpdateImagePipelineResponse
$creadPrec :: ReadPrec UpdateImagePipelineResponse
readList :: ReadS [UpdateImagePipelineResponse]
$creadList :: ReadS [UpdateImagePipelineResponse]
readsPrec :: Int -> ReadS UpdateImagePipelineResponse
$creadsPrec :: Int -> ReadS UpdateImagePipelineResponse
Prelude.Read, Int -> UpdateImagePipelineResponse -> ShowS
[UpdateImagePipelineResponse] -> ShowS
UpdateImagePipelineResponse -> String
(Int -> UpdateImagePipelineResponse -> ShowS)
-> (UpdateImagePipelineResponse -> String)
-> ([UpdateImagePipelineResponse] -> ShowS)
-> Show UpdateImagePipelineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateImagePipelineResponse] -> ShowS
$cshowList :: [UpdateImagePipelineResponse] -> ShowS
show :: UpdateImagePipelineResponse -> String
$cshow :: UpdateImagePipelineResponse -> String
showsPrec :: Int -> UpdateImagePipelineResponse -> ShowS
$cshowsPrec :: Int -> UpdateImagePipelineResponse -> ShowS
Prelude.Show, (forall x.
 UpdateImagePipelineResponse -> Rep UpdateImagePipelineResponse x)
-> (forall x.
    Rep UpdateImagePipelineResponse x -> UpdateImagePipelineResponse)
-> Generic UpdateImagePipelineResponse
forall x.
Rep UpdateImagePipelineResponse x -> UpdateImagePipelineResponse
forall x.
UpdateImagePipelineResponse -> Rep UpdateImagePipelineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateImagePipelineResponse x -> UpdateImagePipelineResponse
$cfrom :: forall x.
UpdateImagePipelineResponse -> Rep UpdateImagePipelineResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateImagePipelineResponse' 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:
--
-- 'requestId', 'updateImagePipelineResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'clientToken', 'updateImagePipelineResponse_clientToken' - The idempotency token used to make this request idempotent.
--
-- 'imagePipelineArn', 'updateImagePipelineResponse_imagePipelineArn' - The Amazon Resource Name (ARN) of the image pipeline that was updated by
-- this request.
--
-- 'httpStatus', 'updateImagePipelineResponse_httpStatus' - The response's http status code.
newUpdateImagePipelineResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateImagePipelineResponse
newUpdateImagePipelineResponse :: Int -> UpdateImagePipelineResponse
newUpdateImagePipelineResponse Int
pHttpStatus_ =
  UpdateImagePipelineResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> UpdateImagePipelineResponse
UpdateImagePipelineResponse'
    { $sel:requestId:UpdateImagePipelineResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:UpdateImagePipelineResponse' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imagePipelineArn:UpdateImagePipelineResponse' :: Maybe Text
imagePipelineArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateImagePipelineResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The request ID that uniquely identifies this request.
updateImagePipelineResponse_requestId :: Lens.Lens' UpdateImagePipelineResponse (Prelude.Maybe Prelude.Text)
updateImagePipelineResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> UpdateImagePipelineResponse -> f UpdateImagePipelineResponse
updateImagePipelineResponse_requestId = (UpdateImagePipelineResponse -> Maybe Text)
-> (UpdateImagePipelineResponse
    -> Maybe Text -> UpdateImagePipelineResponse)
-> Lens
     UpdateImagePipelineResponse
     UpdateImagePipelineResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipelineResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdateImagePipelineResponse' :: UpdateImagePipelineResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdateImagePipelineResponse
s@UpdateImagePipelineResponse' {} Maybe Text
a -> UpdateImagePipelineResponse
s {$sel:requestId:UpdateImagePipelineResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdateImagePipelineResponse)

-- | The idempotency token used to make this request idempotent.
updateImagePipelineResponse_clientToken :: Lens.Lens' UpdateImagePipelineResponse (Prelude.Maybe Prelude.Text)
updateImagePipelineResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateImagePipelineResponse -> f UpdateImagePipelineResponse
updateImagePipelineResponse_clientToken = (UpdateImagePipelineResponse -> Maybe Text)
-> (UpdateImagePipelineResponse
    -> Maybe Text -> UpdateImagePipelineResponse)
-> Lens
     UpdateImagePipelineResponse
     UpdateImagePipelineResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipelineResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateImagePipelineResponse' :: UpdateImagePipelineResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateImagePipelineResponse
s@UpdateImagePipelineResponse' {} Maybe Text
a -> UpdateImagePipelineResponse
s {$sel:clientToken:UpdateImagePipelineResponse' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateImagePipelineResponse)

-- | The Amazon Resource Name (ARN) of the image pipeline that was updated by
-- this request.
updateImagePipelineResponse_imagePipelineArn :: Lens.Lens' UpdateImagePipelineResponse (Prelude.Maybe Prelude.Text)
updateImagePipelineResponse_imagePipelineArn :: (Maybe Text -> f (Maybe Text))
-> UpdateImagePipelineResponse -> f UpdateImagePipelineResponse
updateImagePipelineResponse_imagePipelineArn = (UpdateImagePipelineResponse -> Maybe Text)
-> (UpdateImagePipelineResponse
    -> Maybe Text -> UpdateImagePipelineResponse)
-> Lens
     UpdateImagePipelineResponse
     UpdateImagePipelineResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImagePipelineResponse' {Maybe Text
imagePipelineArn :: Maybe Text
$sel:imagePipelineArn:UpdateImagePipelineResponse' :: UpdateImagePipelineResponse -> Maybe Text
imagePipelineArn} -> Maybe Text
imagePipelineArn) (\s :: UpdateImagePipelineResponse
s@UpdateImagePipelineResponse' {} Maybe Text
a -> UpdateImagePipelineResponse
s {$sel:imagePipelineArn:UpdateImagePipelineResponse' :: Maybe Text
imagePipelineArn = Maybe Text
a} :: UpdateImagePipelineResponse)

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

instance Prelude.NFData UpdateImagePipelineResponse