{-# 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.StorageGateway.UpdateSnapshotSchedule
-- 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)
--
-- Updates a snapshot schedule configured for a gateway volume. This
-- operation is only supported in the cached volume and stored volume
-- gateway types.
--
-- The default snapshot schedule for volume is once every 24 hours,
-- starting at the creation time of the volume. You can use this API to
-- change the snapshot schedule configured for the volume.
--
-- In the request you must identify the gateway volume whose snapshot
-- schedule you want to update, and the schedule information, including
-- when you want the snapshot to begin on a day and the frequency (in
-- hours) of snapshots.
module Amazonka.StorageGateway.UpdateSnapshotSchedule
  ( -- * Creating a Request
    UpdateSnapshotSchedule (..),
    newUpdateSnapshotSchedule,

    -- * Request Lenses
    updateSnapshotSchedule_description,
    updateSnapshotSchedule_tags,
    updateSnapshotSchedule_volumeARN,
    updateSnapshotSchedule_startAt,
    updateSnapshotSchedule_recurrenceInHours,

    -- * Destructuring the Response
    UpdateSnapshotScheduleResponse (..),
    newUpdateSnapshotScheduleResponse,

    -- * Response Lenses
    updateSnapshotScheduleResponse_volumeARN,
    updateSnapshotScheduleResponse_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.StorageGateway.Types

-- | A JSON object containing one or more of the following fields:
--
-- -   UpdateSnapshotScheduleInput$Description
--
-- -   UpdateSnapshotScheduleInput$RecurrenceInHours
--
-- -   UpdateSnapshotScheduleInput$StartAt
--
-- -   UpdateSnapshotScheduleInput$VolumeARN
--
-- /See:/ 'newUpdateSnapshotSchedule' smart constructor.
data UpdateSnapshotSchedule = UpdateSnapshotSchedule'
  { -- | Optional description of the snapshot that overwrites the existing
    -- description.
    UpdateSnapshotSchedule -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A list of up to 50 tags that can be assigned to a snapshot. Each tag is
    -- a key-value pair.
    --
    -- Valid characters for key and value are letters, spaces, and numbers
    -- representable in UTF-8 format, and the following special characters: + -
    -- = . _ : \/ \@. The maximum length of a tag\'s key is 128 characters, and
    -- the maximum length for a tag\'s value is 256.
    UpdateSnapshotSchedule -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The Amazon Resource Name (ARN) of the volume. Use the ListVolumes
    -- operation to return a list of gateway volumes.
    UpdateSnapshotSchedule -> Text
volumeARN :: Prelude.Text,
    -- | The hour of the day at which the snapshot schedule begins represented as
    -- /hh/, where /hh/ is the hour (0 to 23). The hour of the day is in the
    -- time zone of the gateway.
    UpdateSnapshotSchedule -> Natural
startAt :: Prelude.Natural,
    -- | Frequency of snapshots. Specify the number of hours between snapshots.
    UpdateSnapshotSchedule -> Natural
recurrenceInHours :: Prelude.Natural
  }
  deriving (UpdateSnapshotSchedule -> UpdateSnapshotSchedule -> Bool
(UpdateSnapshotSchedule -> UpdateSnapshotSchedule -> Bool)
-> (UpdateSnapshotSchedule -> UpdateSnapshotSchedule -> Bool)
-> Eq UpdateSnapshotSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSnapshotSchedule -> UpdateSnapshotSchedule -> Bool
$c/= :: UpdateSnapshotSchedule -> UpdateSnapshotSchedule -> Bool
== :: UpdateSnapshotSchedule -> UpdateSnapshotSchedule -> Bool
$c== :: UpdateSnapshotSchedule -> UpdateSnapshotSchedule -> Bool
Prelude.Eq, ReadPrec [UpdateSnapshotSchedule]
ReadPrec UpdateSnapshotSchedule
Int -> ReadS UpdateSnapshotSchedule
ReadS [UpdateSnapshotSchedule]
(Int -> ReadS UpdateSnapshotSchedule)
-> ReadS [UpdateSnapshotSchedule]
-> ReadPrec UpdateSnapshotSchedule
-> ReadPrec [UpdateSnapshotSchedule]
-> Read UpdateSnapshotSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSnapshotSchedule]
$creadListPrec :: ReadPrec [UpdateSnapshotSchedule]
readPrec :: ReadPrec UpdateSnapshotSchedule
$creadPrec :: ReadPrec UpdateSnapshotSchedule
readList :: ReadS [UpdateSnapshotSchedule]
$creadList :: ReadS [UpdateSnapshotSchedule]
readsPrec :: Int -> ReadS UpdateSnapshotSchedule
$creadsPrec :: Int -> ReadS UpdateSnapshotSchedule
Prelude.Read, Int -> UpdateSnapshotSchedule -> ShowS
[UpdateSnapshotSchedule] -> ShowS
UpdateSnapshotSchedule -> String
(Int -> UpdateSnapshotSchedule -> ShowS)
-> (UpdateSnapshotSchedule -> String)
-> ([UpdateSnapshotSchedule] -> ShowS)
-> Show UpdateSnapshotSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSnapshotSchedule] -> ShowS
$cshowList :: [UpdateSnapshotSchedule] -> ShowS
show :: UpdateSnapshotSchedule -> String
$cshow :: UpdateSnapshotSchedule -> String
showsPrec :: Int -> UpdateSnapshotSchedule -> ShowS
$cshowsPrec :: Int -> UpdateSnapshotSchedule -> ShowS
Prelude.Show, (forall x. UpdateSnapshotSchedule -> Rep UpdateSnapshotSchedule x)
-> (forall x.
    Rep UpdateSnapshotSchedule x -> UpdateSnapshotSchedule)
