{-# 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.ActivateGateway
-- 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)
--
-- Activates the gateway you previously deployed on your host. In the
-- activation process, you specify information such as the Amazon Web
-- Services Region that you want to use for storing snapshots or tapes, the
-- time zone for scheduled snapshots the gateway snapshot schedule window,
-- an activation key, and a name for your gateway. The activation process
-- also associates your gateway with your account. For more information,
-- see UpdateGatewayInformation.
--
-- You must turn on the gateway VM before you can activate your gateway.
module Amazonka.StorageGateway.ActivateGateway
  ( -- * Creating a Request
    ActivateGateway (..),
    newActivateGateway,

    -- * Request Lenses
    activateGateway_mediumChangerType,
    activateGateway_tapeDriveType,
    activateGateway_gatewayType,
    activateGateway_tags,
    activateGateway_activationKey,
    activateGateway_gatewayName,
    activateGateway_gatewayTimezone,
    activateGateway_gatewayRegion,

    -- * Destructuring the Response
    ActivateGatewayResponse (..),
    newActivateGatewayResponse,

    -- * Response Lenses
    activateGatewayResponse_gatewayARN,
    activateGatewayResponse_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:
--
-- -   ActivateGatewayInput$ActivationKey
--
-- -   ActivateGatewayInput$GatewayName
--
-- -   ActivateGatewayInput$GatewayRegion
--
-- -   ActivateGatewayInput$GatewayTimezone
--
-- -   ActivateGatewayInput$GatewayType
--
-- -   ActivateGatewayInput$MediumChangerType
--
-- -   ActivateGatewayInput$TapeDriveType
--
-- /See:/ 'newActivateGateway' smart constructor.
data ActivateGateway = ActivateGateway'
  { -- | The value that indicates the type of medium changer to use for tape
    -- gateway. This field is optional.
    --
    -- Valid Values: @STK-L700@ | @AWS-Gateway-VTL@ | @IBM-03584L32-0402@
    ActivateGateway -> Maybe Text
mediumChangerType :: Prelude.Maybe Prelude.Text,
    -- | The value that indicates the type of tape drive to use for tape gateway.
    -- This field is optional.
    --
    -- Valid Values: @IBM-ULT3580-TD5@
    ActivateGateway -> Maybe Text
tapeDriveType :: Prelude.Maybe Prelude.Text,
    -- | A value that defines the type of gateway to activate. The type specified
    -- is critical to all later functions of the gateway and cannot be changed
    -- after activation. The default value is @CACHED@.
    --
    -- Valid Values: @STORED@ | @CACHED@ | @VTL@ | @FILE_S3@ | @FILE_FSX_SMB|@
    ActivateGateway -> Maybe Text
gatewayType :: Prelude.Maybe Prelude.Text,
    -- | A list of up to 50 tags that you can assign to the gateway. Each tag is
    -- a key-value pair.
    --
    -- Valid characters for key and value are letters, spaces, and numbers that
    -- can be represented 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 characters.
    ActivateGateway -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Your gateway activation key. You can obtain the activation key by
    -- sending an HTTP GET request with redirects enabled to the gateway IP
    -- address (port 80). The redirect URL returned in the response provides
    -- you the activation key for your gateway in the query string parameter
    -- @activationKey@. It may also include other activation-related
    -- parameters, however, these are merely defaults -- the arguments you pass
    -- to the @ActivateGateway@ API call determine the actual configuration of
    -- your gateway.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html Getting activation key>
    -- in the /Storage Gateway User Guide/.
    ActivateGateway -> Text
activationKey :: Prelude.Text,
    -- | The name you configured for your gateway.
    ActivateGateway -> Text
gatewayName :: Prelude.Text,
    -- | A value that indicates the time zone you want to set for the gateway.
    -- The time zone is of the format \"GMT-hr:mm\" or \"GMT+hr:mm\". For
    -- example, GMT-4:00 indicates the time is 4 hours behind GMT. GMT+2:00
    -- indicates the time is 2 hours ahead of GMT. The time zone is used, for
    -- example, for scheduling snapshots and your gateway\'s maintenance
    -- schedule.
    ActivateGateway -> Text
gatewayTimezone :: Prelude.Text,
    -- | A value that indicates the Amazon Web Services Region where you want to
    -- store your data. The gateway Amazon Web Services Region specified must
    -- be the same Amazon Web Services Region as the Amazon Web Services Region
    -- in your @Host@ header in the request. For more information about
    -- available Amazon Web Services Regions and endpoints for Storage Gateway,
    -- see
    -- <https://docs.aws.amazon.com/general/latest/gr/sg.html Storage Gateway endpoints and quotas>
    -- in the /Amazon Web Services General Reference/.
    --
    -- Valid Values: See
    -- <https://docs.aws.amazon.com/general/latest/gr/sg.html Storage Gateway endpoints and quotas>
    -- in the /Amazon Web Services General Reference/.
    ActivateGateway -> Text
gatewayRegion :: Prelude.Text
  }
  deriving (ActivateGateway -> ActivateGateway -> Bool
(ActivateGateway -> ActivateGateway -> Bool)
-> (ActivateGateway -> ActivateGateway -> Bool)
-> Eq ActivateGateway
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivateGateway -> ActivateGateway -> Bool
$c/= :: ActivateGateway -> ActivateGateway -> Bool
== :: ActivateGateway -> ActivateGateway -> Bool
$c== :: ActivateGateway -> ActivateGateway -> Bool
Prelude.Eq, ReadPrec [ActivateGateway]
ReadPrec ActivateGateway
Int -> ReadS ActivateGateway
ReadS [ActivateGateway]
(Int -> ReadS ActivateGateway)
-> ReadS [ActivateGateway]
-> ReadPrec ActivateGateway
-> ReadPrec [ActivateGateway]
-> Read ActivateGateway
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActivateGateway]
$creadListPrec :: ReadPrec [ActivateGateway]
readPrec :: ReadPrec ActivateGateway
$creadPrec :: ReadPrec ActivateGateway
readList :: ReadS [ActivateGateway]
$creadList :: ReadS [ActivateGateway]
readsPrec :: Int -> ReadS ActivateGateway
$creadsPrec :: Int -> ReadS ActivateGateway
Prelude.Read, Int -> ActivateGateway -> ShowS
[ActivateGateway] -> ShowS
ActivateGateway -> String
(Int -> ActivateGateway -> ShowS)
-> (ActivateGateway -> String)
-> ([ActivateGateway] -> ShowS)
-> Show ActivateGateway
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivateGateway] -> ShowS
$cshowList :: [ActivateGateway] -> ShowS
show :: ActivateGateway -> String
$cshow :: ActivateGateway -> String
showsPrec :: Int -> ActivateGateway -> ShowS
$cshowsPrec :: Int -> ActivateGateway -> ShowS
Prelude.Show, (forall x. ActivateGateway -> Rep ActivateGateway x)
-> (forall x. Rep ActivateGateway x -> ActivateGateway)
-> Generic ActivateGateway
forall x. Rep ActivateGateway x -> ActivateGateway
forall x. ActivateGateway -> Rep ActivateGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActivateGateway x -> ActivateGateway
$cfrom :: forall x. ActivateGateway -> Rep ActivateGateway x
Prelude.Generic)

