{-# 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.Snowball.UpdateCluster
-- 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)
--
-- While a cluster\'s @ClusterState@ value is in the @AwaitingQuorum@
-- state, you can update some of the information associated with a cluster.
-- Once the cluster changes to a different job state, usually 60 minutes
-- after the cluster being created, this action is no longer available.
module Amazonka.Snowball.UpdateCluster
  ( -- * Creating a Request
    UpdateCluster (..),
    newUpdateCluster,

    -- * Request Lenses
    updateCluster_notification,
    updateCluster_forwardingAddressId,
    updateCluster_addressId,
    updateCluster_shippingOption,
    updateCluster_resources,
    updateCluster_onDeviceServiceConfiguration,
    updateCluster_description,
    updateCluster_roleARN,
    updateCluster_clusterId,

    -- * Destructuring the Response
    UpdateClusterResponse (..),
    newUpdateClusterResponse,

    -- * Response Lenses
    updateClusterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Snowball.Types

-- | /See:/ 'newUpdateCluster' smart constructor.
data UpdateCluster = UpdateCluster'
  { -- | The new or updated Notification object.
    UpdateCluster -> Maybe Notification
notification :: Prelude.Maybe Notification,
    -- | The updated ID for the forwarding address for a cluster. This field is
    -- not supported in most regions.
    UpdateCluster -> Maybe Text
forwardingAddressId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the updated Address object.
    UpdateCluster -> Maybe Text
addressId :: Prelude.Maybe Prelude.Text,
    -- | The updated shipping option value of this cluster\'s ShippingDetails
    -- object.
    UpdateCluster -> Maybe ShippingOption
shippingOption :: Prelude.Maybe ShippingOption,
    -- | The updated arrays of JobResource objects that can include updated
    -- S3Resource objects or LambdaResource objects.
    UpdateCluster -> Maybe JobResource
resources :: Prelude.Maybe JobResource,
    -- | Specifies the service or services on the Snow Family device that your
    -- transferred data will be exported from or imported into. AWS Snow Family
    -- supports Amazon S3 and NFS (Network File System).
    UpdateCluster -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration :: Prelude.Maybe OnDeviceServiceConfiguration,
    -- | The updated description of this cluster.
    UpdateCluster -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The new role Amazon Resource Name (ARN) that you want to associate with
    -- this cluster. To create a role ARN, use the
    -- <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html CreateRole>
    -- API action in AWS Identity and Access Management (IAM).
    UpdateCluster -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The cluster ID of the cluster that you want to update, for example
    -- @CID123e4567-e89b-12d3-a456-426655440000@.
    UpdateCluster -> Text
clusterId :: Prelude.Text
  }
  deriving (UpdateCluster -> UpdateCluster -> Bool
(UpdateCluster -> UpdateCluster -> Bool)
-> (UpdateCluster -> UpdateCluster -> Bool) -> Eq UpdateCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCluster -> UpdateCluster -> Bool
$c/= :: UpdateCluster -> UpdateCluster -> Bool
== :: UpdateCluster -> UpdateCluster -> Bool
$c== :: UpdateCluster -> UpdateCluster -> Bool
Prelude.Eq, ReadPrec [UpdateCluster]
ReadPrec UpdateCluster
Int -> ReadS UpdateCluster
ReadS [UpdateCluster]
(Int -> ReadS UpdateCluster)
-> ReadS [UpdateCluster]
-> ReadPrec UpdateCluster
-> ReadPrec [UpdateCluster]
-> Read UpdateCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCluster]
$creadListPrec :: ReadPrec [UpdateCluster]
readPrec :: ReadPrec UpdateCluster
$creadPrec :: ReadPrec UpdateCluster
readList :: ReadS [UpdateCluster]
$creadList :: ReadS [UpdateCluster]
readsPrec :: Int -> ReadS UpdateCluster
$creadsPrec :: Int -> ReadS UpdateCluster
Prelude.Read, Int -> UpdateCluster -> ShowS
[UpdateCluster] -> ShowS
UpdateCluster -> String
(Int -> UpdateCluster -> ShowS)
-> (UpdateCluster -> String)
-> ([UpdateCluster] -> ShowS)
-> Show UpdateCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCluster] -> ShowS
$cshowList :: [UpdateCluster] -> ShowS
show :: UpdateCluster -> String
$cshow :: UpdateCluster -> String
showsPrec :: Int -> UpdateCluster -> ShowS
$cshowsPrec :: Int -> UpdateCluster -> ShowS
Prelude.Show, (forall x. UpdateCluster -> Rep UpdateCluster x)
-> (forall x. Rep UpdateCluster x -> UpdateCluster)
-> Generic UpdateCluster
forall x. Rep UpdateCluster x -> UpdateCluster
forall x. UpdateCluster -> Rep UpdateCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCluster x -> UpdateCluster
$cfrom :: forall x. UpdateCluster -> Rep UpdateCluster x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCluster' 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:
--
-- 'notification', 'updateCluster_notification' - The new or updated Notification object.
--
-- 'forwardingAddressId', 'updateCluster_forwardingAddressId' - The updated ID for the forwarding address for a cluster. This field is
-- not supported in most regions.
--
-- 'addressId', 'updateCluster_addressId' - The ID of the updated Address object.
--
-- 'shippingOption', 'updateCluster_shippingOption' - The updated shipping option value of this cluster\'s ShippingDetails
-- object.
--
-- 'resources', 'updateCluster_resources' - The updated arrays of JobResource objects that can include updated
-- S3Resource objects or LambdaResource objects.
--
-- 'onDeviceServiceConfiguration', 'updateCluster_onDeviceServiceConfiguration' - Specifies the service or services on the Snow Family device that your
-- transferred data will be exported from or imported into. AWS Snow Family
-- supports Amazon S3 and NFS (Network File System).
--
-- 'description', 'updateCluster_description' - The updated description of this cluster.
--
-- 'roleARN', 'updateCluster_roleARN' - The new role Amazon Resource Name (ARN) that you want to associate with
-- this cluster. To create a role ARN, use the
-- <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html CreateRole>
-- API action in AWS Identity and Access Management (IAM).
--
-- 'clusterId', 'updateCluster_clusterId' - The cluster ID of the cluster that you want to update, for example
-- @CID123e4567-e89b-12d3-a456-426655440000@.
newUpdateCluster ::
  -- | 'clusterId'
  Prelude.Text ->
  UpdateCluster
