{-# 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.DataPipeline.ValidatePipelineDefinition
-- 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)
--
-- Validates the specified pipeline definition to ensure that it is well
-- formed and can be run without error.
module Amazonka.DataPipeline.ValidatePipelineDefinition
  ( -- * Creating a Request
    ValidatePipelineDefinition (..),
    newValidatePipelineDefinition,

    -- * Request Lenses
    validatePipelineDefinition_parameterObjects,
    validatePipelineDefinition_parameterValues,
    validatePipelineDefinition_pipelineId,
    validatePipelineDefinition_pipelineObjects,

    -- * Destructuring the Response
    ValidatePipelineDefinitionResponse (..),
    newValidatePipelineDefinitionResponse,

    -- * Response Lenses
    validatePipelineDefinitionResponse_validationErrors,
    validatePipelineDefinitionResponse_validationWarnings,
    validatePipelineDefinitionResponse_httpStatus,
    validatePipelineDefinitionResponse_errored,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataPipeline.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

-- | Contains the parameters for ValidatePipelineDefinition.
--
-- /See:/ 'newValidatePipelineDefinition' smart constructor.
data ValidatePipelineDefinition = ValidatePipelineDefinition'
  { -- | The parameter objects used with the pipeline.
    ValidatePipelineDefinition -> Maybe [ParameterObject]
parameterObjects :: Prelude.Maybe [ParameterObject],
    -- | The parameter values used with the pipeline.
    ValidatePipelineDefinition -> Maybe [ParameterValue]
parameterValues :: Prelude.Maybe [ParameterValue],
    -- | The ID of the pipeline.
    ValidatePipelineDefinition -> Text
pipelineId :: Prelude.Text,
    -- | The objects that define the pipeline changes to validate against the
    -- pipeline.
    ValidatePipelineDefinition -> [PipelineObject]
pipelineObjects :: [PipelineObject]
  }
  deriving (ValidatePipelineDefinition -> ValidatePipelineDefinition -> Bool
(ValidatePipelineDefinition -> ValidatePipelineDefinition -> Bool)
-> (ValidatePipelineDefinition
    -> ValidatePipelineDefinition -> Bool)
-> Eq ValidatePipelineDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidatePipelineDefinition -> ValidatePipelineDefinition -> Bool
$c/= :: ValidatePipelineDefinition -> ValidatePipelineDefinition -> Bool
== :: ValidatePipelineDefinition -> ValidatePipelineDefinition -> Bool
$c== :: ValidatePipelineDefinition -> ValidatePipelineDefinition -> Bool
Prelude.Eq, ReadPrec [ValidatePipelineDefinition]
ReadPrec ValidatePipelineDefinition
Int -> ReadS ValidatePipelineDefinition
ReadS [ValidatePipelineDefinition]
(Int -> ReadS ValidatePipelineDefinition)
-> ReadS [ValidatePipelineDefinition]
-> ReadPrec ValidatePipelineDefinition
-> ReadPrec [ValidatePipelineDefinition]
-> Read ValidatePipelineDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ValidatePipelineDefinition]
$creadListPrec :: ReadPrec [ValidatePipelineDefinition]
readPrec :: ReadPrec ValidatePipelineDefinition
$creadPrec :: ReadPrec ValidatePipelineDefinition
readList :: ReadS [ValidatePipelineDefinition]
$creadList :: ReadS [ValidatePipelineDefinition]
readsPrec :: Int -> ReadS ValidatePipelineDefinition
$creadsPrec :: Int -> ReadS ValidatePipelineDefinition
Prelude.Read, Int -> ValidatePipelineDefinition -> ShowS
[ValidatePipelineDefinition] -> ShowS
ValidatePipelineDefinition -> String
(Int -> ValidatePipelineDefinition -> ShowS)
-> (ValidatePipelineDefinition -> String)
-> ([ValidatePipelineDefinition] -> ShowS)
-> Show ValidatePipelineDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ValidatePipelineDefinition] -> ShowS
$cshowList :: [ValidatePipelineDefinition] -> ShowS
show :: ValidatePipelineDefinition -> String
$cshow :: ValidatePipelineDefinition -> String
showsPrec :: Int -> ValidatePipelineDefinition -> ShowS
$cshowsPrec :: Int -> ValidatePipelineDefinition -> ShowS
Prelude.Show, (forall x.
 ValidatePipelineDefinition -> Rep ValidatePipelineDefinition x)