-- |
-- Create a value of 'ActivateGateway' 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:
--
-- 'mediumChangerType', 'activateGateway_mediumChangerType' - The value that indicates the type of medium changer to use for tape
-- gateway. This field is optional.
--
-- Valid Values: @STK-L700@ | @AWS-Gateway-VTL@ | @IBM-03584L32-0402@
--
-- 'tapeDriveType', 'activateGateway_tapeDriveType' - The value that indicates the type of tape drive to use for tape gateway.
-- This field is optional.
--
-- Valid Values: @IBM-ULT3580-TD5@
--
-- 'gatewayType', 'activateGateway_gatewayType' - A value that defines the type of gateway to activate. The type specified
-- is critical to all later functions of the gateway and cannot be changed
-- after activation. The default value is @CACHED@.
--
-- Valid Values: @STORED@ | @CACHED@ | @VTL@ | @FILE_S3@ | @FILE_FSX_SMB|@
--
-- 'tags', 'activateGateway_tags' - A list of up to 50 tags that you can assign to the gateway. Each tag is
-- a key-value pair.
--
-- Valid characters for key and value are letters, spaces, and numbers that
-- can be represented 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 characters.
--
-- 'activationKey', 'activateGateway_activationKey' - Your gateway activation key. You can obtain the activation key by
-- sending an HTTP GET request with redirects enabled to the gateway IP
-- address (port 80). The redirect URL returned in the response provides
-- you the activation key for your gateway in the query string parameter
-- @activationKey@. It may also include other activation-related
-- parameters, however, these are merely defaults -- the arguments you pass
-- to the @ActivateGateway@ API call determine the actual configuration of
-- your gateway.
--
-- For more information, see
-- <https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html Getting activation key>
-- in the /Storage Gateway User Guide/.
--
-- 'gatewayName', 'activateGateway_gatewayName' - The name you configured for your gateway.
--
-- 'gatewayTimezone', 'activateGateway_gatewayTimezone' - A value that indicates the time zone you want to set for the gateway.
-- The time zone is of the format \"GMT-hr:mm\" or \"GMT+hr:mm\". For
-- example, GMT-4:00 indicates the time is 4 hours behind GMT. GMT+2:00
-- indicates the time is 2 hours ahead of GMT. The time zone is used, for
-- example, for scheduling snapshots and your gateway\'s maintenance
-- schedule.
--
-- 'gatewayRegion', 'activateGateway_gatewayRegion' - A value that indicates the Amazon Web Services Region where you want to
-- store your data. The gateway Amazon Web Services Region specified must
-- be the same Amazon Web Services Region as the Amazon Web Services Region
-- in your @Host@ header in the request. For more information about
-- available Amazon Web Services Regions and endpoints for Storage Gateway,
-- see
-- <https://docs.aws.amazon.com/general/latest/gr/sg.html Storage Gateway endpoints and quotas>
-- in the /Amazon Web Services General Reference/.
--
-- Valid Values: See
-- <https://docs.aws.amazon.com/general/latest/gr/sg.html Storage Gateway endpoints and quotas>
-- in the /Amazon Web Services General Reference/.
newActivateGateway ::
  -- | 'activationKey'
  Prelude.Text ->
  -- | 'gatewayName'
  Prelude.Text ->
  -- | 'gatewayTimezone'
  Prelude.Text ->
  -- | 'gatewayRegion'
  Prelude.Text ->
  ActivateGateway
