{-# 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.IoT.AssociateTargetsWithJob
-- 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)
--
-- Associates a group with a continuous job. The following criteria must be
-- met:
--
-- -   The job must have been created with the @targetSelection@ field set
--     to \"CONTINUOUS\".
--
-- -   The job status must currently be \"IN_PROGRESS\".
--
-- -   The total number of targets associated with a job must not exceed
--     100.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions AssociateTargetsWithJob>
-- action.
module Amazonka.IoT.AssociateTargetsWithJob
  ( -- * Creating a Request
    AssociateTargetsWithJob (..),
    newAssociateTargetsWithJob,

    -- * Request Lenses
    associateTargetsWithJob_namespaceId,
    associateTargetsWithJob_comment,
    associateTargetsWithJob_targets,
    associateTargetsWithJob_jobId,

    -- * Destructuring the Response
    AssociateTargetsWithJobResponse (..),
    newAssociateTargetsWithJobResponse,

    -- * Response Lenses
    associateTargetsWithJobResponse_jobId,
    associateTargetsWithJobResponse_jobArn,
    associateTargetsWithJobResponse_description,
    associateTargetsWithJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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:/ 'newAssociateTargetsWithJob' smart constructor.
data AssociateTargetsWithJob = AssociateTargetsWithJob'
  { -- | The namespace used to indicate that a job is a customer-managed job.
    --
    -- When you specify a value for this parameter, Amazon Web Services IoT
    -- Core sends jobs notifications to MQTT topics that contain the value in
    -- the following format.
    --
    -- @$aws\/things\/THING_NAME\/jobs\/JOB_ID\/notify-namespace-NAMESPACE_ID\/@
    --
    -- The @namespaceId@ feature is in public preview.
    AssociateTargetsWithJob -> Maybe Text
namespaceId :: Prelude.Maybe Prelude.Text,
    -- | An optional comment string describing why the job was associated with
    -- the targets.
    AssociateTargetsWithJob -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | A list of thing group ARNs that define the targets of the job.
    AssociateTargetsWithJob -> NonEmpty Text
targets :: Prelude.NonEmpty Prelude.Text,
    -- | The unique identifier you assigned to this job when it was created.
    AssociateTargetsWithJob -> Text
jobId :: Prelude.Text
  }
  deriving (AssociateTargetsWithJob -> AssociateTargetsWithJob -> Bool
(AssociateTargetsWithJob -> AssociateTargetsWithJob -> Bool)
-> (AssociateTargetsWithJob -> AssociateTargetsWithJob -> Bool)
-> Eq AssociateTargetsWithJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateTargetsWithJob -> AssociateTargetsWithJob -> Bool
$c/= :: AssociateTargetsWithJob -> AssociateTargetsWithJob -> Bool
== :: AssociateTargetsWithJob -> AssociateTargetsWithJob -> Bool
$c== :: AssociateTargetsWithJob -> AssociateTargetsWithJob -> Bool
Prelude.Eq, ReadPrec [AssociateTargetsWithJob]
ReadPrec AssociateTargetsWithJob
Int -> ReadS AssociateTargetsWithJob
ReadS [AssociateTargetsWithJob]
(Int -> ReadS AssociateTargetsWithJob)
-> ReadS [AssociateTargetsWithJob]
-> ReadPrec AssociateTargetsWithJob
-> ReadPrec [AssociateTargetsWithJob]
-> Read AssociateTargetsWithJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateTargetsWithJob]
$creadListPrec :: ReadPrec [AssociateTargetsWithJob]
readPrec :: ReadPrec AssociateTargetsWithJob
$creadPrec :: ReadPrec AssociateTargetsWithJob
readList :: ReadS [AssociateTargetsWithJob]
$creadList :: ReadS [AssociateTargetsWithJob]
readsPrec :: Int -> ReadS AssociateTargetsWithJob
$creadsPrec :: Int -> ReadS AssociateTargetsWithJob
Prelude.Read, Int -> AssociateTargetsWithJob -> ShowS
[AssociateTargetsWithJob] -> ShowS
AssociateTargetsWithJob -> String
(Int -> AssociateTargetsWithJob -> ShowS)
-> (AssociateTargetsWithJob -> String)
-> ([AssociateTargetsWithJob] -> ShowS)
-> Show AssociateTargetsWithJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateTargetsWithJob] -> ShowS
$cshowList :: [AssociateTargetsWithJob] -> ShowS
show :: AssociateTargetsWithJob -> String
$cshow :: AssociateTargetsWithJob -> String
showsPrec :: Int -> AssociateTargetsWithJob -> ShowS
$cshowsPrec :: Int -> AssociateTargetsWithJob -> ShowS
Prelude.Show, (forall x.
 AssociateTargetsWithJob -> Rep AssociateTargetsWithJob x)
