{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_gatewayType,
    activateGateway_mediumChangerType,
    activateGateway_tags,
    activateGateway_tapeDriveType,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | 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@ | @VTL_SNOW@ | @FILE_S3@ |
    -- @FILE_FSX_SMB@
    ActivateGateway -> Maybe Text
gatewayType :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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],
    -- | 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,
    -- | 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
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]
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
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. 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:
--
-- '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@ | @VTL_SNOW@ | @FILE_S3@ |
-- @FILE_FSX_SMB@
--
-- '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@
--
-- '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.
--
-- '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@
--
-- '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'
      { $sel:gatewayType:ActivateGateway' :: Maybe Text
gatewayType = forall a. Maybe a
Prelude.Nothing,
        $sel:mediumChangerType:ActivateGateway' :: Maybe Text
mediumChangerType = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ActivateGateway' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:tapeDriveType:ActivateGateway' :: Maybe Text
tapeDriveType = 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_
      }

-- | 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@ | @VTL_SNOW@ | @FILE_S3@ |
-- @FILE_FSX_SMB@
activateGateway_gatewayType :: Lens.Lens' ActivateGateway (Prelude.Maybe Prelude.Text)
activateGateway_gatewayType :: Lens' ActivateGateway (Maybe Text)
activateGateway_gatewayType = 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)

-- | 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 :: Lens' ActivateGateway (Maybe Text)
activateGateway_mediumChangerType = 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)

-- | 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 :: Lens' ActivateGateway (Maybe [Tag])
activateGateway_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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 :: Lens' ActivateGateway (Maybe Text)
activateGateway_tapeDriveType = 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)

-- | 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 :: Lens' ActivateGateway Text
activateGateway_activationKey = 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 :: Lens' ActivateGateway Text
activateGateway_gatewayName = 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 :: Lens' ActivateGateway Text
activateGateway_gatewayTimezone = 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 :: Lens' ActivateGateway Text
activateGateway_gatewayRegion = 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 :: (Service -> Service) -> ActivateGateway -> Request ActivateGateway
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ActivateGateway
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ActivateGateway)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> ActivateGatewayResponse
ActivateGatewayResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GatewayARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ActivateGateway where
  hashWithSalt :: Int -> ActivateGateway -> Int
hashWithSalt Int
_salt ActivateGateway' {Maybe [Tag]
Maybe Text
Text
gatewayRegion :: Text
gatewayTimezone :: Text
gatewayName :: Text
activationKey :: Text
tapeDriveType :: Maybe Text
tags :: Maybe [Tag]
mediumChangerType :: Maybe Text
gatewayType :: Maybe Text
$sel:gatewayRegion:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayTimezone:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayName:ActivateGateway' :: ActivateGateway -> Text
$sel:activationKey:ActivateGateway' :: ActivateGateway -> Text
$sel:tapeDriveType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:tags:ActivateGateway' :: ActivateGateway -> Maybe [Tag]
$sel:mediumChangerType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:gatewayType:ActivateGateway' :: ActivateGateway -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mediumChangerType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tapeDriveType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
activationKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayTimezone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayRegion

instance Prelude.NFData ActivateGateway where
  rnf :: ActivateGateway -> ()
rnf ActivateGateway' {Maybe [Tag]
Maybe Text
Text
gatewayRegion :: Text
gatewayTimezone :: Text
gatewayName :: Text
activationKey :: Text
tapeDriveType :: Maybe Text
tags :: Maybe [Tag]
mediumChangerType :: Maybe Text
gatewayType :: Maybe Text
$sel:gatewayRegion:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayTimezone:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayName:ActivateGateway' :: ActivateGateway -> Text
$sel:activationKey:ActivateGateway' :: ActivateGateway -> Text
$sel:tapeDriveType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:tags:ActivateGateway' :: ActivateGateway -> Maybe [Tag]
$sel:mediumChangerType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:gatewayType:ActivateGateway' :: ActivateGateway -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mediumChangerType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tapeDriveType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
activationKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayTimezone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayRegion

instance Data.ToHeaders ActivateGateway where
  toHeaders :: ActivateGateway -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"StorageGateway_20130630.ActivateGateway" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ActivateGateway where
  toJSON :: ActivateGateway -> Value
toJSON ActivateGateway' {Maybe [Tag]
Maybe Text
Text
gatewayRegion :: Text
gatewayTimezone :: Text
gatewayName :: Text
activationKey :: Text
tapeDriveType :: Maybe Text
tags :: Maybe [Tag]
mediumChangerType :: Maybe Text
gatewayType :: Maybe Text
$sel:gatewayRegion:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayTimezone:ActivateGateway' :: ActivateGateway -> Text
$sel:gatewayName:ActivateGateway' :: ActivateGateway -> Text
$sel:activationKey:ActivateGateway' :: ActivateGateway -> Text
$sel:tapeDriveType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:tags:ActivateGateway' :: ActivateGateway -> Maybe [Tag]
$sel:mediumChangerType:ActivateGateway' :: ActivateGateway -> Maybe Text
$sel:gatewayType:ActivateGateway' :: ActivateGateway -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"GatewayType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gatewayType,
            (Key
"MediumChangerType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
mediumChangerType,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Key
"TapeDriveType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
tapeDriveType,
            forall a. a -> Maybe a
Prelude.Just (Key
"ActivationKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
activationKey),
            forall a. a -> Maybe a
Prelude.Just (Key
"GatewayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"GatewayTimezone" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayTimezone),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"GatewayRegion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayRegion)
          ]
      )

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

instance Data.ToQuery ActivateGateway where
  toQuery :: ActivateGateway -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
    { $sel:gatewayARN:ActivateGatewayResponse' :: Maybe Text
gatewayARN =
        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 :: Lens' ActivateGatewayResponse (Maybe Text)
activateGatewayResponse_gatewayARN = 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 :: Lens' ActivateGatewayResponse Int
activateGatewayResponse_httpStatus = 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 where
  rnf :: ActivateGatewayResponse -> ()
rnf ActivateGatewayResponse' {Int
Maybe Text
httpStatus :: Int
gatewayARN :: Maybe Text
$sel:httpStatus:ActivateGatewayResponse' :: ActivateGatewayResponse -> Int
$sel:gatewayARN:ActivateGatewayResponse' :: ActivateGatewayResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus