{-# 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.Greengrass.Types.BulkDeployment
-- 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.Greengrass.Types.BulkDeployment where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a bulk deployment. You cannot start a new bulk
-- deployment while another one is still running or in a non-terminal
-- state.
--
-- /See:/ 'newBulkDeployment' smart constructor.
data BulkDeployment = BulkDeployment'
  { -- | The ARN of the bulk deployment.
    BulkDeployment -> Maybe Text
bulkDeploymentArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the bulk deployment.
    BulkDeployment -> Maybe Text
bulkDeploymentId :: Prelude.Maybe Prelude.Text,
    -- | The time, in ISO format, when the deployment was created.
    BulkDeployment -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text
  }
  deriving (BulkDeployment -> BulkDeployment -> Bool
(BulkDeployment -> BulkDeployment -> Bool)
-> (BulkDeployment -> BulkDeployment -> Bool) -> Eq BulkDeployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BulkDeployment -> BulkDeployment -> Bool
$c/= :: BulkDeployment -> BulkDeployment -> Bool
== :: BulkDeployment -> BulkDeployment -> Bool
$c== :: BulkDeployment -> BulkDeployment -> Bool
Prelude.Eq, ReadPrec [BulkDeployment]
ReadPrec BulkDeployment
Int -> ReadS BulkDeployment
ReadS [BulkDeployment]
(Int -> ReadS BulkDeployment)
-> ReadS [BulkDeployment]
-> ReadPrec BulkDeployment
-> ReadPrec [BulkDeployment]
-> Read BulkDeployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BulkDeployment]
$creadListPrec :: ReadPrec [BulkDeployment]
readPrec :: ReadPrec BulkDeployment
$creadPrec :: ReadPrec BulkDeployment
readList :: ReadS [BulkDeployment]
$creadList :: ReadS [BulkDeployment]
readsPrec :: Int -> ReadS BulkDeployment
$creadsPrec :: Int -> ReadS BulkDeployment
Prelude.Read, Int -> BulkDeployment -> ShowS
[BulkDeployment] -> ShowS
BulkDeployment -> String
(Int -> BulkDeployment -> ShowS)
-> (BulkDeployment -> String)
-> ([BulkDeployment] -> ShowS)
-> Show BulkDeployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BulkDeployment] -> ShowS
$cshowList :: [BulkDeployment] -> ShowS
show :: BulkDeployment -> String
$cshow :: BulkDeployment -> String
showsPrec :: Int -> BulkDeployment -> ShowS
$cshowsPrec :: Int -> BulkDeployment -> ShowS
Prelude.Show, (forall x. BulkDeployment -> Rep BulkDeployment x)
-> (forall x. Rep BulkDeployment x -> BulkDeployment)
-> Generic BulkDeployment
forall x. Rep BulkDeployment x -> BulkDeployment
forall x. BulkDeployment -> Rep BulkDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BulkDeployment x -> BulkDeployment
$cfrom :: forall x. BulkDeployment -> Rep BulkDeployment x
Prelude.Generic)

-- |
-- Create a value of 'BulkDeployment' 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:
--
-- 'bulkDeploymentArn', 'bulkDeployment_bulkDeploymentArn' - The ARN of the bulk deployment.
--
-- 'bulkDeploymentId', 'bulkDeployment_bulkDeploymentId' - The ID of the bulk deployment.
--
-- 'createdAt', 'bulkDeployment_createdAt' - The time, in ISO format, when the deployment was created.
newBulkDeployment ::
  BulkDeployment
newBulkDeployment :: BulkDeployment
newBulkDeployment =
  BulkDeployment' :: Maybe Text -> Maybe Text -> Maybe Text -> BulkDeployment
BulkDeployment'
    { $sel:bulkDeploymentArn:BulkDeployment' :: Maybe Text
bulkDeploymentArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bulkDeploymentId:BulkDeployment' :: Maybe Text
bulkDeploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:BulkDeployment' :: Maybe Text
createdAt = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the bulk deployment.
bulkDeployment_bulkDeploymentArn :: Lens.Lens' BulkDeployment (Prelude.Maybe Prelude.Text)
bulkDeployment_bulkDeploymentArn :: (Maybe Text -> f (Maybe Text))
-> BulkDeployment -> f BulkDeployment
bulkDeployment_bulkDeploymentArn = (BulkDeployment -> Maybe Text)
-> (BulkDeployment -> Maybe Text -> BulkDeployment)
-> Lens BulkDeployment BulkDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkDeployment' {Maybe Text
bulkDeploymentArn :: Maybe Text
$sel:bulkDeploymentArn:BulkDeployment' :: BulkDeployment -> Maybe Text
bulkDeploymentArn} -> Maybe Text
bulkDeploymentArn) (\s :: BulkDeployment
s@BulkDeployment' {} Maybe Text
a -> BulkDeployment
s {$sel:bulkDeploymentArn:BulkDeployment' :: Maybe Text
bulkDeploymentArn = Maybe Text
a} :: BulkDeployment)

-- | The ID of the bulk deployment.
bulkDeployment_bulkDeploymentId :: Lens.Lens' BulkDeployment (Prelude.Maybe Prelude.Text)
bulkDeployment_bulkDeploymentId :: (Maybe Text -> f (Maybe Text))
-> BulkDeployment -> f BulkDeployment
bulkDeployment_bulkDeploymentId = (BulkDeployment -> Maybe Text)
-> (BulkDeployment -> Maybe Text -> BulkDeployment)
-> Lens BulkDeployment BulkDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkDeployment' {Maybe Text
bulkDeploymentId :: Maybe Text
$sel:bulkDeploymentId:BulkDeployment' :: BulkDeployment -> Maybe Text
bulkDeploymentId} -> Maybe Text
bulkDeploymentId) (\s :: BulkDeployment
s@BulkDeployment' {} Maybe Text
a -> BulkDeployment
s {$sel:bulkDeploymentId:BulkDeployment' :: Maybe Text
bulkDeploymentId = Maybe Text
a} :: BulkDeployment)

-- | The time, in ISO format, when the deployment was created.
bulkDeployment_createdAt :: Lens.Lens' BulkDeployment (Prelude.Maybe Prelude.Text)
bulkDeployment_createdAt :: (Maybe Text -> f (Maybe Text))
-> BulkDeployment -> f BulkDeployment
bulkDeployment_createdAt = (BulkDeployment -> Maybe Text)
-> (BulkDeployment -> Maybe Text -> BulkDeployment)
-> Lens BulkDeployment BulkDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkDeployment' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:BulkDeployment' :: BulkDeployment -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: BulkDeployment
s@BulkDeployment' {} Maybe Text
a -> BulkDeployment
s {$sel:createdAt:BulkDeployment' :: Maybe Text
createdAt = Maybe Text
a} :: BulkDeployment)

instance Core.FromJSON BulkDeployment where
  parseJSON :: Value -> Parser BulkDeployment
parseJSON =
    String
-> (Object -> Parser BulkDeployment)
-> Value
-> Parser BulkDeployment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BulkDeployment"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> BulkDeployment
BulkDeployment'
            (Maybe Text -> Maybe Text -> Maybe Text -> BulkDeployment)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> BulkDeployment)
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
"BulkDeploymentArn")
            Parser (Maybe Text -> Maybe Text -> BulkDeployment)
-> Parser (Maybe Text) -> Parser (Maybe Text -> BulkDeployment)
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
"BulkDeploymentId")
            Parser (Maybe Text -> BulkDeployment)
-> Parser (Maybe Text) -> Parser BulkDeployment
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
"CreatedAt")
      )

instance Prelude.Hashable BulkDeployment

instance Prelude.NFData BulkDeployment