-> (forall x.
    Rep AssociateTargetsWithJob x -> AssociateTargetsWithJob)
-> Generic AssociateTargetsWithJob
forall x. Rep AssociateTargetsWithJob x -> AssociateTargetsWithJob
forall x. AssociateTargetsWithJob -> Rep AssociateTargetsWithJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateTargetsWithJob x -> AssociateTargetsWithJob
$cfrom :: forall x. AssociateTargetsWithJob -> Rep AssociateTargetsWithJob x
Prelude.Generic)

-- |
-- Create a value of 'AssociateTargetsWithJob' 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:
--
-- 'namespaceId', 'associateTargetsWithJob_namespaceId' - The namespace used to indicate that a job is a customer-managed job.
--
-- When you specify a value for this parameter, Amazon Web Services IoT
-- Core sends jobs notifications to MQTT topics that contain the value in
-- the following format.
--
-- @$aws\/things\/THING_NAME\/jobs\/JOB_ID\/notify-namespace-NAMESPACE_ID\/@
--
-- The @namespaceId@ feature is in public preview.
--
-- 'comment', 'associateTargetsWithJob_comment' - An optional comment string describing why the job was associated with
-- the targets.
--
-- 'targets', 'associateTargetsWithJob_targets' - A list of thing group ARNs that define the targets of the job.
--
-- 'jobId', 'associateTargetsWithJob_jobId' - The unique identifier you assigned to this job when it was created.
newAssociateTargetsWithJob ::
  -- | 'targets'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'jobId'
  Prelude.Text ->
  AssociateTargetsWithJob
newAssociateTargetsWithJob :: NonEmpty Text -> Text -> AssociateTargetsWithJob
newAssociateTargetsWithJob NonEmpty Text
pTargets_ Text
pJobId_ =
  AssociateTargetsWithJob' :: Maybe Text
-> Maybe Text -> NonEmpty Text -> Text -> AssociateTargetsWithJob
AssociateTargetsWithJob'
    { $sel:namespaceId:AssociateTargetsWithJob' :: Maybe Text
namespaceId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:AssociateTargetsWithJob' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:AssociateTargetsWithJob' :: NonEmpty Text
targets = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pTargets_,
      $sel:jobId:AssociateTargetsWithJob' :: Text
jobId = Text
pJobId_
    }

-- | The namespace used to indicate that a job is a customer-managed job.
--
-- When you specify a value for this parameter, Amazon Web Services IoT
-- Core sends jobs notifications to MQTT topics that contain the value in
-- the following format.
--
-- @$aws\/things\/THING_NAME\/jobs\/JOB_ID\/notify-namespace-NAMESPACE_ID\/@
--
-- The @namespaceId@ feature is in public preview.
associateTargetsWithJob_namespaceId :: Lens.Lens' AssociateTargetsWithJob (Prelude.Maybe Prelude.Text)
associateTargetsWithJob_namespaceId :: (Maybe Text -> f (Maybe Text))
-> AssociateTargetsWithJob -> f AssociateTargetsWithJob
associateTargetsWithJob_namespaceId = (AssociateTargetsWithJob -> Maybe Text)
-> (AssociateTargetsWithJob
    -> Maybe Text -> AssociateTargetsWithJob)
-> Lens
     AssociateTargetsWithJob
     AssociateTargetsWithJob
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTargetsWithJob' {Maybe Text
namespaceId :: Maybe Text
$sel:namespaceId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
namespaceId} -> Maybe Text
namespaceId) (\s :: AssociateTargetsWithJob
s@AssociateTargetsWithJob' {} Maybe Text
a -> AssociateTargetsWithJob
s {$sel:namespaceId:AssociateTargetsWithJob' :: Maybe Text
namespaceId = Maybe Text
a} :: AssociateTargetsWithJob)

-- | An optional comment string describing why the job was associated with
-- the targets.
associateTargetsWithJob_comment :: Lens.Lens' AssociateTargetsWithJob (Prelude.Maybe Prelude.Text)
associateTargetsWithJob_comment :: (Maybe Text -> f (Maybe Text))
-> AssociateTargetsWithJob -> f AssociateTargetsWithJob
associateTargetsWithJob_comment = (AssociateTargetsWithJob -> Maybe Text)
-> (AssociateTargetsWithJob
    -> Maybe Text -> AssociateTargetsWithJob)
-> Lens
     AssociateTargetsWithJob
     AssociateTargetsWithJob
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTargetsWithJob' {Maybe Text
comment :: Maybe Text
$sel:comment:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
comment} -> Maybe Text
comment) (\s :: AssociateTargetsWithJob
s@AssociateTargetsWithJob' {} Maybe Text
a -> AssociateTargetsWithJob
s {$sel:comment:AssociateTargetsWithJob' :: Maybe Text
comment = Maybe Text
a} :: AssociateTargetsWithJob)

-- | A list of thing group ARNs that define the targets of the job.
associateTargetsWithJob_targets :: Lens.Lens' AssociateTargetsWithJob (Prelude.NonEmpty Prelude.Text)
associateTargetsWithJob_targets :: (NonEmpty Text -> f (NonEmpty Text))
-> AssociateTargetsWithJob -> f AssociateTargetsWithJob
associateTargetsWithJob_targets = (AssociateTargetsWithJob -> NonEmpty Text)
-> (AssociateTargetsWithJob
    -> NonEmpty Text -> AssociateTargetsWithJob)
-> Lens
     AssociateTargetsWithJob
     AssociateTargetsWithJob
     (NonEmpty Text)
     (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTargetsWithJob' {NonEmpty Text
targets :: NonEmpty Text
$sel:targets:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> NonEmpty Text
targets} -> NonEmpty Text
targets) (\s :: AssociateTargetsWithJob
s@AssociateTargetsWithJob' {} NonEmpty Text
a -> AssociateTargetsWithJob
s {$sel:targets:AssociateTargetsWithJob' :: NonEmpty Text
targets = NonEmpty Text
a} :: AssociateTargetsWithJob) ((NonEmpty Text -> f (NonEmpty Text))
 -> AssociateTargetsWithJob -> f AssociateTargetsWithJob)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> AssociateTargetsWithJob
-> f AssociateTargetsWithJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier you assigned to this job when it was created.
associateTargetsWithJob_jobId :: Lens.Lens' AssociateTargetsWithJob Prelude.Text
associateTargetsWithJob_jobId :: (Text -> f Text)
-> AssociateTargetsWithJob -> f AssociateTargetsWithJob
associateTargetsWithJob_jobId = (AssociateTargetsWithJob -> Text)
-> (AssociateTargetsWithJob -> Text -> AssociateTargetsWithJob)
-> Lens AssociateTargetsWithJob AssociateTargetsWithJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTargetsWithJob' {Text
jobId :: Text
$sel:jobId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Text
jobId} -> Text
jobId) (\s :: AssociateTargetsWithJob
s@AssociateTargetsWithJob' {} Text
a -> AssociateTargetsWithJob
s {$sel:jobId:AssociateTargetsWithJob' :: Text
jobId = Text
a} :: AssociateTargetsWithJob)

