{-# 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.SageMaker.Types.CallbackStepMetadata
-- 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.SageMaker.Types.CallbackStepMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.OutputParameter

-- | Metadata about a callback step.
--
-- /See:/ 'newCallbackStepMetadata' smart constructor.
data CallbackStepMetadata = CallbackStepMetadata'
  { -- | The pipeline generated token from the Amazon SQS queue.
    CallbackStepMetadata -> Maybe Text
callbackToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the output parameters of the callback step.
    CallbackStepMetadata -> Maybe [OutputParameter]
outputParameters :: Prelude.Maybe [OutputParameter],
    -- | The URL of the Amazon Simple Queue Service (Amazon SQS) queue used by
    -- the callback step.
    CallbackStepMetadata -> Maybe Text
sqsQueueUrl :: Prelude.Maybe Prelude.Text
  }
  deriving (CallbackStepMetadata -> CallbackStepMetadata -> Bool
(CallbackStepMetadata -> CallbackStepMetadata -> Bool)
-> (CallbackStepMetadata -> CallbackStepMetadata -> Bool)
-> Eq CallbackStepMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallbackStepMetadata -> CallbackStepMetadata -> Bool
$c/= :: CallbackStepMetadata -> CallbackStepMetadata -> Bool
== :: CallbackStepMetadata -> CallbackStepMetadata -> Bool
$c== :: CallbackStepMetadata -> CallbackStepMetadata -> Bool
Prelude.Eq, ReadPrec [CallbackStepMetadata]
ReadPrec CallbackStepMetadata
Int -> ReadS CallbackStepMetadata
ReadS [CallbackStepMetadata]
(Int -> ReadS CallbackStepMetadata)
-> ReadS [CallbackStepMetadata]
-> ReadPrec CallbackStepMetadata
-> ReadPrec [CallbackStepMetadata]
-> Read CallbackStepMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CallbackStepMetadata]
$creadListPrec :: ReadPrec [CallbackStepMetadata]
readPrec :: ReadPrec CallbackStepMetadata
$creadPrec :: ReadPrec CallbackStepMetadata
readList :: ReadS [CallbackStepMetadata]
$creadList :: ReadS [CallbackStepMetadata]
readsPrec :: Int -> ReadS CallbackStepMetadata
$creadsPrec :: Int -> ReadS CallbackStepMetadata
Prelude.Read, Int -> CallbackStepMetadata -> ShowS
[CallbackStepMetadata] -> ShowS
CallbackStepMetadata -> String
(Int -> CallbackStepMetadata -> ShowS)
-> (CallbackStepMetadata -> String)
-> ([CallbackStepMetadata] -> ShowS)
-> Show CallbackStepMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallbackStepMetadata] -> ShowS
$cshowList :: [CallbackStepMetadata] -> ShowS
show :: CallbackStepMetadata -> String
$cshow :: CallbackStepMetadata -> String
showsPrec :: Int -> CallbackStepMetadata -> ShowS
$cshowsPrec :: Int -> CallbackStepMetadata -> ShowS
Prelude.Show, (forall x. CallbackStepMetadata -> Rep CallbackStepMetadata x)
-> (forall x. Rep CallbackStepMetadata x -> CallbackStepMetadata)
-> Generic CallbackStepMetadata
forall x. Rep CallbackStepMetadata x -> CallbackStepMetadata
forall x. CallbackStepMetadata -> Rep CallbackStepMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CallbackStepMetadata x -> CallbackStepMetadata
$cfrom :: forall x. CallbackStepMetadata -> Rep CallbackStepMetadata x
Prelude.Generic)

-- |
-- Create a value of 'CallbackStepMetadata' 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:
--
-- 'callbackToken', 'callbackStepMetadata_callbackToken' - The pipeline generated token from the Amazon SQS queue.
--
-- 'outputParameters', 'callbackStepMetadata_outputParameters' - A list of the output parameters of the callback step.
--
-- 'sqsQueueUrl', 'callbackStepMetadata_sqsQueueUrl' - The URL of the Amazon Simple Queue Service (Amazon SQS) queue used by
-- the callback step.
newCallbackStepMetadata ::
  CallbackStepMetadata
newCallbackStepMetadata :: CallbackStepMetadata
newCallbackStepMetadata =
  CallbackStepMetadata' :: Maybe Text
-> Maybe [OutputParameter] -> Maybe Text -> CallbackStepMetadata
CallbackStepMetadata'
    { $sel:callbackToken:CallbackStepMetadata' :: Maybe Text
callbackToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputParameters:CallbackStepMetadata' :: Maybe [OutputParameter]
outputParameters = Maybe [OutputParameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:sqsQueueUrl:CallbackStepMetadata' :: Maybe Text
sqsQueueUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The pipeline generated token from the Amazon SQS queue.
callbackStepMetadata_callbackToken :: Lens.Lens' CallbackStepMetadata (Prelude.Maybe Prelude.Text)
callbackStepMetadata_callbackToken :: (Maybe Text -> f (Maybe Text))
-> CallbackStepMetadata -> f CallbackStepMetadata
callbackStepMetadata_callbackToken = (CallbackStepMetadata -> Maybe Text)
-> (CallbackStepMetadata -> Maybe Text -> CallbackStepMetadata)
-> Lens
     CallbackStepMetadata CallbackStepMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallbackStepMetadata' {Maybe Text
callbackToken :: Maybe Text
$sel:callbackToken:CallbackStepMetadata' :: CallbackStepMetadata -> Maybe Text
callbackToken} -> Maybe Text
callbackToken) (\s :: CallbackStepMetadata
s@CallbackStepMetadata' {} Maybe Text
a -> CallbackStepMetadata
s {$sel:callbackToken:CallbackStepMetadata' :: Maybe Text
callbackToken = Maybe Text
a} :: CallbackStepMetadata)