-> Generic UpdateSnapshotSchedule
forall x. Rep UpdateSnapshotSchedule x -> UpdateSnapshotSchedule
forall x. UpdateSnapshotSchedule -> Rep UpdateSnapshotSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSnapshotSchedule x -> UpdateSnapshotSchedule
$cfrom :: forall x. UpdateSnapshotSchedule -> Rep UpdateSnapshotSchedule x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSnapshotSchedule' 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:
--
-- 'description', 'updateSnapshotSchedule_description' - Optional description of the snapshot that overwrites the existing
-- description.
--
-- 'tags', 'updateSnapshotSchedule_tags' - A list of up to 50 tags that can be assigned to a snapshot. Each tag is
-- a key-value pair.
--
-- Valid characters for key and value are letters, spaces, and numbers
-- representable in UTF-8 format, and the following special characters: + -
-- = . _ : \/ \@. The maximum length of a tag\'s key is 128 characters, and
-- the maximum length for a tag\'s value is 256.
--
-- 'volumeARN', 'updateSnapshotSchedule_volumeARN' - The Amazon Resource Name (ARN) of the volume. Use the ListVolumes
-- operation to return a list of gateway volumes.
--
-- 'startAt', 'updateSnapshotSchedule_startAt' - The hour of the day at which the snapshot schedule begins represented as
-- /hh/, where /hh/ is the hour (0 to 23). The hour of the day is in the
-- time zone of the gateway.
--
-- 'recurrenceInHours', 'updateSnapshotSchedule_recurrenceInHours' - Frequency of snapshots. Specify the number of hours between snapshots.
newUpdateSnapshotSchedule ::
  -- | 'volumeARN'
  Prelude.Text ->
  -- | 'startAt'
  Prelude.Natural ->
  -- | 'recurrenceInHours'
  Prelude.Natural ->
  UpdateSnapshotSchedule
newUpdateSnapshotSchedule :: Text -> Natural -> Natural -> UpdateSnapshotSchedule
newUpdateSnapshotSchedule
  Text
pVolumeARN_
  Natural
pStartAt_
  Natural
pRecurrenceInHours_ =
    UpdateSnapshotSchedule' :: Maybe Text
-> Maybe [Tag]
-> Text
-> Natural
-> Natural
-> UpdateSnapshotSchedule
UpdateSnapshotSchedule'
      { $sel:description:UpdateSnapshotSchedule' :: Maybe Text
description =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:UpdateSnapshotSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:volumeARN:UpdateSnapshotSchedule' :: Text
volumeARN = Text
pVolumeARN_,
        $sel:startAt:UpdateSnapshotSchedule' :: Natural
startAt = Natural
pStartAt_,
        $sel:recurrenceInHours:UpdateSnapshotSchedule' :: Natural
recurrenceInHours = Natural
pRecurrenceInHours_
      }

-- | Optional description of the snapshot that overwrites the existing
-- description.
updateSnapshotSchedule_description :: Lens.Lens' UpdateSnapshotSchedule (Prelude.Maybe Prelude.Text)
updateSnapshotSchedule_description :: (Maybe Text -> f (Maybe Text))
-> UpdateSnapshotSchedule -> f UpdateSnapshotSchedule
updateSnapshotSchedule_description = (UpdateSnapshotSchedule -> Maybe Text)
-> (UpdateSnapshotSchedule -> Maybe Text -> UpdateSnapshotSchedule)
-> Lens
     UpdateSnapshotSchedule
     UpdateSnapshotSchedule
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSnapshotSchedule' {Maybe Text
description :: Maybe Text
$sel:description:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateSnapshotSchedule
s@UpdateSnapshotSchedule' {} Maybe Text
a -> UpdateSnapshotSchedule
s {$sel:description:UpdateSnapshotSchedule' :: Maybe Text
description = Maybe Text
a} :: UpdateSnapshotSchedule)

-- | A list of up to 50 tags that can be assigned to a snapshot. Each tag is
-- a key-value pair.
--
-- Valid characters for key and value are letters, spaces, and numbers
-- representable in UTF-8 format, and the following special characters: + -
-- = . _ : \/ \@. The maximum length of a tag\'s key is 128 characters, and
-- the maximum length for a tag\'s value is 256.
updateSnapshotSchedule_tags :: Lens.Lens' UpdateSnapshotSchedule (Prelude.Maybe [Tag])
updateSnapshotSchedule_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateSnapshotSchedule -> f UpdateSnapshotSchedule
updateSnapshotSchedule_tags = (UpdateSnapshotSchedule -> Maybe [Tag])
-> (UpdateSnapshotSchedule
    -> Maybe [Tag] -> UpdateSnapshotSchedule)
-> Lens
     UpdateSnapshotSchedule
     UpdateSnapshotSchedule
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSnapshotSchedule' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: UpdateSnapshotSchedule
s@UpdateSnapshotSchedule' {} Maybe [Tag]
a -> UpdateSnapshotSchedule
s {$sel:tags:UpdateSnapshotSchedule' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: UpdateSnapshotSchedule) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> UpdateSnapshotSchedule -> f UpdateSnapshotSchedule)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateSnapshotSchedule
-> f UpdateSnapshotSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the volume. Use the ListVolumes
-- operation to return a list of gateway volumes.
updateSnapshotSchedule_volumeARN :: Lens.Lens' UpdateSnapshotSchedule Prelude.Text
updateSnapshotSchedule_volumeARN :: (Text -> f Text)
-> UpdateSnapshotSchedule -> f UpdateSnapshotSchedule
updateSnapshotSchedule_volumeARN = (UpdateSnapshotSchedule -> Text)
-> (UpdateSnapshotSchedule -> Text -> UpdateSnapshotSchedule)
-> Lens UpdateSnapshotSchedule UpdateSnapshotSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSnapshotSchedule' {Text
volumeARN :: Text
$sel:volumeARN:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Text
volumeARN} -> Text
volumeARN) (\s :: UpdateSnapshotSchedule
s@UpdateSnapshotSchedule' {} Text
a -> UpdateSnapshotSchedule
s {$sel:volumeARN:UpdateSnapshotSchedule' :: Text
volumeARN = Text
a} :: UpdateSnapshotSchedule)

-- | The hour of the day at which the snapshot schedule begins represented as
-- /hh/, where /hh/ is the hour (0 to 23). The hour of the day is in the
-- time zone of the gateway.
updateSnapshotSchedule_startAt :: Lens.Lens' UpdateSnapshotSchedule Prelude.Natural
updateSnapshotSchedule_startAt :: (Natural -> f Natural)
-> UpdateSnapshotSchedule -> f UpdateSnapshotSchedule
updateSnapshotSchedule_startAt = (UpdateSnapshotSchedule -> Natural)
-> (UpdateSnapshotSchedule -> Natural -> UpdateSnapshotSchedule)
-> Lens
     UpdateSnapshotSchedule UpdateSnapshotSchedule Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSnapshotSchedule' {Natural
startAt :: Natural
$sel:startAt:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Natural
startAt} -> Natural
startAt) (\s :: UpdateSnapshotSchedule
s@UpdateSnapshotSchedule' {} Natural
a -> UpdateSnapshotSchedule
s {$sel:startAt:UpdateSnapshotSchedule' :: Natural
startAt = Natural
a} :: UpdateSnapshotSchedule)