instance Core.AWSRequest AssociateTargetsWithJob where
  type
    AWSResponse AssociateTargetsWithJob =
      AssociateTargetsWithJobResponse
  request :: AssociateTargetsWithJob -> Request AssociateTargetsWithJob
request = Service
-> AssociateTargetsWithJob -> Request AssociateTargetsWithJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AssociateTargetsWithJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateTargetsWithJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AssociateTargetsWithJob))
-> Logger
-> Service
-> Proxy AssociateTargetsWithJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateTargetsWithJob)))
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
-> AssociateTargetsWithJobResponse
AssociateTargetsWithJobResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> AssociateTargetsWithJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> AssociateTargetsWithJobResponse)
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
"jobId")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> AssociateTargetsWithJobResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> AssociateTargetsWithJobResponse)
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
"jobArn")
            Either
  String (Maybe Text -> Int -> AssociateTargetsWithJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> AssociateTargetsWithJobResponse)
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
"description")
            Either String (Int -> AssociateTargetsWithJobResponse)
-> Either String Int
-> Either String AssociateTargetsWithJobResponse
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 AssociateTargetsWithJob

instance Prelude.NFData AssociateTargetsWithJob

instance Core.ToHeaders AssociateTargetsWithJob where
  toHeaders :: AssociateTargetsWithJob -> ResponseHeaders
toHeaders = ResponseHeaders -> AssociateTargetsWithJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON AssociateTargetsWithJob where
  toJSON :: AssociateTargetsWithJob -> Value
toJSON AssociateTargetsWithJob' {Maybe Text
NonEmpty Text
Text
jobId :: Text
targets :: NonEmpty Text
comment :: Maybe Text
namespaceId :: Maybe Text
$sel:jobId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Text
$sel:targets:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> NonEmpty Text
$sel:comment:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
$sel:namespaceId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"comment" 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
comment,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"targets" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
targets)
          ]
      )

instance Core.ToPath AssociateTargetsWithJob where
  toPath :: AssociateTargetsWithJob -> ByteString
toPath AssociateTargetsWithJob' {Maybe Text
NonEmpty Text
Text
jobId :: Text
targets :: NonEmpty Text
comment :: Maybe Text
namespaceId :: Maybe Text
$sel:jobId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Text
$sel:targets:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> NonEmpty Text
$sel:comment:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
$sel:namespaceId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/jobs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobId, ByteString
"/targets"]

instance Core.ToQuery AssociateTargetsWithJob where
  toQuery :: AssociateTargetsWithJob -> QueryString
toQuery AssociateTargetsWithJob' {Maybe Text
NonEmpty Text
Text
jobId :: Text
targets :: NonEmpty Text
comment :: Maybe Text
namespaceId :: Maybe Text
$sel:jobId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Text
$sel:targets:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> NonEmpty Text
$sel:comment:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
$sel:namespaceId:AssociateTargetsWithJob' :: AssociateTargetsWithJob -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"namespaceId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
namespaceId]

-- | /See:/ 'newAssociateTargetsWithJobResponse' smart constructor.
data AssociateTargetsWithJobResponse = AssociateTargetsWithJobResponse'
  { -- | The unique identifier you assigned to this job when it was created.
    AssociateTargetsWithJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | An ARN identifying the job.
    AssociateTargetsWithJobResponse -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
    -- | A short text description of the job.
    AssociateTargetsWithJobResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    AssociateTargetsWithJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateTargetsWithJobResponse
-> AssociateTargetsWithJobResponse -> Bool
(AssociateTargetsWithJobResponse
 -> AssociateTargetsWithJobResponse -> Bool)
-> (AssociateTargetsWithJobResponse
    -> AssociateTargetsWithJobResponse -> Bool)
-> Eq AssociateTargetsWithJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateTargetsWithJobResponse
-> AssociateTargetsWithJobResponse -> Bool
$c/= :: AssociateTargetsWithJobResponse
-> AssociateTargetsWithJobResponse -> Bool
== :: AssociateTargetsWithJobResponse
-> AssociateTargetsWithJobResponse -> Bool
$c== :: AssociateTargetsWithJobResponse
-> AssociateTargetsWithJobResponse -> Bool
Prelude.Eq, ReadPrec [AssociateTargetsWithJobResponse]
ReadPrec AssociateTargetsWithJobResponse
Int -> ReadS AssociateTargetsWithJobResponse
ReadS [AssociateTargetsWithJobResponse]
(Int -> ReadS AssociateTargetsWithJobResponse)
-> ReadS [AssociateTargetsWithJobResponse]
-> ReadPrec AssociateTargetsWithJobResponse
-> ReadPrec [AssociateTargetsWithJobResponse]
-> Read AssociateTargetsWithJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateTargetsWithJobResponse]
$creadListPrec :: ReadPrec [AssociateTargetsWithJobResponse]
readPrec :: ReadPrec AssociateTargetsWithJobResponse
$creadPrec :: ReadPrec AssociateTargetsWithJobResponse
readList :: ReadS [AssociateTargetsWithJobResponse]
$creadList :: ReadS [AssociateTargetsWithJobResponse]
readsPrec :: Int -> ReadS AssociateTargetsWithJobResponse
$creadsPrec :: Int -> ReadS AssociateTargetsWithJobResponse
Prelude.Read, Int -> AssociateTargetsWithJobResponse -> ShowS
[AssociateTargetsWithJobResponse] -> ShowS
AssociateTargetsWithJobResponse -> String
(Int -> AssociateTargetsWithJobResponse -> ShowS)
-> (AssociateTargetsWithJobResponse -> String)
-> ([AssociateTargetsWithJobResponse] -> ShowS)
-> Show AssociateTargetsWithJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateTargetsWithJobResponse] -> ShowS
$cshowList :: [AssociateTargetsWithJobResponse] -> ShowS
show :: AssociateTargetsWithJobResponse -> String
$cshow :: AssociateTargetsWithJobResponse -> String
showsPrec :: Int -> AssociateTargetsWithJobResponse -> ShowS
$cshowsPrec :: Int -> AssociateTargetsWithJobResponse -> ShowS
Prelude.Show, (forall x.
 AssociateTargetsWithJobResponse
 -> Rep AssociateTargetsWithJobResponse x)
-> (forall x.
    Rep AssociateTargetsWithJobResponse x
    -> AssociateTargetsWithJobResponse)
-> Generic AssociateTargetsWithJobResponse
forall x.
Rep AssociateTargetsWithJobResponse x
-> AssociateTargetsWithJobResponse
forall x.
AssociateTargetsWithJobResponse
-> Rep AssociateTargetsWithJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateTargetsWithJobResponse x
-> AssociateTargetsWithJobResponse
$cfrom :: forall x.
AssociateTargetsWithJobResponse
-> Rep AssociateTargetsWithJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateTargetsWithJobResponse' 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:
--
-- 'jobId', 'associateTargetsWithJobResponse_jobId' - The unique identifier you assigned to this job when it was created.
--
-- 'jobArn', 'associateTargetsWithJobResponse_jobArn' - An ARN identifying the job.
--
-- 'description', 'associateTargetsWithJobResponse_description' - A short text description of the job.
--
-- 'httpStatus', 'associateTargetsWithJobResponse_httpStatus' - The response's http status code.
newAssociateTargetsWithJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateTargetsWithJobResponse
newAssociateTargetsWithJobResponse :: Int -> AssociateTargetsWithJobResponse
newAssociateTargetsWithJobResponse Int
pHttpStatus_ =
  AssociateTargetsWithJobResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> AssociateTargetsWithJobResponse
AssociateTargetsWithJobResponse'
    { $sel:jobId:AssociateTargetsWithJobResponse' :: Maybe Text
jobId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobArn:AssociateTargetsWithJobResponse' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AssociateTargetsWithJobResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AssociateTargetsWithJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier you assigned to this job when it was created.
associateTargetsWithJobResponse_jobId :: Lens.Lens' AssociateTargetsWithJobResponse (Prelude.Maybe Prelude.Text)
associateTargetsWithJobResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> AssociateTargetsWithJobResponse
-> f AssociateTargetsWithJobResponse
associateTargetsWithJobResponse_jobId = (AssociateTargetsWithJobResponse -> Maybe Text)
-> (AssociateTargetsWithJobResponse
    -> Maybe Text -> AssociateTargetsWithJobResponse)
-> Lens
     AssociateTargetsWithJobResponse
     AssociateTargetsWithJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTargetsWithJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:AssociateTargetsWithJobResponse' :: AssociateTargetsWithJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: AssociateTargetsWithJobResponse
s@AssociateTargetsWithJobResponse' {} Maybe Text
a -> AssociateTargetsWithJobResponse
s {$sel:jobId:AssociateTargetsWithJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: AssociateTargetsWithJobResponse)

-- | An ARN identifying the job.
associateTargetsWithJobResponse_jobArn :: Lens.Lens' AssociateTargetsWithJobResponse (Prelude.Maybe Prelude.Text)
associateTargetsWithJobResponse_jobArn :: (Maybe Text -> f (Maybe Text))
-> AssociateTargetsWithJobResponse
-> f AssociateTargetsWithJobResponse
associateTargetsWithJobResponse_jobArn = (AssociateTargetsWithJobResponse -> Maybe Text)
-> (AssociateTargetsWithJobResponse
    -> Maybe Text -> AssociateTargetsWithJobResponse)
-> Lens
     AssociateTargetsWithJobResponse
     AssociateTargetsWithJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTargetsWithJobResponse' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:AssociateTargetsWithJobResponse' :: AssociateTargetsWithJobResponse -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: AssociateTargetsWithJobResponse
s@AssociateTargetsWithJobResponse' {} Maybe Text
a -> AssociateTargetsWithJobResponse
s {$sel:jobArn:AssociateTargetsWithJobResponse' :: Maybe Text
jobArn = Maybe Text
a} :: AssociateTargetsWithJobResponse)

-- | A short text description of the job.
associateTargetsWithJobResponse_description :: Lens.Lens' AssociateTargetsWithJobResponse (Prelude.Maybe Prelude.Text)
associateTargetsWithJobResponse_description :: (Maybe Text -> f (Maybe Text))
-> AssociateTargetsWithJobResponse
-> f AssociateTargetsWithJobResponse
associateTargetsWithJobResponse_description = (AssociateTargetsWithJobResponse -> Maybe Text)
-> (AssociateTargetsWithJobResponse
    -> Maybe Text -> AssociateTargetsWithJobResponse)
-> Lens
     AssociateTargetsWithJobResponse
     AssociateTargetsWithJobResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTargetsWithJobResponse' {Maybe Text
description :: Maybe Text
$sel:description:AssociateTargetsWithJobResponse' :: AssociateTargetsWithJobResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: AssociateTargetsWithJobResponse
s@AssociateTargetsWithJobResponse' {} Maybe Text
a -> AssociateTargetsWithJobResponse
s {$sel:description:AssociateTargetsWithJobResponse' :: Maybe Text
description = Maybe Text
a} :: AssociateTargetsWithJobResponse)

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

instance
  Prelude.NFData
    AssociateTargetsWithJobResponse