{-# 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.GreengrassV2.GetDeployment
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a deployment. Deployments define the components that run on
-- Greengrass core devices.
module Amazonka.GreengrassV2.GetDeployment
  ( -- * Creating a Request
    GetDeployment (..),
    newGetDeployment,

    -- * Request Lenses
    getDeployment_deploymentId,

    -- * Destructuring the Response
    GetDeploymentResponse (..),
    newGetDeploymentResponse,

    -- * Response Lenses
    getDeploymentResponse_components,
    getDeploymentResponse_creationTimestamp,
    getDeploymentResponse_deploymentId,
    getDeploymentResponse_deploymentName,
    getDeploymentResponse_deploymentPolicies,
    getDeploymentResponse_deploymentStatus,
    getDeploymentResponse_iotJobArn,
    getDeploymentResponse_iotJobConfiguration,
    getDeploymentResponse_iotJobId,
    getDeploymentResponse_isLatestForTarget,
    getDeploymentResponse_parentTargetArn,
    getDeploymentResponse_revisionId,
    getDeploymentResponse_tags,
    getDeploymentResponse_targetArn,
    getDeploymentResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GreengrassV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetDeployment' smart constructor.
data GetDeployment = GetDeployment'
  { -- | The ID of the deployment.
    GetDeployment -> Text
deploymentId :: Prelude.Text
  }
  deriving (GetDeployment -> GetDeployment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeployment -> GetDeployment -> Bool
$c/= :: GetDeployment -> GetDeployment -> Bool
== :: GetDeployment -> GetDeployment -> Bool
$c== :: GetDeployment -> GetDeployment -> Bool
Prelude.Eq, ReadPrec [GetDeployment]
ReadPrec GetDeployment
Int -> ReadS GetDeployment
ReadS [GetDeployment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeployment]
$creadListPrec :: ReadPrec [GetDeployment]
readPrec :: ReadPrec GetDeployment
$creadPrec :: ReadPrec GetDeployment
readList :: ReadS [GetDeployment]
$creadList :: ReadS [GetDeployment]
readsPrec :: Int -> ReadS GetDeployment
$creadsPrec :: Int -> ReadS GetDeployment
Prelude.Read, Int -> GetDeployment -> ShowS
[GetDeployment] -> ShowS
GetDeployment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeployment] -> ShowS
$cshowList :: [GetDeployment] -> ShowS
show :: GetDeployment -> String
$cshow :: GetDeployment -> String
showsPrec :: Int -> GetDeployment -> ShowS
$cshowsPrec :: Int -> GetDeployment -> ShowS
Prelude.Show, forall x. Rep GetDeployment x -> GetDeployment
forall x. GetDeployment -> Rep GetDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeployment x -> GetDeployment
$cfrom :: forall x. GetDeployment -> Rep GetDeployment x
Prelude.Generic)

-- |
-- Create a value of 'GetDeployment' 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:
--
-- 'deploymentId', 'getDeployment_deploymentId' - The ID of the deployment.
newGetDeployment ::
  -- | 'deploymentId'
  Prelude.Text ->
  GetDeployment
newGetDeployment :: Text -> GetDeployment
newGetDeployment Text
pDeploymentId_ =
  GetDeployment' {$sel:deploymentId:GetDeployment' :: Text
deploymentId = Text
pDeploymentId_}

-- | The ID of the deployment.
getDeployment_deploymentId :: Lens.Lens' GetDeployment Prelude.Text
getDeployment_deploymentId :: Lens' GetDeployment Text
getDeployment_deploymentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeployment' {Text
deploymentId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
deploymentId} -> Text
deploymentId) (\s :: GetDeployment
s@GetDeployment' {} Text
a -> GetDeployment
s {$sel:deploymentId:GetDeployment' :: Text
deploymentId = Text
a} :: GetDeployment)