newActivateGateway :: Text -> Text -> Text -> Text -> ActivateGateway
newActivateGateway
  Text
pActivationKey_
  Text
pGatewayName_
  Text
pGatewayTimezone_
  Text
pGatewayRegion_ =
    ActivateGateway' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> Text
-> ActivateGateway
ActivateGateway'
      { $sel:mediumChangerType:ActivateGateway' :: Maybe Text
mediumChangerType =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tapeDriveType:ActivateGateway' :: Maybe Text
tapeDriveType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:gatewayType:ActivateGateway' :: Maybe Text
gatewayType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ActivateGateway' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:activationKey:ActivateGateway' :: Text
activationKey = Text
pActivationKey_,
        $sel:gatewayName:ActivateGateway' :: Text
gatewayName = Text
pGatewayName_,
        $sel:gatewayTimezone:ActivateGateway' :: Text
gatewayTimezone = Text
pGatewayTimezone_,
        $sel:gatewayRegion:ActivateGateway' :: Text
gatewayRegion = Text
pGatewayRegion_
      }

-- | The value that indicates the type of medium changer to use for tape
-- gateway. This field is optional.
--
-- Valid Values: @STK-L700@ | @AWS-Gateway-VTL@ | @IBM-03584L32-0402@
activateGateway_mediumChangerType :: Lens.Lens' ActivateGateway (Prelude.Maybe Prelude.Text)
activateGateway_mediumChangerType :: (Maybe Text -> f (Maybe Text))
-> ActivateGateway -> f ActivateGateway
activateGateway_mediumChangerType = (ActivateGateway -> Maybe Text)
-> (ActivateGateway -> Maybe Text -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Maybe Text
mediumChangerType :: Maybe Text
$sel:mediumChangerType:ActivateGateway' :: ActivateGateway -> Maybe Text
mediumChangerType} -> Maybe Text
mediumChangerType) (\s :: ActivateGateway
s@ActivateGateway' {} Maybe Text
a -> ActivateGateway
s {$sel:mediumChangerType:ActivateGateway' :: Maybe Text
mediumChangerType = Maybe Text
a} :: ActivateGateway)

-- | The value that indicates the type of tape drive to use for tape gateway.
-- This field is optional.
--
-- Valid Values: @IBM-ULT3580-TD5@
activateGateway_tapeDriveType :: Lens.Lens' ActivateGateway (Prelude.Maybe Prelude.Text)
activateGateway_tapeDriveType :: (Maybe Text -> f (Maybe Text))
-> ActivateGateway -> f ActivateGateway
activateGateway_tapeDriveType = (ActivateGateway -> Maybe Text)
-> (ActivateGateway -> Maybe Text -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Maybe Text
tapeDriveType :: Maybe Text
$sel:tapeDriveType:ActivateGateway' :: ActivateGateway -> Maybe Text
tapeDriveType} -> Maybe Text
tapeDriveType) (\s :: ActivateGateway
s@ActivateGateway' {} Maybe Text
a -> ActivateGateway
s {$sel:tapeDriveType:ActivateGateway' :: Maybe Text
tapeDriveType = Maybe Text
a} :: ActivateGateway)