-> (forall x.
    Rep ValidatePipelineDefinition x -> ValidatePipelineDefinition)
-> Generic ValidatePipelineDefinition
forall x.
Rep ValidatePipelineDefinition x -> ValidatePipelineDefinition
forall x.
ValidatePipelineDefinition -> Rep ValidatePipelineDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ValidatePipelineDefinition x -> ValidatePipelineDefinition
$cfrom :: forall x.
ValidatePipelineDefinition -> Rep ValidatePipelineDefinition x
Prelude.Generic)

-- |
-- Create a value of 'ValidatePipelineDefinition' 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:
--
-- 'parameterObjects', 'validatePipelineDefinition_parameterObjects' - The parameter objects used with the pipeline.
--
-- 'parameterValues', 'validatePipelineDefinition_parameterValues' - The parameter values used with the pipeline.
--
-- 'pipelineId', 'validatePipelineDefinition_pipelineId' - The ID of the pipeline.
--
-- 'pipelineObjects', 'validatePipelineDefinition_pipelineObjects' - The objects that define the pipeline changes to validate against the
-- pipeline.
newValidatePipelineDefinition ::
  -- | 'pipelineId'
  Prelude.Text ->
  ValidatePipelineDefinition
newValidatePipelineDefinition :: Text -> ValidatePipelineDefinition
newValidatePipelineDefinition Text
pPipelineId_ =
  ValidatePipelineDefinition' :: Maybe [ParameterObject]
-> Maybe [ParameterValue]
-> Text
-> [PipelineObject]
-> ValidatePipelineDefinition
ValidatePipelineDefinition'
    { $sel:parameterObjects:ValidatePipelineDefinition' :: Maybe [ParameterObject]
parameterObjects =
        Maybe [ParameterObject]
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterValues:ValidatePipelineDefinition' :: Maybe [ParameterValue]
parameterValues = Maybe [ParameterValue]
forall a. Maybe a
Prelude.Nothing,
      $sel:pipelineId:ValidatePipelineDefinition' :: Text
pipelineId = Text
pPipelineId_,
      $sel:pipelineObjects:ValidatePipelineDefinition' :: [PipelineObject]
pipelineObjects = [PipelineObject]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The parameter objects used with the pipeline.
validatePipelineDefinition_parameterObjects :: Lens.Lens' ValidatePipelineDefinition (Prelude.Maybe [ParameterObject])
validatePipelineDefinition_parameterObjects :: (Maybe [ParameterObject] -> f (Maybe [ParameterObject]))
-> ValidatePipelineDefinition -> f ValidatePipelineDefinition
validatePipelineDefinition_parameterObjects = (ValidatePipelineDefinition -> Maybe [ParameterObject])
-> (ValidatePipelineDefinition
    -> Maybe [ParameterObject] -> ValidatePipelineDefinition)
-> Lens
     ValidatePipelineDefinition
     ValidatePipelineDefinition
     (Maybe [ParameterObject])
     (Maybe [ParameterObject])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePipelineDefinition' {Maybe [ParameterObject]
parameterObjects :: Maybe [ParameterObject]
$sel:parameterObjects:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> Maybe [ParameterObject]
parameterObjects} -> Maybe [ParameterObject]
parameterObjects) (\s :: ValidatePipelineDefinition
s@ValidatePipelineDefinition' {} Maybe [ParameterObject]
a -> ValidatePipelineDefinition
s {$sel:parameterObjects:ValidatePipelineDefinition' :: Maybe [ParameterObject]
parameterObjects = Maybe [ParameterObject]
a} :: ValidatePipelineDefinition) ((Maybe [ParameterObject] -> f (Maybe [ParameterObject]))
 -> ValidatePipelineDefinition -> f ValidatePipelineDefinition)
-> ((Maybe [ParameterObject] -> f (Maybe [ParameterObject]))
    -> Maybe [ParameterObject] -> f (Maybe [ParameterObject]))
-> (Maybe [ParameterObject] -> f (Maybe [ParameterObject]))
-> ValidatePipelineDefinition
-> f ValidatePipelineDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ParameterObject]
  [ParameterObject]
  [ParameterObject]
  [ParameterObject]