-- | A list of the output parameters of the callback step.
callbackStepMetadata_outputParameters :: Lens.Lens' CallbackStepMetadata (Prelude.Maybe [OutputParameter])
callbackStepMetadata_outputParameters :: (Maybe [OutputParameter] -> f (Maybe [OutputParameter]))
-> CallbackStepMetadata -> f CallbackStepMetadata
callbackStepMetadata_outputParameters = (CallbackStepMetadata -> Maybe [OutputParameter])
-> (CallbackStepMetadata
    -> Maybe [OutputParameter] -> CallbackStepMetadata)
-> Lens
     CallbackStepMetadata
     CallbackStepMetadata
     (Maybe [OutputParameter])
     (Maybe [OutputParameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallbackStepMetadata' {Maybe [OutputParameter]
outputParameters :: Maybe [OutputParameter]
$sel:outputParameters:CallbackStepMetadata' :: CallbackStepMetadata -> Maybe [OutputParameter]
outputParameters} -> Maybe [OutputParameter]
outputParameters) (\s :: CallbackStepMetadata
s@CallbackStepMetadata' {} Maybe [OutputParameter]
a -> CallbackStepMetadata
s {$sel:outputParameters:CallbackStepMetadata' :: Maybe [OutputParameter]
outputParameters = Maybe [OutputParameter]
a} :: CallbackStepMetadata) ((Maybe [OutputParameter] -> f (Maybe [OutputParameter]))
 -> CallbackStepMetadata -> f CallbackStepMetadata)
-> ((Maybe [OutputParameter] -> f (Maybe [OutputParameter]))
    -> Maybe [OutputParameter] -> f (Maybe [OutputParameter]))
-> (Maybe [OutputParameter] -> f (Maybe [OutputParameter]))
-> CallbackStepMetadata
-> f CallbackStepMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OutputParameter]
  [OutputParameter]
  [OutputParameter]
  [OutputParameter]
-> Iso
     (Maybe [OutputParameter])
     (Maybe [OutputParameter])
     (Maybe [OutputParameter])
     (Maybe [OutputParameter])
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
  [OutputParameter]
  [OutputParameter]
  [OutputParameter]
  [OutputParameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The URL of the Amazon Simple Queue Service (Amazon SQS) queue used by
-- the callback step.
callbackStepMetadata_sqsQueueUrl :: Lens.Lens' CallbackStepMetadata (Prelude.Maybe Prelude.Text)
callbackStepMetadata_sqsQueueUrl :: (Maybe Text -> f (Maybe Text))
-> CallbackStepMetadata -> f CallbackStepMetadata
callbackStepMetadata_sqsQueueUrl = (CallbackStepMetadata -> Maybe Text)
-> (CallbackStepMetadata -> Maybe Text -> CallbackStepMetadata)
-> Lens
     CallbackStepMetadata CallbackStepMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallbackStepMetadata' {Maybe Text
sqsQueueUrl :: Maybe Text
$sel:sqsQueueUrl:CallbackStepMetadata' :: CallbackStepMetadata -> Maybe Text
sqsQueueUrl} -> Maybe Text
sqsQueueUrl) (\s :: CallbackStepMetadata
s@CallbackStepMetadata' {} Maybe Text
a -> CallbackStepMetadata
s {$sel:sqsQueueUrl:CallbackStepMetadata' :: Maybe Text
sqsQueueUrl = Maybe Text
a} :: CallbackStepMetadata)

instance Core.FromJSON CallbackStepMetadata where
  parseJSON :: Value -> Parser CallbackStepMetadata
parseJSON =
    String
-> (Object -> Parser CallbackStepMetadata)
-> Value
-> Parser CallbackStepMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CallbackStepMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe [OutputParameter] -> Maybe Text -> CallbackStepMetadata
CallbackStepMetadata'
            (Maybe Text
 -> Maybe [OutputParameter] -> Maybe Text -> CallbackStepMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe [OutputParameter] -> Maybe Text -> CallbackStepMetadata)
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
"CallbackToken")
            Parser
  (Maybe [OutputParameter] -> Maybe Text -> CallbackStepMetadata)
-> Parser (Maybe [OutputParameter])
-> Parser (Maybe Text -> CallbackStepMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [OutputParameter]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutputParameters"
                            Parser (Maybe (Maybe [OutputParameter]))
-> Maybe [OutputParameter] -> Parser (Maybe [OutputParameter])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [OutputParameter]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> CallbackStepMetadata)
-> Parser (Maybe Text) -> Parser CallbackStepMetadata
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
"SqsQueueUrl")
      )

instance Prelude.Hashable CallbackStepMetadata

instance Prelude.NFData CallbackStepMetadata