newUpdateCluster :: Text -> UpdateCluster
newUpdateCluster Text
pClusterId_ =
  UpdateCluster' :: Maybe Notification
-> Maybe Text
-> Maybe Text
-> Maybe ShippingOption
-> Maybe JobResource
-> Maybe OnDeviceServiceConfiguration
-> Maybe Text
-> Maybe Text
-> Text
-> UpdateCluster
UpdateCluster'
    { $sel:notification:UpdateCluster' :: Maybe Notification
notification = Maybe Notification
forall a. Maybe a
Prelude.Nothing,
      $sel:forwardingAddressId:UpdateCluster' :: Maybe Text
forwardingAddressId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:addressId:UpdateCluster' :: Maybe Text
addressId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shippingOption:UpdateCluster' :: Maybe ShippingOption
shippingOption = Maybe ShippingOption
forall a. Maybe a
Prelude.Nothing,
      $sel:resources:UpdateCluster' :: Maybe JobResource
resources = Maybe JobResource
forall a. Maybe a
Prelude.Nothing,
      $sel:onDeviceServiceConfiguration:UpdateCluster' :: Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration = Maybe OnDeviceServiceConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateCluster' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:UpdateCluster' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterId:UpdateCluster' :: Text
clusterId = Text
pClusterId_
    }

-- | The new or updated Notification object.
updateCluster_notification :: Lens.Lens' UpdateCluster (Prelude.Maybe Notification)
updateCluster_notification :: (Maybe Notification -> f (Maybe Notification))
-> UpdateCluster -> f UpdateCluster
updateCluster_notification = (UpdateCluster -> Maybe Notification)
-> (UpdateCluster -> Maybe Notification -> UpdateCluster)
-> Lens
     UpdateCluster
     UpdateCluster
     (Maybe Notification)
     (Maybe Notification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Notification
notification :: Maybe Notification
$sel:notification:UpdateCluster' :: UpdateCluster -> Maybe Notification
notification} -> Maybe Notification
notification) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Notification
a -> UpdateCluster
s {$sel:notification:UpdateCluster' :: Maybe Notification
notification = Maybe Notification
a} :: UpdateCluster)