-> Iso
     (Maybe [ParameterObject])
     (Maybe [ParameterObject])
     (Maybe [ParameterObject])
     (Maybe [ParameterObject])
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
  [ParameterObject]
  [ParameterObject]
  [ParameterObject]
  [ParameterObject]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The parameter values used with the pipeline.
validatePipelineDefinition_parameterValues :: Lens.Lens' ValidatePipelineDefinition (Prelude.Maybe [ParameterValue])
validatePipelineDefinition_parameterValues :: (Maybe [ParameterValue] -> f (Maybe [ParameterValue]))
-> ValidatePipelineDefinition -> f ValidatePipelineDefinition
validatePipelineDefinition_parameterValues = (ValidatePipelineDefinition -> Maybe [ParameterValue])
-> (ValidatePipelineDefinition
    -> Maybe [ParameterValue] -> ValidatePipelineDefinition)
-> Lens
     ValidatePipelineDefinition
     ValidatePipelineDefinition
     (Maybe [ParameterValue])
     (Maybe [ParameterValue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePipelineDefinition' {Maybe [ParameterValue]
parameterValues :: Maybe [ParameterValue]
$sel:parameterValues:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> Maybe [ParameterValue]
parameterValues} -> Maybe [ParameterValue]
parameterValues) (\s :: ValidatePipelineDefinition
s@ValidatePipelineDefinition' {} Maybe [ParameterValue]
a -> ValidatePipelineDefinition
s {$sel:parameterValues:ValidatePipelineDefinition' :: Maybe [ParameterValue]
parameterValues = Maybe [ParameterValue]
a} :: ValidatePipelineDefinition) ((Maybe [ParameterValue] -> f (Maybe [ParameterValue]))
 -> ValidatePipelineDefinition -> f ValidatePipelineDefinition)
-> ((Maybe [ParameterValue] -> f (Maybe [ParameterValue]))
    -> Maybe [ParameterValue] -> f (Maybe [ParameterValue]))
-> (Maybe [ParameterValue] -> f (Maybe [ParameterValue]))
-> ValidatePipelineDefinition
-> f ValidatePipelineDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ParameterValue] [ParameterValue] [ParameterValue] [ParameterValue]
-> Iso
     (Maybe [ParameterValue])
     (Maybe [ParameterValue])
     (Maybe [ParameterValue])
     (Maybe [ParameterValue])
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
  [ParameterValue] [ParameterValue] [ParameterValue] [ParameterValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the pipeline.
validatePipelineDefinition_pipelineId :: Lens.Lens' ValidatePipelineDefinition Prelude.Text
validatePipelineDefinition_pipelineId :: (Text -> f Text)
-> ValidatePipelineDefinition -> f ValidatePipelineDefinition
validatePipelineDefinition_pipelineId = (ValidatePipelineDefinition -> Text)
-> (ValidatePipelineDefinition
    -> Text -> ValidatePipelineDefinition)
-> Lens
     ValidatePipelineDefinition ValidatePipelineDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePipelineDefinition' {Text
pipelineId :: Text
$sel:pipelineId:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> Text
pipelineId} -> Text
pipelineId) (\s :: ValidatePipelineDefinition
s@ValidatePipelineDefinition' {} Text
a -> ValidatePipelineDefinition
s {$sel:pipelineId:ValidatePipelineDefinition' :: Text
pipelineId = Text
a} :: ValidatePipelineDefinition)

-- | The objects that define the pipeline changes to validate against the
-- pipeline.
validatePipelineDefinition_pipelineObjects :: Lens.Lens' ValidatePipelineDefinition [PipelineObject]
validatePipelineDefinition_pipelineObjects :: ([PipelineObject] -> f [PipelineObject])
-> ValidatePipelineDefinition -> f ValidatePipelineDefinition
validatePipelineDefinition_pipelineObjects = (ValidatePipelineDefinition -> [PipelineObject])
-> (ValidatePipelineDefinition
    -> [PipelineObject] -> ValidatePipelineDefinition)
-> Lens
     ValidatePipelineDefinition
     ValidatePipelineDefinition
     [PipelineObject]
     [PipelineObject]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePipelineDefinition' {[PipelineObject]
pipelineObjects :: [PipelineObject]
$sel:pipelineObjects:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> [PipelineObject]
pipelineObjects} -> [PipelineObject]
pipelineObjects) (\s :: ValidatePipelineDefinition
s@ValidatePipelineDefinition' {} [PipelineObject]
a -> ValidatePipelineDefinition
s {$sel:pipelineObjects:ValidatePipelineDefinition' :: [PipelineObject]
pipelineObjects = [PipelineObject]
a} :: ValidatePipelineDefinition) (([PipelineObject] -> f [PipelineObject])
 -> ValidatePipelineDefinition -> f ValidatePipelineDefinition)
-> (([PipelineObject] -> f [PipelineObject])
    -> [PipelineObject] -> f [PipelineObject])
-> ([PipelineObject] -> f [PipelineObject])
-> ValidatePipelineDefinition
-> f ValidatePipelineDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PipelineObject] -> f [PipelineObject])
-> [PipelineObject] -> f [PipelineObject]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest ValidatePipelineDefinition where
  type
    AWSResponse ValidatePipelineDefinition =
      ValidatePipelineDefinitionResponse
  request :: ValidatePipelineDefinition -> Request ValidatePipelineDefinition
request = Service
-> ValidatePipelineDefinition -> Request ValidatePipelineDefinition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ValidatePipelineDefinition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ValidatePipelineDefinition)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ValidatePipelineDefinition))
-> Logger
-> Service
-> Proxy ValidatePipelineDefinition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ValidatePipelineDefinition)))
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 [ValidationError]
-> Maybe [ValidationWarning]
-> Int
-> Bool
-> ValidatePipelineDefinitionResponse
ValidatePipelineDefinitionResponse'
            (Maybe [ValidationError]
 -> Maybe [ValidationWarning]
 -> Int
 -> Bool
 -> ValidatePipelineDefinitionResponse)
-> Either String (Maybe [ValidationError])
-> Either
     String
     (Maybe [ValidationWarning]
      -> Int -> Bool -> ValidatePipelineDefinitionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ValidationError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"validationErrors"
                            Either String (Maybe (Maybe [ValidationError]))
-> Maybe [ValidationError]
-> Either String (Maybe [ValidationError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ValidationError]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [ValidationWarning]
   -> Int -> Bool -> ValidatePipelineDefinitionResponse)
-> Either String (Maybe [ValidationWarning])
-> Either
     String (Int -> Bool -> ValidatePipelineDefinitionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ValidationWarning]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"validationWarnings"
                            Either String (Maybe (Maybe [ValidationWarning]))
-> Maybe [ValidationWarning]
-> Either String (Maybe [ValidationWarning])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ValidationWarning]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> Bool -> ValidatePipelineDefinitionResponse)
-> Either String Int
-> Either String (Bool -> ValidatePipelineDefinitionResponse)
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 (Bool -> ValidatePipelineDefinitionResponse)
-> Either String Bool
-> Either String ValidatePipelineDefinitionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"errored")
      )

instance Prelude.Hashable ValidatePipelineDefinition

instance Prelude.NFData ValidatePipelineDefinition

instance Core.ToHeaders ValidatePipelineDefinition where
  toHeaders :: ValidatePipelineDefinition -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ValidatePipelineDefinition -> 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
"DataPipeline.ValidatePipelineDefinition" ::
                          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 ValidatePipelineDefinition where
  toJSON :: ValidatePipelineDefinition -> Value
toJSON ValidatePipelineDefinition' {[PipelineObject]
Maybe [ParameterObject]
Maybe [ParameterValue]
Text
pipelineObjects :: [PipelineObject]
pipelineId :: Text
parameterValues :: Maybe [ParameterValue]
parameterObjects :: Maybe [ParameterObject]
$sel:pipelineObjects:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> [PipelineObject]
$sel:pipelineId:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> Text
$sel:parameterValues:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> Maybe [ParameterValue]
$sel:parameterObjects:ValidatePipelineDefinition' :: ValidatePipelineDefinition -> Maybe [ParameterObject]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"parameterObjects" Text -> [ParameterObject] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ParameterObject] -> Pair)
-> Maybe [ParameterObject] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ParameterObject]
parameterObjects,
            (Text
"parameterValues" Text -> [ParameterValue] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ParameterValue] -> Pair) -> Maybe [ParameterValue] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ParameterValue]
parameterValues,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"pipelineId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pipelineId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"pipelineObjects" Text -> [PipelineObject] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [PipelineObject]
pipelineObjects)
          ]
      )

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

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