-- | Frequency of snapshots. Specify the number of hours between snapshots.
updateSnapshotSchedule_recurrenceInHours :: Lens.Lens' UpdateSnapshotSchedule Prelude.Natural
updateSnapshotSchedule_recurrenceInHours :: (Natural -> f Natural)
-> UpdateSnapshotSchedule -> f UpdateSnapshotSchedule
updateSnapshotSchedule_recurrenceInHours = (UpdateSnapshotSchedule -> Natural)
-> (UpdateSnapshotSchedule -> Natural -> UpdateSnapshotSchedule)
-> Lens
     UpdateSnapshotSchedule UpdateSnapshotSchedule Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSnapshotSchedule' {Natural
recurrenceInHours :: Natural
$sel:recurrenceInHours:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Natural
recurrenceInHours} -> Natural
recurrenceInHours) (\s :: UpdateSnapshotSchedule
s@UpdateSnapshotSchedule' {} Natural
a -> UpdateSnapshotSchedule
s {$sel:recurrenceInHours:UpdateSnapshotSchedule' :: Natural
recurrenceInHours = Natural
a} :: UpdateSnapshotSchedule)

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

instance Prelude.NFData UpdateSnapshotSchedule

instance Core.ToHeaders UpdateSnapshotSchedule where
  toHeaders :: UpdateSnapshotSchedule -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateSnapshotSchedule -> 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
"StorageGateway_20130630.UpdateSnapshotSchedule" ::
                          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 UpdateSnapshotSchedule where
  toJSON :: UpdateSnapshotSchedule -> Value
toJSON UpdateSnapshotSchedule' {Natural
Maybe [Tag]
Maybe Text
Text
recurrenceInHours :: Natural
startAt :: Natural
volumeARN :: Text
tags :: Maybe [Tag]
description :: Maybe Text
$sel:recurrenceInHours:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Natural
$sel:startAt:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Natural
$sel:volumeARN:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Text
$sel:tags:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Maybe [Tag]
$sel:description:UpdateSnapshotSchedule' :: UpdateSnapshotSchedule -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"VolumeARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
volumeARN),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StartAt" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
startAt),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RecurrenceInHours" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
recurrenceInHours)
          ]
      )

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

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

-- | A JSON object containing the Amazon Resource Name (ARN) of the updated
-- storage volume.
--
-- /See:/ 'newUpdateSnapshotScheduleResponse' smart constructor.
data UpdateSnapshotScheduleResponse = UpdateSnapshotScheduleResponse'
  { -- | The Amazon Resource Name (ARN) of the volume. Use the ListVolumes
    -- operation to return a list of gateway volumes.
    UpdateSnapshotScheduleResponse -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateSnapshotScheduleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateSnapshotScheduleResponse
-> UpdateSnapshotScheduleResponse -> Bool
(UpdateSnapshotScheduleResponse
 -> UpdateSnapshotScheduleResponse -> Bool)
-> (UpdateSnapshotScheduleResponse
    -> UpdateSnapshotScheduleResponse -> Bool)
-> Eq UpdateSnapshotScheduleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSnapshotScheduleResponse
-> UpdateSnapshotScheduleResponse -> Bool
$c/= :: UpdateSnapshotScheduleResponse
-> UpdateSnapshotScheduleResponse -> Bool
== :: UpdateSnapshotScheduleResponse
-> UpdateSnapshotScheduleResponse -> Bool
$c== :: UpdateSnapshotScheduleResponse
-> UpdateSnapshotScheduleResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSnapshotScheduleResponse]
ReadPrec UpdateSnapshotScheduleResponse
Int -> ReadS UpdateSnapshotScheduleResponse
ReadS [UpdateSnapshotScheduleResponse]
(Int -> ReadS UpdateSnapshotScheduleResponse)
-> ReadS [UpdateSnapshotScheduleResponse]
-> ReadPrec UpdateSnapshotScheduleResponse
-> ReadPrec [UpdateSnapshotScheduleResponse]
-> Read UpdateSnapshotScheduleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSnapshotScheduleResponse]
$creadListPrec :: ReadPrec [UpdateSnapshotScheduleResponse]
readPrec :: ReadPrec UpdateSnapshotScheduleResponse
$creadPrec :: ReadPrec UpdateSnapshotScheduleResponse
readList :: ReadS [UpdateSnapshotScheduleResponse]
$creadList :: ReadS [UpdateSnapshotScheduleResponse]
readsPrec :: Int -> ReadS UpdateSnapshotScheduleResponse
$creadsPrec :: Int -> ReadS UpdateSnapshotScheduleResponse
Prelude.Read, Int -> UpdateSnapshotScheduleResponse -> ShowS
[UpdateSnapshotScheduleResponse] -> ShowS
UpdateSnapshotScheduleResponse -> String
(Int -> UpdateSnapshotScheduleResponse -> ShowS)
-> (UpdateSnapshotScheduleResponse -> String)
-> ([UpdateSnapshotScheduleResponse] -> ShowS)
-> Show UpdateSnapshotScheduleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSnapshotScheduleResponse] -> ShowS
$cshowList :: [UpdateSnapshotScheduleResponse] -> ShowS
show :: UpdateSnapshotScheduleResponse -> String
$cshow :: UpdateSnapshotScheduleResponse -> String
showsPrec :: Int -> UpdateSnapshotScheduleResponse -> ShowS
$cshowsPrec :: Int -> UpdateSnapshotScheduleResponse -> ShowS
Prelude.Show, (forall x.
 UpdateSnapshotScheduleResponse
 -> Rep UpdateSnapshotScheduleResponse x)