instance Core.AWSRequest GetDeployment where
  type
    AWSResponse GetDeployment =
      GetDeploymentResponse
  request :: (Service -> Service) -> GetDeployment -> Request GetDeployment
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDeployment)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (HashMap Text ComponentDeploymentSpecification)
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe DeploymentPolicies
-> Maybe DeploymentStatus
-> Maybe Text
-> Maybe DeploymentIoTJobConfiguration
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Int
-> GetDeploymentResponse
GetDeploymentResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"components" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"creationTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentPolicies")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"iotJobArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"iotJobConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"iotJobId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"isLatestForTarget")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"parentTargetArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"revisionId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"targetArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetDeployment where
  hashWithSalt :: Int -> GetDeployment -> Int
hashWithSalt Int
_salt GetDeployment' {Text
deploymentId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deploymentId

instance Prelude.NFData GetDeployment where
  rnf :: GetDeployment -> ()
rnf GetDeployment' {Text
deploymentId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
deploymentId

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

instance Data.ToPath GetDeployment where
  toPath :: GetDeployment -> ByteString
toPath GetDeployment' {Text
deploymentId :: Text
$sel:deploymentId:GetDeployment' :: GetDeployment -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/deployments/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
deploymentId
      ]

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

-- | /See:/ 'newGetDeploymentResponse' smart constructor.
data GetDeploymentResponse = GetDeploymentResponse'
  { -- | The components to deploy. This is a dictionary, where each key is the
    -- name of a component, and each key\'s value is the version and
    -- configuration to deploy for that component.
    GetDeploymentResponse
-> Maybe (HashMap Text ComponentDeploymentSpecification)
components :: Prelude.Maybe (Prelude.HashMap Prelude.Text ComponentDeploymentSpecification),
    -- | The time at which the deployment was created, expressed in ISO 8601
    -- format.
    GetDeploymentResponse -> Maybe POSIX
creationTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The ID of the deployment.
    GetDeploymentResponse -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | The name of the deployment.
    GetDeploymentResponse -> Maybe Text
deploymentName :: Prelude.Maybe Prelude.Text,
    -- | The deployment policies for the deployment. These policies define how
    -- the deployment updates components and handles failure.
    GetDeploymentResponse -> Maybe DeploymentPolicies
deploymentPolicies :: Prelude.Maybe DeploymentPolicies,
    -- | The status of the deployment.
    GetDeploymentResponse -> Maybe DeploymentStatus
deploymentStatus :: Prelude.Maybe DeploymentStatus,
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the IoT job that applies the deployment to target devices.
    GetDeploymentResponse -> Maybe Text
iotJobArn :: Prelude.Maybe Prelude.Text,
    -- | The job configuration for the deployment configuration. The job
    -- configuration specifies the rollout, timeout, and stop configurations
    -- for the deployment configuration.
    GetDeploymentResponse -> Maybe DeploymentIoTJobConfiguration
iotJobConfiguration :: Prelude.Maybe DeploymentIoTJobConfiguration,
    -- | The ID of the IoT job that applies the deployment to target devices.
    GetDeploymentResponse -> Maybe Text
iotJobId :: Prelude.Maybe Prelude.Text,
    -- | Whether or not the deployment is the latest revision for its target.
    GetDeploymentResponse -> Maybe Bool
isLatestForTarget :: Prelude.Maybe Prelude.Bool,
    -- | The parent deployment\'s target
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- within a subdeployment.
    GetDeploymentResponse -> Maybe Text
parentTargetArn :: Prelude.Maybe Prelude.Text,
    -- | The revision number of the deployment.
    GetDeploymentResponse -> Maybe Text
revisionId :: Prelude.Maybe Prelude.Text,
    -- | A list of key-value pairs that contain metadata for the resource. For
    -- more information, see
    -- <https://docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html Tag your resources>
    -- in the /IoT Greengrass V2 Developer Guide/.
    GetDeploymentResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the target IoT thing or thing group.
    GetDeploymentResponse -> Maybe Text
targetArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetDeploymentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDeploymentResponse -> GetDeploymentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
$c/= :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
== :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
$c== :: GetDeploymentResponse -> GetDeploymentResponse -> Bool
Prelude.Eq, ReadPrec [GetDeploymentResponse]
ReadPrec GetDeploymentResponse
Int -> ReadS GetDeploymentResponse
ReadS [GetDeploymentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeploymentResponse]
$creadListPrec :: ReadPrec [GetDeploymentResponse]
readPrec :: ReadPrec GetDeploymentResponse
$creadPrec :: ReadPrec GetDeploymentResponse
readList :: ReadS [GetDeploymentResponse]
$creadList :: ReadS [GetDeploymentResponse]
readsPrec :: Int -> ReadS GetDeploymentResponse
$creadsPrec :: Int -> ReadS GetDeploymentResponse
Prelude.Read, Int -> GetDeploymentResponse -> ShowS
[GetDeploymentResponse] -> ShowS
GetDeploymentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeploymentResponse] -> ShowS
$cshowList :: [GetDeploymentResponse] -> ShowS
show :: GetDeploymentResponse -> String
$cshow :: GetDeploymentResponse -> String
showsPrec :: Int -> GetDeploymentResponse -> ShowS
$cshowsPrec :: Int -> GetDeploymentResponse -> ShowS
Prelude.Show, forall x. Rep GetDeploymentResponse x -> GetDeploymentResponse
forall x. GetDeploymentResponse -> Rep GetDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeploymentResponse x -> GetDeploymentResponse
$cfrom :: forall x. GetDeploymentResponse -> Rep GetDeploymentResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDeploymentResponse' 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:
--
-- 'components', 'getDeploymentResponse_components' - The components to deploy. This is a dictionary, where each key is the
-- name of a component, and each key\'s value is the version and
-- configuration to deploy for that component.
--
-- 'creationTimestamp', 'getDeploymentResponse_creationTimestamp' - The time at which the deployment was created, expressed in ISO 8601
-- format.
--
-- 'deploymentId', 'getDeploymentResponse_deploymentId' - The ID of the deployment.
--
-- 'deploymentName', 'getDeploymentResponse_deploymentName' - The name of the deployment.
--
-- 'deploymentPolicies', 'getDeploymentResponse_deploymentPolicies' - The deployment policies for the deployment. These policies define how
-- the deployment updates components and handles failure.
--
-- 'deploymentStatus', 'getDeploymentResponse_deploymentStatus' - The status of the deployment.
--
-- 'iotJobArn', 'getDeploymentResponse_iotJobArn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the IoT job that applies the deployment to target devices.
--
-- 'iotJobConfiguration', 'getDeploymentResponse_iotJobConfiguration' - The job configuration for the deployment configuration. The job
-- configuration specifies the rollout, timeout, and stop configurations
-- for the deployment configuration.
--
-- 'iotJobId', 'getDeploymentResponse_iotJobId' - The ID of the IoT job that applies the deployment to target devices.
--
-- 'isLatestForTarget', 'getDeploymentResponse_isLatestForTarget' - Whether or not the deployment is the latest revision for its target.
--
-- 'parentTargetArn', 'getDeploymentResponse_parentTargetArn' - The parent deployment\'s target
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- within a subdeployment.
--
-- 'revisionId', 'getDeploymentResponse_revisionId' - The revision number of the deployment.
--
-- 'tags', 'getDeploymentResponse_tags' - A list of key-value pairs that contain metadata for the resource. For
-- more information, see
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html Tag your resources>
-- in the /IoT Greengrass V2 Developer Guide/.
--
-- 'targetArn', 'getDeploymentResponse_targetArn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the target IoT thing or thing group.
--
-- 'httpStatus', 'getDeploymentResponse_httpStatus' - The response's http status code.
newGetDeploymentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDeploymentResponse
newGetDeploymentResponse :: Int -> GetDeploymentResponse
newGetDeploymentResponse Int
pHttpStatus_ =
  GetDeploymentResponse'
    { $sel:components:GetDeploymentResponse' :: Maybe (HashMap Text ComponentDeploymentSpecification)
components =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimestamp:GetDeploymentResponse' :: Maybe POSIX
creationTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentId:GetDeploymentResponse' :: Maybe Text
deploymentId = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentName:GetDeploymentResponse' :: Maybe Text
deploymentName = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentPolicies:GetDeploymentResponse' :: Maybe DeploymentPolicies
deploymentPolicies = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentStatus:GetDeploymentResponse' :: Maybe DeploymentStatus
deploymentStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:iotJobArn:GetDeploymentResponse' :: Maybe Text
iotJobArn = forall a. Maybe a
Prelude.Nothing,
      $sel:iotJobConfiguration:GetDeploymentResponse' :: Maybe DeploymentIoTJobConfiguration
iotJobConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:iotJobId:GetDeploymentResponse' :: Maybe Text
iotJobId = forall a. Maybe a
Prelude.Nothing,
      $sel:isLatestForTarget:GetDeploymentResponse' :: Maybe Bool
isLatestForTarget = forall a. Maybe a
Prelude.Nothing,
      $sel:parentTargetArn:GetDeploymentResponse' :: Maybe Text
parentTargetArn = forall a. Maybe a
Prelude.Nothing,
      $sel:revisionId:GetDeploymentResponse' :: Maybe Text
revisionId = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GetDeploymentResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:targetArn:GetDeploymentResponse' :: Maybe Text
targetArn = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDeploymentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The components to deploy. This is a dictionary, where each key is the
-- name of a component, and each key\'s value is the version and
-- configuration to deploy for that component.
getDeploymentResponse_components :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text ComponentDeploymentSpecification))
getDeploymentResponse_components :: Lens'
  GetDeploymentResponse
  (Maybe (HashMap Text ComponentDeploymentSpecification))