-- | Contains the output of ValidatePipelineDefinition.
--
-- /See:/ 'newValidatePipelineDefinitionResponse' smart constructor.
data ValidatePipelineDefinitionResponse = ValidatePipelineDefinitionResponse'
  { -- | Any validation errors that were found.
    ValidatePipelineDefinitionResponse -> Maybe [ValidationError]
validationErrors :: Prelude.Maybe [ValidationError],
    -- | Any validation warnings that were found.
    ValidatePipelineDefinitionResponse -> Maybe [ValidationWarning]
validationWarnings :: Prelude.Maybe [ValidationWarning],
    -- | The response's http status code.
    ValidatePipelineDefinitionResponse -> Int
httpStatus :: Prelude.Int,
    -- | Indicates whether there were validation errors.
    ValidatePipelineDefinitionResponse -> Bool
errored :: Prelude.Bool
  }
  deriving (ValidatePipelineDefinitionResponse
-> ValidatePipelineDefinitionResponse -> Bool
(ValidatePipelineDefinitionResponse
 -> ValidatePipelineDefinitionResponse -> Bool)
-> (ValidatePipelineDefinitionResponse
    -> ValidatePipelineDefinitionResponse -> Bool)
-> Eq ValidatePipelineDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidatePipelineDefinitionResponse
-> ValidatePipelineDefinitionResponse -> Bool
$c/= :: ValidatePipelineDefinitionResponse
-> ValidatePipelineDefinitionResponse -> Bool
== :: ValidatePipelineDefinitionResponse
-> ValidatePipelineDefinitionResponse -> Bool
$c== :: ValidatePipelineDefinitionResponse
-> ValidatePipelineDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [ValidatePipelineDefinitionResponse]
ReadPrec ValidatePipelineDefinitionResponse
Int -> ReadS ValidatePipelineDefinitionResponse
ReadS [ValidatePipelineDefinitionResponse]
(Int -> ReadS ValidatePipelineDefinitionResponse)
-> ReadS [ValidatePipelineDefinitionResponse]
-> ReadPrec ValidatePipelineDefinitionResponse
-> ReadPrec [ValidatePipelineDefinitionResponse]
-> Read ValidatePipelineDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ValidatePipelineDefinitionResponse]
$creadListPrec :: ReadPrec [ValidatePipelineDefinitionResponse]
readPrec :: ReadPrec ValidatePipelineDefinitionResponse
$creadPrec :: ReadPrec ValidatePipelineDefinitionResponse
readList :: ReadS [ValidatePipelineDefinitionResponse]
$creadList :: ReadS [ValidatePipelineDefinitionResponse]
readsPrec :: Int -> ReadS ValidatePipelineDefinitionResponse
$creadsPrec :: Int -> ReadS ValidatePipelineDefinitionResponse
Prelude.Read, Int -> ValidatePipelineDefinitionResponse -> ShowS
[ValidatePipelineDefinitionResponse] -> ShowS
ValidatePipelineDefinitionResponse -> String
(Int -> ValidatePipelineDefinitionResponse -> ShowS)
-> (ValidatePipelineDefinitionResponse -> String)
-> ([ValidatePipelineDefinitionResponse] -> ShowS)
-> Show ValidatePipelineDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ValidatePipelineDefinitionResponse] -> ShowS
$cshowList :: [ValidatePipelineDefinitionResponse] -> ShowS
show :: ValidatePipelineDefinitionResponse -> String
$cshow :: ValidatePipelineDefinitionResponse -> String
showsPrec :: Int -> ValidatePipelineDefinitionResponse -> ShowS
$cshowsPrec :: Int -> ValidatePipelineDefinitionResponse -> ShowS
Prelude.Show, (forall x.
 ValidatePipelineDefinitionResponse
 -> Rep ValidatePipelineDefinitionResponse x)
-> (forall x.
    Rep ValidatePipelineDefinitionResponse x
    -> ValidatePipelineDefinitionResponse)