-> (forall x.
    Rep UpdateSnapshotScheduleResponse x
    -> UpdateSnapshotScheduleResponse)
-> Generic UpdateSnapshotScheduleResponse
forall x.
Rep UpdateSnapshotScheduleResponse x
-> UpdateSnapshotScheduleResponse
forall x.
UpdateSnapshotScheduleResponse
-> Rep UpdateSnapshotScheduleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSnapshotScheduleResponse x
-> UpdateSnapshotScheduleResponse
$cfrom :: forall x.
UpdateSnapshotScheduleResponse
-> Rep UpdateSnapshotScheduleResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSnapshotScheduleResponse' 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:
--
-- 'volumeARN', 'updateSnapshotScheduleResponse_volumeARN' - The Amazon Resource Name (ARN) of the volume. Use the ListVolumes
-- operation to return a list of gateway volumes.
--
-- 'httpStatus', 'updateSnapshotScheduleResponse_httpStatus' - The response's http status code.
newUpdateSnapshotScheduleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateSnapshotScheduleResponse
newUpdateSnapshotScheduleResponse :: Int -> UpdateSnapshotScheduleResponse
newUpdateSnapshotScheduleResponse Int
pHttpStatus_ =
  UpdateSnapshotScheduleResponse' :: Maybe Text -> Int -> UpdateSnapshotScheduleResponse
UpdateSnapshotScheduleResponse'
    { $sel:volumeARN:UpdateSnapshotScheduleResponse' :: Maybe Text
volumeARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateSnapshotScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the volume. Use the ListVolumes
-- operation to return a list of gateway volumes.
updateSnapshotScheduleResponse_volumeARN :: Lens.Lens' UpdateSnapshotScheduleResponse (Prelude.Maybe Prelude.Text)
updateSnapshotScheduleResponse_volumeARN :: (Maybe Text -> f (Maybe Text))
-> UpdateSnapshotScheduleResponse
-> f UpdateSnapshotScheduleResponse
updateSnapshotScheduleResponse_volumeARN = (UpdateSnapshotScheduleResponse -> Maybe Text)
-> (UpdateSnapshotScheduleResponse
    -> Maybe Text -> UpdateSnapshotScheduleResponse)
-> Lens
     UpdateSnapshotScheduleResponse
     UpdateSnapshotScheduleResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSnapshotScheduleResponse' {Maybe Text
volumeARN :: Maybe Text
$sel:volumeARN:UpdateSnapshotScheduleResponse' :: UpdateSnapshotScheduleResponse -> Maybe Text
volumeARN} -> Maybe Text
volumeARN) (\s :: UpdateSnapshotScheduleResponse
s@UpdateSnapshotScheduleResponse' {} Maybe Text
a -> UpdateSnapshotScheduleResponse
s {$sel:volumeARN:UpdateSnapshotScheduleResponse' :: Maybe Text
volumeARN = Maybe Text
a} :: UpdateSnapshotScheduleResponse)

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

instance
  Prelude.NFData
    UpdateSnapshotScheduleResponse