getDeploymentResponse_components = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe (HashMap Text ComponentDeploymentSpecification)
components :: Maybe (HashMap Text ComponentDeploymentSpecification)
$sel:components:GetDeploymentResponse' :: GetDeploymentResponse
-> Maybe (HashMap Text ComponentDeploymentSpecification)
components} -> Maybe (HashMap Text ComponentDeploymentSpecification)
components) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe (HashMap Text ComponentDeploymentSpecification)
a -> GetDeploymentResponse
s {$sel:components:GetDeploymentResponse' :: Maybe (HashMap Text ComponentDeploymentSpecification)
components = Maybe (HashMap Text ComponentDeploymentSpecification)
a} :: GetDeploymentResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time at which the deployment was created, expressed in ISO 8601
-- format.
getDeploymentResponse_creationTimestamp :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.UTCTime)
getDeploymentResponse_creationTimestamp :: Lens' GetDeploymentResponse (Maybe UTCTime)
getDeploymentResponse_creationTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe POSIX
creationTimestamp :: Maybe POSIX
$sel:creationTimestamp:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe POSIX
creationTimestamp} -> Maybe POSIX
creationTimestamp) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe POSIX
a -> GetDeploymentResponse
s {$sel:creationTimestamp:GetDeploymentResponse' :: Maybe POSIX
creationTimestamp = Maybe POSIX
a} :: GetDeploymentResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ID of the deployment.
getDeploymentResponse_deploymentId :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_deploymentId :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_deploymentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:deploymentId:GetDeploymentResponse' :: Maybe Text
deploymentId = Maybe Text
a} :: GetDeploymentResponse)