-> Generic ValidatePipelineDefinitionResponse
forall x.
Rep ValidatePipelineDefinitionResponse x
-> ValidatePipelineDefinitionResponse
forall x.
ValidatePipelineDefinitionResponse
-> Rep ValidatePipelineDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ValidatePipelineDefinitionResponse x
-> ValidatePipelineDefinitionResponse
$cfrom :: forall x.
ValidatePipelineDefinitionResponse
-> Rep ValidatePipelineDefinitionResponse x
Prelude.Generic)

-- |
-- Create a value of 'ValidatePipelineDefinitionResponse' 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:
--
-- 'validationErrors', 'validatePipelineDefinitionResponse_validationErrors' - Any validation errors that were found.
--
-- 'validationWarnings', 'validatePipelineDefinitionResponse_validationWarnings' - Any validation warnings that were found.
--
-- 'httpStatus', 'validatePipelineDefinitionResponse_httpStatus' - The response's http status code.
--
-- 'errored', 'validatePipelineDefinitionResponse_errored' - Indicates whether there were validation errors.
newValidatePipelineDefinitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'errored'
  Prelude.Bool ->
  ValidatePipelineDefinitionResponse
newValidatePipelineDefinitionResponse :: Int -> Bool -> ValidatePipelineDefinitionResponse
newValidatePipelineDefinitionResponse
  Int
pHttpStatus_
  Bool
pErrored_ =
    ValidatePipelineDefinitionResponse' :: Maybe [ValidationError]
-> Maybe [ValidationWarning]
-> Int
-> Bool
-> ValidatePipelineDefinitionResponse
ValidatePipelineDefinitionResponse'
      { $sel:validationErrors:ValidatePipelineDefinitionResponse' :: Maybe [ValidationError]
validationErrors =
          Maybe [ValidationError]
forall a. Maybe a
Prelude.Nothing,
        $sel:validationWarnings:ValidatePipelineDefinitionResponse' :: Maybe [ValidationWarning]
validationWarnings = Maybe [ValidationWarning]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ValidatePipelineDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:errored:ValidatePipelineDefinitionResponse' :: Bool
errored = Bool
pErrored_
      }

-- | Any validation errors that were found.
validatePipelineDefinitionResponse_validationErrors :: Lens.Lens' ValidatePipelineDefinitionResponse (Prelude.Maybe [ValidationError])
validatePipelineDefinitionResponse_validationErrors :: (Maybe [ValidationError] -> f (Maybe [ValidationError]))
-> ValidatePipelineDefinitionResponse
-> f ValidatePipelineDefinitionResponse
validatePipelineDefinitionResponse_validationErrors = (ValidatePipelineDefinitionResponse -> Maybe [ValidationError])
-> (ValidatePipelineDefinitionResponse
    -> Maybe [ValidationError] -> ValidatePipelineDefinitionResponse)
-> Lens
     ValidatePipelineDefinitionResponse
     ValidatePipelineDefinitionResponse
     (Maybe [ValidationError])
     (Maybe [ValidationError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePipelineDefinitionResponse' {Maybe [ValidationError]
validationErrors :: Maybe [ValidationError]
$sel:validationErrors:ValidatePipelineDefinitionResponse' :: ValidatePipelineDefinitionResponse -> Maybe [ValidationError]
validationErrors} -> Maybe [ValidationError]
validationErrors) (\s :: ValidatePipelineDefinitionResponse
s@ValidatePipelineDefinitionResponse' {} Maybe [ValidationError]
a -> ValidatePipelineDefinitionResponse
s {$sel:validationErrors:ValidatePipelineDefinitionResponse' :: Maybe [ValidationError]
validationErrors = Maybe [ValidationError]
a} :: ValidatePipelineDefinitionResponse) ((Maybe [ValidationError] -> f (Maybe [ValidationError]))
 -> ValidatePipelineDefinitionResponse
 -> f ValidatePipelineDefinitionResponse)
-> ((Maybe [ValidationError] -> f (Maybe [ValidationError]))
    -> Maybe [ValidationError] -> f (Maybe [ValidationError]))
-> (Maybe [ValidationError] -> f (Maybe [ValidationError]))
-> ValidatePipelineDefinitionResponse
-> f ValidatePipelineDefinitionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ValidationError]
  [ValidationError]
  [ValidationError]
  [ValidationError]
-> Iso
     (Maybe [ValidationError])
     (Maybe [ValidationError])
     (Maybe [ValidationError])
     (Maybe [ValidationError])
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
  [ValidationError]
  [ValidationError]
  [ValidationError]
  [ValidationError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Any validation warnings that were found.
validatePipelineDefinitionResponse_validationWarnings :: Lens.Lens' ValidatePipelineDefinitionResponse (Prelude.Maybe [ValidationWarning])
validatePipelineDefinitionResponse_validationWarnings :: (Maybe [ValidationWarning] -> f (Maybe [ValidationWarning]))
-> ValidatePipelineDefinitionResponse
-> f ValidatePipelineDefinitionResponse
validatePipelineDefinitionResponse_validationWarnings = (ValidatePipelineDefinitionResponse -> Maybe [ValidationWarning])
-> (ValidatePipelineDefinitionResponse
    -> Maybe [ValidationWarning] -> ValidatePipelineDefinitionResponse)
-> Lens
     ValidatePipelineDefinitionResponse
     ValidatePipelineDefinitionResponse
     (Maybe [ValidationWarning])
     (Maybe [ValidationWarning])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePipelineDefinitionResponse' {Maybe [ValidationWarning]
validationWarnings :: Maybe [ValidationWarning]
$sel:validationWarnings:ValidatePipelineDefinitionResponse' :: ValidatePipelineDefinitionResponse -> Maybe [ValidationWarning]
validationWarnings} -> Maybe [ValidationWarning]
validationWarnings) (\s :: ValidatePipelineDefinitionResponse
s@ValidatePipelineDefinitionResponse' {} Maybe [ValidationWarning]
a -> ValidatePipelineDefinitionResponse
s {$sel:validationWarnings:ValidatePipelineDefinitionResponse' :: Maybe [ValidationWarning]
validationWarnings = Maybe [ValidationWarning]
a} :: ValidatePipelineDefinitionResponse) ((Maybe [ValidationWarning] -> f (Maybe [ValidationWarning]))
 -> ValidatePipelineDefinitionResponse
 -> f ValidatePipelineDefinitionResponse)
-> ((Maybe [ValidationWarning] -> f (Maybe [ValidationWarning]))
    -> Maybe [ValidationWarning] -> f (Maybe [ValidationWarning]))
-> (Maybe [ValidationWarning] -> f (Maybe [ValidationWarning]))
-> ValidatePipelineDefinitionResponse
-> f ValidatePipelineDefinitionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ValidationWarning]
  [ValidationWarning]
  [ValidationWarning]
  [ValidationWarning]
-> Iso
     (Maybe [ValidationWarning])
     (Maybe [ValidationWarning])
     (Maybe [ValidationWarning])
     (Maybe [ValidationWarning])
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
  [ValidationWarning]
  [ValidationWarning]
  [ValidationWarning]
  [ValidationWarning]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | Indicates whether there were validation errors.
validatePipelineDefinitionResponse_errored :: Lens.Lens' ValidatePipelineDefinitionResponse Prelude.Bool
validatePipelineDefinitionResponse_errored :: (Bool -> f Bool)
-> ValidatePipelineDefinitionResponse
-> f ValidatePipelineDefinitionResponse
validatePipelineDefinitionResponse_errored = (ValidatePipelineDefinitionResponse -> Bool)
-> (ValidatePipelineDefinitionResponse
    -> Bool -> ValidatePipelineDefinitionResponse)
-> Lens
     ValidatePipelineDefinitionResponse
     ValidatePipelineDefinitionResponse
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePipelineDefinitionResponse' {Bool
errored :: Bool
$sel:errored:ValidatePipelineDefinitionResponse' :: ValidatePipelineDefinitionResponse -> Bool
errored} -> Bool
errored) (\s :: ValidatePipelineDefinitionResponse
s@ValidatePipelineDefinitionResponse' {} Bool
a -> ValidatePipelineDefinitionResponse
s {$sel:errored:ValidatePipelineDefinitionResponse' :: Bool
errored = Bool
a} :: ValidatePipelineDefinitionResponse)

instance
  Prelude.NFData
    ValidatePipelineDefinitionResponse