-- | A value that defines the type of gateway to activate. The type specified
-- is critical to all later functions of the gateway and cannot be changed
-- after activation. The default value is @CACHED@.
--
-- Valid Values: @STORED@ | @CACHED@ | @VTL@ | @FILE_S3@ | @FILE_FSX_SMB|@
activateGateway_gatewayType :: Lens.Lens' ActivateGateway (Prelude.Maybe Prelude.Text)
activateGateway_gatewayType :: (Maybe Text -> f (Maybe Text))
-> ActivateGateway -> f ActivateGateway
activateGateway_gatewayType = (ActivateGateway -> Maybe Text)
-> (ActivateGateway -> Maybe Text -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Maybe Text
gatewayType :: Maybe Text
$sel:gatewayType:ActivateGateway' :: ActivateGateway -> Maybe Text
gatewayType} -> Maybe Text
gatewayType) (\s :: ActivateGateway
s@ActivateGateway' {} Maybe Text
a -> ActivateGateway
s {$sel:gatewayType:ActivateGateway' :: Maybe Text
gatewayType = Maybe Text
a} :: ActivateGateway)

-- | A list of up to 50 tags that you can assign to the gateway. Each tag is
-- a key-value pair.
--
-- Valid characters for key and value are letters, spaces, and numbers that
-- can be represented 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 characters.
activateGateway_tags :: Lens.Lens' ActivateGateway (Prelude.Maybe [Tag])
activateGateway_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> ActivateGateway -> f ActivateGateway
activateGateway_tags = (ActivateGateway -> Maybe [Tag])
-> (ActivateGateway -> Maybe [Tag] -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ActivateGateway' :: ActivateGateway -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ActivateGateway
s@ActivateGateway' {} Maybe [Tag]
a -> ActivateGateway
s {$sel:tags:ActivateGateway' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ActivateGateway) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> ActivateGateway -> f ActivateGateway)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> ActivateGateway
-> f ActivateGateway
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

-- | Your gateway activation key. You can obtain the activation key by
-- sending an HTTP GET request with redirects enabled to the gateway IP
-- address (port 80). The redirect URL returned in the response provides
-- you the activation key for your gateway in the query string parameter
-- @activationKey@. It may also include other activation-related
-- parameters, however, these are merely defaults -- the arguments you pass
-- to the @ActivateGateway@ API call determine the actual configuration of
-- your gateway.
--
-- For more information, see
-- <https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html Getting activation key>
-- in the /Storage Gateway User Guide/.
activateGateway_activationKey :: Lens.Lens' ActivateGateway Prelude.Text
activateGateway_activationKey :: (Text -> f Text) -> ActivateGateway -> f ActivateGateway
activateGateway_activationKey = (ActivateGateway -> Text)
-> (ActivateGateway -> Text -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Text
activationKey :: Text
$sel:activationKey:ActivateGateway' :: ActivateGateway -> Text
activationKey} -> Text
activationKey) (\s :: ActivateGateway
s@ActivateGateway' {} Text
a -> ActivateGateway
s {$sel:activationKey:ActivateGateway' :: Text
activationKey = Text
a} :: ActivateGateway)

-- | The name you configured for your gateway.
activateGateway_gatewayName :: Lens.Lens' ActivateGateway Prelude.Text
activateGateway_gatewayName :: (Text -> f Text) -> ActivateGateway -> f ActivateGateway
activateGateway_gatewayName = (ActivateGateway -> Text)
-> (ActivateGateway -> Text -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Text
gatewayName :: Text
$sel:gatewayName:ActivateGateway' :: ActivateGateway -> Text
gatewayName} -> Text
gatewayName) (\s :: ActivateGateway
s@ActivateGateway' {} Text
a -> ActivateGateway
s {$sel:gatewayName:ActivateGateway' :: Text
gatewayName = Text
a} :: ActivateGateway)