-- | The name of the deployment.
getDeploymentResponse_deploymentName :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_deploymentName :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_deploymentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
deploymentName :: Maybe Text
$sel:deploymentName:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
deploymentName} -> Maybe Text
deploymentName) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:deploymentName:GetDeploymentResponse' :: Maybe Text
deploymentName = Maybe Text
a} :: GetDeploymentResponse)

-- | The deployment policies for the deployment. These policies define how
-- the deployment updates components and handles failure.
getDeploymentResponse_deploymentPolicies :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe DeploymentPolicies)
getDeploymentResponse_deploymentPolicies :: Lens' GetDeploymentResponse (Maybe DeploymentPolicies)
getDeploymentResponse_deploymentPolicies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe DeploymentPolicies
deploymentPolicies :: Maybe DeploymentPolicies
$sel:deploymentPolicies:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentPolicies
deploymentPolicies} -> Maybe DeploymentPolicies
deploymentPolicies) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe DeploymentPolicies
a -> GetDeploymentResponse
s {$sel:deploymentPolicies:GetDeploymentResponse' :: Maybe DeploymentPolicies
deploymentPolicies = Maybe DeploymentPolicies
a} :: GetDeploymentResponse)

-- | The status of the deployment.
getDeploymentResponse_deploymentStatus :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe DeploymentStatus)
getDeploymentResponse_deploymentStatus :: Lens' GetDeploymentResponse (Maybe DeploymentStatus)
getDeploymentResponse_deploymentStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe DeploymentStatus
deploymentStatus :: Maybe DeploymentStatus
$sel:deploymentStatus:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentStatus
deploymentStatus} -> Maybe DeploymentStatus
deploymentStatus) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe DeploymentStatus
a -> GetDeploymentResponse
s {$sel:deploymentStatus:GetDeploymentResponse' :: Maybe DeploymentStatus
deploymentStatus = Maybe DeploymentStatus
a} :: GetDeploymentResponse)

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the IoT job that applies the deployment to target devices.
getDeploymentResponse_iotJobArn :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_iotJobArn :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_iotJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
iotJobArn :: Maybe Text
$sel:iotJobArn:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
iotJobArn} -> Maybe Text
iotJobArn) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:iotJobArn:GetDeploymentResponse' :: Maybe Text
iotJobArn = Maybe Text
a} :: GetDeploymentResponse)