-- | The updated ID for the forwarding address for a cluster. This field is
-- not supported in most regions.
updateCluster_forwardingAddressId :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_forwardingAddressId :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_forwardingAddressId = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
forwardingAddressId :: Maybe Text
$sel:forwardingAddressId:UpdateCluster' :: UpdateCluster -> Maybe Text
forwardingAddressId} -> Maybe Text
forwardingAddressId) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:forwardingAddressId:UpdateCluster' :: Maybe Text
forwardingAddressId = Maybe Text
a} :: UpdateCluster)

-- | The ID of the updated Address object.
updateCluster_addressId :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_addressId :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_addressId = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
addressId :: Maybe Text
$sel:addressId:UpdateCluster' :: UpdateCluster -> Maybe Text
addressId} -> Maybe Text
addressId) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:addressId:UpdateCluster' :: Maybe Text
addressId = Maybe Text
a} :: UpdateCluster)

-- | The updated shipping option value of this cluster\'s ShippingDetails
-- object.
updateCluster_shippingOption :: Lens.Lens' UpdateCluster (Prelude.Maybe ShippingOption)
updateCluster_shippingOption :: (Maybe ShippingOption -> f (Maybe ShippingOption))
-> UpdateCluster -> f UpdateCluster
updateCluster_shippingOption = (UpdateCluster -> Maybe ShippingOption)
-> (UpdateCluster -> Maybe ShippingOption -> UpdateCluster)
-> Lens
     UpdateCluster
     UpdateCluster
     (Maybe ShippingOption)
     (Maybe ShippingOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe ShippingOption
shippingOption :: Maybe ShippingOption
$sel:shippingOption:UpdateCluster' :: UpdateCluster -> Maybe ShippingOption
shippingOption} -> Maybe ShippingOption
shippingOption) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe ShippingOption
a -> UpdateCluster
s {$sel:shippingOption:UpdateCluster' :: Maybe ShippingOption
shippingOption = Maybe ShippingOption
a} :: UpdateCluster)

-- | The updated arrays of JobResource objects that can include updated
-- S3Resource objects or LambdaResource objects.
updateCluster_resources :: Lens.Lens' UpdateCluster (Prelude.Maybe JobResource)
updateCluster_resources :: (Maybe JobResource -> f (Maybe JobResource))
-> UpdateCluster -> f UpdateCluster
updateCluster_resources = (UpdateCluster -> Maybe JobResource)
-> (UpdateCluster -> Maybe JobResource -> UpdateCluster)
-> Lens
     UpdateCluster UpdateCluster (Maybe JobResource) (Maybe JobResource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe JobResource
resources :: Maybe JobResource
$sel:resources:UpdateCluster' :: UpdateCluster -> Maybe JobResource
resources} -> Maybe JobResource
resources) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe JobResource
a -> UpdateCluster
s {$sel:resources:UpdateCluster' :: Maybe JobResource
resources = Maybe JobResource
a} :: UpdateCluster)

-- | Specifies the service or services on the Snow Family device that your
-- transferred data will be exported from or imported into. AWS Snow Family
-- supports Amazon S3 and NFS (Network File System).
updateCluster_onDeviceServiceConfiguration :: Lens.Lens' UpdateCluster (Prelude.Maybe OnDeviceServiceConfiguration)
updateCluster_onDeviceServiceConfiguration :: (Maybe OnDeviceServiceConfiguration
 -> f (Maybe OnDeviceServiceConfiguration))
-> UpdateCluster -> f UpdateCluster
updateCluster_onDeviceServiceConfiguration = (UpdateCluster -> Maybe OnDeviceServiceConfiguration)
-> (UpdateCluster
    -> Maybe OnDeviceServiceConfiguration -> UpdateCluster)