-- | A value that indicates the time zone you want to set for the gateway.
-- The time zone is of the format \"GMT-hr:mm\" or \"GMT+hr:mm\". For
-- example, GMT-4:00 indicates the time is 4 hours behind GMT. GMT+2:00
-- indicates the time is 2 hours ahead of GMT. The time zone is used, for
-- example, for scheduling snapshots and your gateway\'s maintenance
-- schedule.
activateGateway_gatewayTimezone :: Lens.Lens' ActivateGateway Prelude.Text
activateGateway_gatewayTimezone :: (Text -> f Text) -> ActivateGateway -> f ActivateGateway
activateGateway_gatewayTimezone = (ActivateGateway -> Text)
-> (ActivateGateway -> Text -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Text
gatewayTimezone :: Text
$sel:gatewayTimezone:ActivateGateway' :: ActivateGateway -> Text
gatewayTimezone} -> Text
gatewayTimezone) (\s :: ActivateGateway
s@ActivateGateway' {} Text
a -> ActivateGateway
s {$sel:gatewayTimezone:ActivateGateway' :: Text
gatewayTimezone = Text
a} :: ActivateGateway)

-- | A value that indicates the Amazon Web Services Region where you want to
-- store your data. The gateway Amazon Web Services Region specified must
-- be the same Amazon Web Services Region as the Amazon Web Services Region
-- in your @Host@ header in the request. For more information about
-- available Amazon Web Services Regions and endpoints for Storage Gateway,
-- see
-- <https://docs.aws.amazon.com/general/latest/gr/sg.html Storage Gateway endpoints and quotas>
-- in the /Amazon Web Services General Reference/.
--
-- Valid Values: See
-- <https://docs.aws.amazon.com/general/latest/gr/sg.html Storage Gateway endpoints and quotas>
-- in the /Amazon Web Services General Reference/.
activateGateway_gatewayRegion :: Lens.Lens' ActivateGateway Prelude.Text
activateGateway_gatewayRegion :: (Text -> f Text) -> ActivateGateway -> f ActivateGateway
activateGateway_gatewayRegion = (ActivateGateway -> Text)
-> (ActivateGateway -> Text -> ActivateGateway)
-> Lens ActivateGateway ActivateGateway Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGateway' {Text
gatewayRegion :: Text
$sel:gatewayRegion:ActivateGateway' :: ActivateGateway -> Text
gatewayRegion} -> Text
gatewayRegion) (\s :: ActivateGateway
s@ActivateGateway' {} Text
a -> ActivateGateway
s {$sel:gatewayRegion:ActivateGateway' :: Text
gatewayRegion = Text
a} :: ActivateGateway)

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

instance Prelude.NFData ActivateGateway

instance Core.ToHeaders ActivateGateway where
  toHeaders :: ActivateGateway -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ActivateGateway -> 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.ActivateGateway" ::
                          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 ActivateGateway where
  toJSON :: ActivateGateway -> Value
toJSON ActivateGateway' {Maybe [Tag]
Maybe Text
Text
gatewayRegion :: Text
gatewayTimezone :: Text
gatewayName :: Text
activationKey :: Text
tags :: Maybe [Tag]
gatewayType :: Maybe Text
tapeDriveType :: Maybe Text
mediumChangerType :: Maybe Text
$sel:gatewayRegion:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayTimezone:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayName:ActivateGateway' :: ActivateGateway -> Text
$sel:activationKey:ActivateGateway' :: ActivateGateway -> Text
$sel:tags:ActivateGateway' :: ActivateGateway -> Maybe [Tag]
$sel:gatewayType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:tapeDriveType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:mediumChangerType:ActivateGateway' :: ActivateGateway -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MediumChangerType" 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
mediumChangerType,
            (Text
"TapeDriveType" 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
tapeDriveType,
            (Text
"GatewayType" 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
gatewayType,
            (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
"ActivationKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
activationKey),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GatewayName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"GatewayTimezone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayTimezone),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"GatewayRegion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayRegion)
          ]
      )

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

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

-- | Storage Gateway returns the Amazon Resource Name (ARN) of the activated
-- gateway. It is a string made of information such as your account,
-- gateway name, and Amazon Web Services Region. This ARN is used to
-- reference the gateway in other API operations as well as resource-based
-- authorization.
--
-- For gateways activated prior to September 02, 2015, the gateway ARN
-- contains the gateway name rather than the gateway ID. Changing the name
-- of the gateway has no effect on the gateway ARN.
--
-- /See:/ 'newActivateGatewayResponse' smart constructor.
data ActivateGatewayResponse = ActivateGatewayResponse'
  { ActivateGatewayResponse -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ActivateGatewayResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ActivateGatewayResponse -> ActivateGatewayResponse -> Bool
(ActivateGatewayResponse -> ActivateGatewayResponse -> Bool)
-> (ActivateGatewayResponse -> ActivateGatewayResponse -> Bool)
-> Eq ActivateGatewayResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivateGatewayResponse -> ActivateGatewayResponse -> Bool
$c/= :: ActivateGatewayResponse -> ActivateGatewayResponse -> Bool
== :: ActivateGatewayResponse -> ActivateGatewayResponse -> Bool
$c== :: ActivateGatewayResponse -> ActivateGatewayResponse -> Bool
Prelude.Eq, ReadPrec [ActivateGatewayResponse]
ReadPrec ActivateGatewayResponse
Int -> ReadS ActivateGatewayResponse
ReadS [ActivateGatewayResponse]
(Int -> ReadS ActivateGatewayResponse)
-> ReadS [ActivateGatewayResponse]
-> ReadPrec ActivateGatewayResponse
-> ReadPrec [ActivateGatewayResponse]
-> Read ActivateGatewayResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActivateGatewayResponse]
$creadListPrec :: ReadPrec [ActivateGatewayResponse]
readPrec :: ReadPrec ActivateGatewayResponse
$creadPrec :: ReadPrec ActivateGatewayResponse
readList :: ReadS [ActivateGatewayResponse]
$creadList :: ReadS [ActivateGatewayResponse]
readsPrec :: Int -> ReadS ActivateGatewayResponse
$creadsPrec :: Int -> ReadS ActivateGatewayResponse
Prelude.Read, Int -> ActivateGatewayResponse -> ShowS
[ActivateGatewayResponse] -> ShowS
ActivateGatewayResponse -> String
(Int -> ActivateGatewayResponse -> ShowS)
-> (ActivateGatewayResponse -> String)
-> ([ActivateGatewayResponse] -> ShowS)
-> Show ActivateGatewayResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivateGatewayResponse] -> ShowS
$cshowList :: [ActivateGatewayResponse] -> ShowS
show :: ActivateGatewayResponse -> String
$cshow :: ActivateGatewayResponse -> String
showsPrec :: Int -> ActivateGatewayResponse -> ShowS
$cshowsPrec :: Int -> ActivateGatewayResponse -> ShowS
Prelude.Show, (forall x.
 ActivateGatewayResponse -> Rep ActivateGatewayResponse x)
-> (forall x.
    Rep ActivateGatewayResponse x -> ActivateGatewayResponse)
-> Generic ActivateGatewayResponse
forall x. Rep ActivateGatewayResponse x -> ActivateGatewayResponse
forall x. ActivateGatewayResponse -> Rep ActivateGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActivateGatewayResponse x -> ActivateGatewayResponse
$cfrom :: forall x. ActivateGatewayResponse -> Rep ActivateGatewayResponse x
Prelude.Generic)

-- |
-- Create a value of 'ActivateGatewayResponse' 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:
--
-- 'gatewayARN', 'activateGatewayResponse_gatewayARN' - Undocumented member.
--
-- 'httpStatus', 'activateGatewayResponse_httpStatus' - The response's http status code.
newActivateGatewayResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ActivateGatewayResponse
newActivateGatewayResponse :: Int -> ActivateGatewayResponse
newActivateGatewayResponse Int
pHttpStatus_ =
  ActivateGatewayResponse' :: Maybe Text -> Int -> ActivateGatewayResponse
ActivateGatewayResponse'
    { $sel:gatewayARN:ActivateGatewayResponse' :: Maybe Text
gatewayARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ActivateGatewayResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
activateGatewayResponse_gatewayARN :: Lens.Lens' ActivateGatewayResponse (Prelude.Maybe Prelude.Text)
activateGatewayResponse_gatewayARN :: (Maybe Text -> f (Maybe Text))
-> ActivateGatewayResponse -> f ActivateGatewayResponse
activateGatewayResponse_gatewayARN = (ActivateGatewayResponse -> Maybe Text)
-> (ActivateGatewayResponse
    -> Maybe Text -> ActivateGatewayResponse)
-> Lens
     ActivateGatewayResponse
     ActivateGatewayResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivateGatewayResponse' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:ActivateGatewayResponse' :: ActivateGatewayResponse -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: ActivateGatewayResponse
s@ActivateGatewayResponse' {} Maybe Text
a -> ActivateGatewayResponse
s {$sel:gatewayARN:ActivateGatewayResponse' :: Maybe Text
gatewayARN = Maybe Text
a} :: ActivateGatewayResponse)

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

instance Prelude.NFData ActivateGatewayResponse