-- | The job configuration for the deployment configuration. The job
-- configuration specifies the rollout, timeout, and stop configurations
-- for the deployment configuration.
getDeploymentResponse_iotJobConfiguration :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe DeploymentIoTJobConfiguration)
getDeploymentResponse_iotJobConfiguration :: Lens' GetDeploymentResponse (Maybe DeploymentIoTJobConfiguration)
getDeploymentResponse_iotJobConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe DeploymentIoTJobConfiguration
iotJobConfiguration :: Maybe DeploymentIoTJobConfiguration
$sel:iotJobConfiguration:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentIoTJobConfiguration
iotJobConfiguration} -> Maybe DeploymentIoTJobConfiguration
iotJobConfiguration) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe DeploymentIoTJobConfiguration
a -> GetDeploymentResponse
s {$sel:iotJobConfiguration:GetDeploymentResponse' :: Maybe DeploymentIoTJobConfiguration
iotJobConfiguration = Maybe DeploymentIoTJobConfiguration
a} :: GetDeploymentResponse)

-- | The ID of the IoT job that applies the deployment to target devices.
getDeploymentResponse_iotJobId :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_iotJobId :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_iotJobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
iotJobId :: Maybe Text
$sel:iotJobId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
iotJobId} -> Maybe Text
iotJobId) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:iotJobId:GetDeploymentResponse' :: Maybe Text
iotJobId = Maybe Text
a} :: GetDeploymentResponse)

-- | Whether or not the deployment is the latest revision for its target.
getDeploymentResponse_isLatestForTarget :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Bool)
getDeploymentResponse_isLatestForTarget :: Lens' GetDeploymentResponse (Maybe Bool)
getDeploymentResponse_isLatestForTarget = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Bool
isLatestForTarget :: Maybe Bool
$sel:isLatestForTarget:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Bool
isLatestForTarget} -> Maybe Bool
isLatestForTarget) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Bool
a -> GetDeploymentResponse
s {$sel:isLatestForTarget:GetDeploymentResponse' :: Maybe Bool
isLatestForTarget = Maybe Bool
a} :: GetDeploymentResponse)