-> Lens
     UpdateCluster
     UpdateCluster
     (Maybe OnDeviceServiceConfiguration)
     (Maybe OnDeviceServiceConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
$sel:onDeviceServiceConfiguration:UpdateCluster' :: UpdateCluster -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration} -> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe OnDeviceServiceConfiguration
a -> UpdateCluster
s {$sel:onDeviceServiceConfiguration:UpdateCluster' :: Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration = Maybe OnDeviceServiceConfiguration
a} :: UpdateCluster)

-- | The updated description of this cluster.
updateCluster_description :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_description :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_description = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
description :: Maybe Text
$sel:description:UpdateCluster' :: UpdateCluster -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:description:UpdateCluster' :: Maybe Text
description = Maybe Text
a} :: UpdateCluster)

-- | The new role Amazon Resource Name (ARN) that you want to associate with
-- this cluster. To create a role ARN, use the
-- <https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html CreateRole>
-- API action in AWS Identity and Access Management (IAM).
updateCluster_roleARN :: Lens.Lens' UpdateCluster (Prelude.Maybe Prelude.Text)
updateCluster_roleARN :: (Maybe Text -> f (Maybe Text)) -> UpdateCluster -> f UpdateCluster
updateCluster_roleARN = (UpdateCluster -> Maybe Text)
-> (UpdateCluster -> Maybe Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:UpdateCluster' :: UpdateCluster -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: UpdateCluster
s@UpdateCluster' {} Maybe Text
a -> UpdateCluster
s {$sel:roleARN:UpdateCluster' :: Maybe Text
roleARN = Maybe Text
a} :: UpdateCluster)

-- | The cluster ID of the cluster that you want to update, for example
-- @CID123e4567-e89b-12d3-a456-426655440000@.
updateCluster_clusterId :: Lens.Lens' UpdateCluster Prelude.Text
updateCluster_clusterId :: (Text -> f Text) -> UpdateCluster -> f UpdateCluster
updateCluster_clusterId = (UpdateCluster -> Text)
-> (UpdateCluster -> Text -> UpdateCluster)
-> Lens UpdateCluster UpdateCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCluster' {Text
clusterId :: Text
$sel:clusterId:UpdateCluster' :: UpdateCluster -> Text
clusterId} -> Text
clusterId) (\s :: UpdateCluster
s@UpdateCluster' {} Text
a -> UpdateCluster
s {$sel:clusterId:UpdateCluster' :: Text
clusterId = Text
a} :: UpdateCluster)

instance Core.AWSRequest UpdateCluster where
  type
    AWSResponse UpdateCluster =
      UpdateClusterResponse
  request :: UpdateCluster -> Request UpdateCluster
request = Service -> UpdateCluster -> Request UpdateCluster
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateCluster)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateCluster))
-> Logger
-> Service
-> Proxy UpdateCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateCluster)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateClusterResponse
UpdateClusterResponse'
            (Int -> UpdateClusterResponse)
-> Either String Int -> Either String UpdateClusterResponse
forall (f :: * -> *) a b. Functor 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 UpdateCluster

instance Prelude.NFData UpdateCluster

instance Core.ToHeaders UpdateCluster where
  toHeaders :: UpdateCluster -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateCluster -> 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
"AWSIESnowballJobManagementService.UpdateCluster" ::
                          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 UpdateCluster where
  toJSON :: UpdateCluster -> Value
toJSON UpdateCluster' {Maybe Text
Maybe Notification
Maybe ShippingOption
Maybe OnDeviceServiceConfiguration
Maybe JobResource
Text
clusterId :: Text
roleARN :: Maybe Text
description :: Maybe Text
onDeviceServiceConfiguration :: Maybe OnDeviceServiceConfiguration
resources :: Maybe JobResource
shippingOption :: Maybe ShippingOption
addressId :: Maybe Text
forwardingAddressId :: Maybe Text
notification :: Maybe Notification
$sel:clusterId:UpdateCluster' :: UpdateCluster -> Text
$sel:roleARN:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:description:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:onDeviceServiceConfiguration:UpdateCluster' :: UpdateCluster -> Maybe OnDeviceServiceConfiguration
$sel:resources:UpdateCluster' :: UpdateCluster -> Maybe JobResource
$sel:shippingOption:UpdateCluster' :: UpdateCluster -> Maybe ShippingOption
$sel:addressId:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:forwardingAddressId:UpdateCluster' :: UpdateCluster -> Maybe Text
$sel:notification:UpdateCluster' :: UpdateCluster -> Maybe Notification
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Notification" Text -> Notification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Notification -> Pair) -> Maybe Notification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Notification
notification,
            (Text
"ForwardingAddressId" 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
forwardingAddressId,
            (Text
"AddressId" 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
addressId,
            (Text
"ShippingOption" Text -> ShippingOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ShippingOption -> Pair) -> Maybe ShippingOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ShippingOption
shippingOption,
            (Text
"Resources" Text -> JobResource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobResource -> Pair) -> Maybe JobResource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobResource
resources,
            (Text
"OnDeviceServiceConfiguration" Text -> OnDeviceServiceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (OnDeviceServiceConfiguration -> Pair)
-> Maybe OnDeviceServiceConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OnDeviceServiceConfiguration
onDeviceServiceConfiguration,
            (Text
"Description" 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
description,
            (Text
"RoleARN" 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
roleARN,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClusterId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterId)
          ]
      )

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

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

-- | /See:/ 'newUpdateClusterResponse' smart constructor.
data UpdateClusterResponse = UpdateClusterResponse'
  { -- | The response's http status code.
    UpdateClusterResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateClusterResponse -> UpdateClusterResponse -> Bool
(UpdateClusterResponse -> UpdateClusterResponse -> Bool)
-> (UpdateClusterResponse -> UpdateClusterResponse -> Bool)
-> Eq UpdateClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
$c/= :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
== :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
$c== :: UpdateClusterResponse -> UpdateClusterResponse -> Bool
Prelude.Eq, ReadPrec [UpdateClusterResponse]
ReadPrec UpdateClusterResponse
Int -> ReadS UpdateClusterResponse
ReadS [UpdateClusterResponse]
(Int -> ReadS UpdateClusterResponse)
-> ReadS [UpdateClusterResponse]
-> ReadPrec UpdateClusterResponse
-> ReadPrec [UpdateClusterResponse]
-> Read UpdateClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateClusterResponse]
$creadListPrec :: ReadPrec [UpdateClusterResponse]
readPrec :: ReadPrec UpdateClusterResponse
$creadPrec :: ReadPrec UpdateClusterResponse
readList :: ReadS [UpdateClusterResponse]
$creadList :: ReadS [UpdateClusterResponse]
readsPrec :: Int -> ReadS UpdateClusterResponse
$creadsPrec :: Int -> ReadS UpdateClusterResponse
Prelude.Read, Int -> UpdateClusterResponse -> ShowS
[UpdateClusterResponse] -> ShowS
UpdateClusterResponse -> String
(Int -> UpdateClusterResponse -> ShowS)
-> (UpdateClusterResponse -> String)
-> ([UpdateClusterResponse] -> ShowS)
-> Show UpdateClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateClusterResponse] -> ShowS
$cshowList :: [UpdateClusterResponse] -> ShowS
show :: UpdateClusterResponse -> String
$cshow :: UpdateClusterResponse -> String
showsPrec :: Int -> UpdateClusterResponse -> ShowS
$cshowsPrec :: Int -> UpdateClusterResponse -> ShowS
Prelude.Show, (forall x. UpdateClusterResponse -> Rep UpdateClusterResponse x)
-> (forall x. Rep UpdateClusterResponse x -> UpdateClusterResponse)
-> Generic UpdateClusterResponse
forall x. Rep UpdateClusterResponse x -> UpdateClusterResponse
forall x. UpdateClusterResponse -> Rep UpdateClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateClusterResponse x -> UpdateClusterResponse
$cfrom :: forall x. UpdateClusterResponse -> Rep UpdateClusterResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateClusterResponse' 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:
--
-- 'httpStatus', 'updateClusterResponse_httpStatus' - The response's http status code.
newUpdateClusterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateClusterResponse
newUpdateClusterResponse :: Int -> UpdateClusterResponse
newUpdateClusterResponse Int
pHttpStatus_ =
  UpdateClusterResponse' :: Int -> UpdateClusterResponse
UpdateClusterResponse' {$sel:httpStatus:UpdateClusterResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData UpdateClusterResponse