-- | The parent deployment\'s target
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- within a subdeployment.
getDeploymentResponse_parentTargetArn :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_parentTargetArn :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_parentTargetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
parentTargetArn :: Maybe Text
$sel:parentTargetArn:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
parentTargetArn} -> Maybe Text
parentTargetArn) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:parentTargetArn:GetDeploymentResponse' :: Maybe Text
parentTargetArn = Maybe Text
a} :: GetDeploymentResponse)

-- | The revision number of the deployment.
getDeploymentResponse_revisionId :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_revisionId :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_revisionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
revisionId :: Maybe Text
$sel:revisionId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
revisionId} -> Maybe Text
revisionId) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:revisionId:GetDeploymentResponse' :: Maybe Text
revisionId = Maybe Text
a} :: GetDeploymentResponse)

-- | A list of key-value pairs that contain metadata for the resource. For
-- more information, see
-- <https://docs.aws.amazon.com/greengrass/v2/developerguide/tag-resources.html Tag your resources>
-- in the /IoT Greengrass V2 Developer Guide/.
getDeploymentResponse_tags :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getDeploymentResponse_tags :: Lens' GetDeploymentResponse (Maybe (HashMap Text Text))
getDeploymentResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe (HashMap Text Text)
a -> GetDeploymentResponse
s {$sel:tags:GetDeploymentResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetDeploymentResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the target IoT thing or thing group.
getDeploymentResponse_targetArn :: Lens.Lens' GetDeploymentResponse (Prelude.Maybe Prelude.Text)
getDeploymentResponse_targetArn :: Lens' GetDeploymentResponse (Maybe Text)
getDeploymentResponse_targetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentResponse' {Maybe Text
targetArn :: Maybe Text
$sel:targetArn:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
targetArn} -> Maybe Text
targetArn) (\s :: GetDeploymentResponse
s@GetDeploymentResponse' {} Maybe Text
a -> GetDeploymentResponse
s {$sel:targetArn:GetDeploymentResponse' :: Maybe Text
targetArn = Maybe Text
a} :: GetDeploymentResponse)

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

instance Prelude.NFData GetDeploymentResponse where
  rnf :: GetDeploymentResponse -> ()
rnf GetDeploymentResponse' {Int
Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text ComponentDeploymentSpecification)
Maybe POSIX
Maybe DeploymentPolicies
Maybe DeploymentStatus
Maybe DeploymentIoTJobConfiguration
httpStatus :: Int
targetArn :: Maybe Text
tags :: Maybe (HashMap Text Text)
revisionId :: Maybe Text
parentTargetArn :: Maybe Text
isLatestForTarget :: Maybe Bool
iotJobId :: Maybe Text
iotJobConfiguration :: Maybe DeploymentIoTJobConfiguration
iotJobArn :: Maybe Text
deploymentStatus :: Maybe DeploymentStatus
deploymentPolicies :: Maybe DeploymentPolicies
deploymentName :: Maybe Text
deploymentId :: Maybe Text
creationTimestamp :: Maybe POSIX
components :: Maybe (HashMap Text ComponentDeploymentSpecification)
$sel:httpStatus:GetDeploymentResponse' :: GetDeploymentResponse -> Int
$sel:targetArn:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:tags:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe (HashMap Text Text)
$sel:revisionId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:parentTargetArn:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:isLatestForTarget:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Bool
$sel:iotJobId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:iotJobConfiguration:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentIoTJobConfiguration
$sel:iotJobArn:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:deploymentStatus:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentStatus
$sel:deploymentPolicies:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe DeploymentPolicies
$sel:deploymentName:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:deploymentId:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe Text
$sel:creationTimestamp:GetDeploymentResponse' :: GetDeploymentResponse -> Maybe POSIX
$sel:components:GetDeploymentResponse' :: GetDeploymentResponse
-> Maybe (HashMap Text ComponentDeploymentSpecification)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text ComponentDeploymentSpecification)
components
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentPolicies
deploymentPolicies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentStatus
deploymentStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iotJobArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentIoTJobConfiguration
iotJobConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iotJobId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isLatestForTarget
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parentTargetArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revisionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus