{-# 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.GameLift.UpdateScript
-- 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 Realtime script metadata and content.
--
-- To update script metadata, specify the script ID and provide updated
-- name and\/or version values.
--
-- To update script content, provide an updated zip file by pointing to
-- either a local file or an Amazon S3 bucket location. You can use either
-- method regardless of how the original script was uploaded. Use the
-- /Version/ parameter to track updates to the script.
--
-- If the call is successful, the updated metadata is stored in the script
-- record and a revised script is uploaded to the Amazon GameLift service.
-- Once the script is updated and acquired by a fleet instance, the new
-- version is used for all new game sessions.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-intro.html Amazon GameLift Realtime Servers>
--
-- __Related actions__
--
-- CreateScript | ListScripts | DescribeScript | UpdateScript |
-- DeleteScript |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.UpdateScript
  ( -- * Creating a Request
    UpdateScript (..),
    newUpdateScript,

    -- * Request Lenses
    updateScript_storageLocation,
    updateScript_zipFile,
    updateScript_name,
    updateScript_version,
    updateScript_scriptId,

    -- * Destructuring the Response
    UpdateScriptResponse (..),
    newUpdateScriptResponse,

    -- * Response Lenses
    updateScriptResponse_script,
    updateScriptResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateScript' smart constructor.
data UpdateScript = UpdateScript'
  { -- | The location of the Amazon S3 bucket where a zipped file containing your
    -- Realtime scripts is stored. The storage location must specify the Amazon
    -- S3 bucket name, the zip file name (the \"key\"), and a role ARN that
    -- allows Amazon GameLift to access the Amazon S3 storage location. The S3
    -- bucket must be in the same Region where you want to create a new script.
    -- By default, Amazon GameLift uploads the latest version of the zip file;
    -- if you have S3 object versioning turned on, you can use the
    -- @ObjectVersion@ parameter to specify an earlier version.
    UpdateScript -> Maybe S3Location
storageLocation :: Prelude.Maybe S3Location,
    -- | A data object containing your Realtime scripts and dependencies as a zip
    -- file. The zip file can have one or multiple files. Maximum size of a zip
    -- file is 5 MB.
    --
    -- When using the AWS CLI tool to create a script, this parameter is set to
    -- the zip file name. It must be prepended with the string \"fileb:\/\/\"
    -- to indicate that the file data is a binary object. For example:
    -- @--zip-file fileb:\/\/myRealtimeScript.zip@.
    UpdateScript -> Maybe Base64
zipFile :: Prelude.Maybe Core.Base64,
    -- | A descriptive label that is associated with a script. Script names do
    -- not need to be unique.
    UpdateScript -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Version information that is associated with a build or script. Version
    -- strings do not need to be unique.
    UpdateScript -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the Realtime script to update. You can use
    -- either the script ID or ARN value.
    UpdateScript -> Text
scriptId :: Prelude.Text
  }
  deriving (UpdateScript -> UpdateScript -> Bool
(UpdateScript -> UpdateScript -> Bool)
-> (UpdateScript -> UpdateScript -> Bool) -> Eq UpdateScript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateScript -> UpdateScript -> Bool
$c/= :: UpdateScript -> UpdateScript -> Bool
== :: UpdateScript -> UpdateScript -> Bool
$c== :: UpdateScript -> UpdateScript -> Bool
Prelude.Eq, ReadPrec [UpdateScript]
ReadPrec UpdateScript
Int -> ReadS UpdateScript
ReadS [UpdateScript]
(Int -> ReadS UpdateScript)
-> ReadS [UpdateScript]
-> ReadPrec UpdateScript
-> ReadPrec [UpdateScript]
-> Read UpdateScript
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateScript]
$creadListPrec :: ReadPrec [UpdateScript]
readPrec :: ReadPrec UpdateScript
$creadPrec :: ReadPrec UpdateScript
readList :: ReadS [UpdateScript]
$creadList :: ReadS [UpdateScript]
readsPrec :: Int -> ReadS UpdateScript
$creadsPrec :: Int -> ReadS UpdateScript
Prelude.Read, Int -> UpdateScript -> ShowS
[UpdateScript] -> ShowS
UpdateScript -> String
(Int -> UpdateScript -> ShowS)
-> (UpdateScript -> String)
-> ([UpdateScript] -> ShowS)
-> Show UpdateScript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateScript] -> ShowS
$cshowList :: [UpdateScript] -> ShowS
show :: UpdateScript -> String
$cshow :: UpdateScript -> String
showsPrec :: Int -> UpdateScript -> ShowS
$cshowsPrec :: Int -> UpdateScript -> ShowS
Prelude.Show, (forall x. UpdateScript -> Rep UpdateScript x)
-> (forall x. Rep UpdateScript x -> UpdateScript)
-> Generic UpdateScript
forall x. Rep UpdateScript x -> UpdateScript
forall x. UpdateScript -> Rep UpdateScript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateScript x -> UpdateScript
$cfrom :: forall x. UpdateScript -> Rep UpdateScript x
Prelude.Generic)

-- |
-- Create a value of 'UpdateScript' 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:
--
-- 'storageLocation', 'updateScript_storageLocation' - The location of the Amazon S3 bucket where a zipped file containing your
-- Realtime scripts is stored. The storage location must specify the Amazon
-- S3 bucket name, the zip file name (the \"key\"), and a role ARN that
-- allows Amazon GameLift to access the Amazon S3 storage location. The S3
-- bucket must be in the same Region where you want to create a new script.
-- By default, Amazon GameLift uploads the latest version of the zip file;
-- if you have S3 object versioning turned on, you can use the
-- @ObjectVersion@ parameter to specify an earlier version.
--
-- 'zipFile', 'updateScript_zipFile' - A data object containing your Realtime scripts and dependencies as a zip
-- file. The zip file can have one or multiple files. Maximum size of a zip
-- file is 5 MB.
--
-- When using the AWS CLI tool to create a script, this parameter is set to
-- the zip file name. It must be prepended with the string \"fileb:\/\/\"
-- to indicate that the file data is a binary object. For example:
-- @--zip-file fileb:\/\/myRealtimeScript.zip@.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'name', 'updateScript_name' - A descriptive label that is associated with a script. Script names do
-- not need to be unique.
--
-- 'version', 'updateScript_version' - Version information that is associated with a build or script. Version
-- strings do not need to be unique.
--
-- 'scriptId', 'updateScript_scriptId' - A unique identifier for the Realtime script to update. You can use
-- either the script ID or ARN value.
newUpdateScript ::
  -- | 'scriptId'
  Prelude.Text ->
  UpdateScript
newUpdateScript :: Text -> UpdateScript
newUpdateScript Text
pScriptId_ =
  UpdateScript' :: Maybe S3Location
-> Maybe Base64 -> Maybe Text -> Maybe Text -> Text -> UpdateScript
UpdateScript'
    { $sel:storageLocation:UpdateScript' :: Maybe S3Location
storageLocation = Maybe S3Location
forall a. Maybe a
Prelude.Nothing,
      $sel:zipFile:UpdateScript' :: Maybe Base64
zipFile = Maybe Base64
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateScript' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:UpdateScript' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scriptId:UpdateScript' :: Text
scriptId = Text
pScriptId_
    }

-- | The location of the Amazon S3 bucket where a zipped file containing your
-- Realtime scripts is stored. The storage location must specify the Amazon
-- S3 bucket name, the zip file name (the \"key\"), and a role ARN that
-- allows Amazon GameLift to access the Amazon S3 storage location. The S3
-- bucket must be in the same Region where you want to create a new script.
-- By default, Amazon GameLift uploads the latest version of the zip file;
-- if you have S3 object versioning turned on, you can use the
-- @ObjectVersion@ parameter to specify an earlier version.
updateScript_storageLocation :: Lens.Lens' UpdateScript (Prelude.Maybe S3Location)
updateScript_storageLocation :: (Maybe S3Location -> f (Maybe S3Location))
-> UpdateScript -> f UpdateScript
updateScript_storageLocation = (UpdateScript -> Maybe S3Location)
-> (UpdateScript -> Maybe S3Location -> UpdateScript)
-> Lens
     UpdateScript UpdateScript (Maybe S3Location) (Maybe S3Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScript' {Maybe S3Location
storageLocation :: Maybe S3Location
$sel:storageLocation:UpdateScript' :: UpdateScript -> Maybe S3Location
storageLocation} -> Maybe S3Location
storageLocation) (\s :: UpdateScript
s@UpdateScript' {} Maybe S3Location
a -> UpdateScript
s {$sel:storageLocation:UpdateScript' :: Maybe S3Location
storageLocation = Maybe S3Location
a} :: UpdateScript)

-- | A data object containing your Realtime scripts and dependencies as a zip
-- file. The zip file can have one or multiple files. Maximum size of a zip
-- file is 5 MB.
--
-- When using the AWS CLI tool to create a script, this parameter is set to
-- the zip file name. It must be prepended with the string \"fileb:\/\/\"
-- to indicate that the file data is a binary object. For example:
-- @--zip-file fileb:\/\/myRealtimeScript.zip@.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
updateScript_zipFile :: Lens.Lens' UpdateScript (Prelude.Maybe Prelude.ByteString)
updateScript_zipFile :: (Maybe ByteString -> f (Maybe ByteString))
-> UpdateScript -> f UpdateScript
updateScript_zipFile = (UpdateScript -> Maybe Base64)
-> (UpdateScript -> Maybe Base64 -> UpdateScript)
-> Lens UpdateScript UpdateScript (Maybe Base64) (Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScript' {Maybe Base64
zipFile :: Maybe Base64
$sel:zipFile:UpdateScript' :: UpdateScript -> Maybe Base64
zipFile} -> Maybe Base64
zipFile) (\s :: UpdateScript
s@UpdateScript' {} Maybe Base64
a -> UpdateScript
s {$sel:zipFile:UpdateScript' :: Maybe Base64
zipFile = Maybe Base64
a} :: UpdateScript) ((Maybe Base64 -> f (Maybe Base64))
 -> UpdateScript -> f UpdateScript)
-> ((Maybe ByteString -> f (Maybe ByteString))
    -> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> UpdateScript
-> f UpdateScript
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso Base64 Base64 ByteString ByteString
-> Iso
     (Maybe Base64) (Maybe Base64) (Maybe ByteString) (Maybe ByteString)
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 Base64 Base64 ByteString ByteString
Iso' Base64 ByteString
Core._Base64

-- | A descriptive label that is associated with a script. Script names do
-- not need to be unique.
updateScript_name :: Lens.Lens' UpdateScript (Prelude.Maybe Prelude.Text)
updateScript_name :: (Maybe Text -> f (Maybe Text)) -> UpdateScript -> f UpdateScript
updateScript_name = (UpdateScript -> Maybe Text)
-> (UpdateScript -> Maybe Text -> UpdateScript)
-> Lens UpdateScript UpdateScript (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScript' {Maybe Text
name :: Maybe Text
$sel:name:UpdateScript' :: UpdateScript -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateScript
s@UpdateScript' {} Maybe Text
a -> UpdateScript
s {$sel:name:UpdateScript' :: Maybe Text
name = Maybe Text
a} :: UpdateScript)

-- | Version information that is associated with a build or script. Version
-- strings do not need to be unique.
updateScript_version :: Lens.Lens' UpdateScript (Prelude.Maybe Prelude.Text)
updateScript_version :: (Maybe Text -> f (Maybe Text)) -> UpdateScript -> f UpdateScript
updateScript_version = (UpdateScript -> Maybe Text)
-> (UpdateScript -> Maybe Text -> UpdateScript)
-> Lens UpdateScript UpdateScript (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScript' {Maybe Text
version :: Maybe Text
$sel:version:UpdateScript' :: UpdateScript -> Maybe Text
version} -> Maybe Text
version) (\s :: UpdateScript
s@UpdateScript' {} Maybe Text
a -> UpdateScript
s {$sel:version:UpdateScript' :: Maybe Text
version = Maybe Text
a} :: UpdateScript)

-- | A unique identifier for the Realtime script to update. You can use
-- either the script ID or ARN value.
updateScript_scriptId :: Lens.Lens' UpdateScript Prelude.Text
updateScript_scriptId :: (Text -> f Text) -> UpdateScript -> f UpdateScript
updateScript_scriptId = (UpdateScript -> Text)
-> (UpdateScript -> Text -> UpdateScript)
-> Lens UpdateScript UpdateScript Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScript' {Text
scriptId :: Text
$sel:scriptId:UpdateScript' :: UpdateScript -> Text
scriptId} -> Text
scriptId) (\s :: UpdateScript
s@UpdateScript' {} Text
a -> UpdateScript
s {$sel:scriptId:UpdateScript' :: Text
scriptId = Text
a} :: UpdateScript)

instance Core.AWSRequest UpdateScript where
  type AWSResponse UpdateScript = UpdateScriptResponse
  request :: UpdateScript -> Request UpdateScript
request = Service -> UpdateScript -> Request UpdateScript
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateScript
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateScript)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateScript))
-> Logger
-> Service
-> Proxy UpdateScript
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateScript)))
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 Script -> Int -> UpdateScriptResponse
UpdateScriptResponse'
            (Maybe Script -> Int -> UpdateScriptResponse)
-> Either String (Maybe Script)
-> Either String (Int -> UpdateScriptResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Script)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Script")
            Either String (Int -> UpdateScriptResponse)
-> Either String Int -> Either String UpdateScriptResponse
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 UpdateScript

instance Prelude.NFData UpdateScript

instance Core.ToHeaders UpdateScript where
  toHeaders :: UpdateScript -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateScript -> 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
"GameLift.UpdateScript" :: 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 UpdateScript where
  toJSON :: UpdateScript -> Value
toJSON UpdateScript' {Maybe Text
Maybe Base64
Maybe S3Location
Text
scriptId :: Text
version :: Maybe Text
name :: Maybe Text
zipFile :: Maybe Base64
storageLocation :: Maybe S3Location
$sel:scriptId:UpdateScript' :: UpdateScript -> Text
$sel:version:UpdateScript' :: UpdateScript -> Maybe Text
$sel:name:UpdateScript' :: UpdateScript -> Maybe Text
$sel:zipFile:UpdateScript' :: UpdateScript -> Maybe Base64
$sel:storageLocation:UpdateScript' :: UpdateScript -> Maybe S3Location
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"StorageLocation" Text -> S3Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (S3Location -> Pair) -> Maybe S3Location -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3Location
storageLocation,
            (Text
"ZipFile" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Base64 -> Pair) -> Maybe Base64 -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Base64
zipFile,
            (Text
"Name" 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
name,
            (Text
"Version" 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
version,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ScriptId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
scriptId)
          ]
      )

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

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

-- | /See:/ 'newUpdateScriptResponse' smart constructor.
data UpdateScriptResponse = UpdateScriptResponse'
  { -- | The newly created script record with a unique script ID. The new
    -- script\'s storage location reflects an Amazon S3 location: (1) If the
    -- script was uploaded from an S3 bucket under your account, the storage
    -- location reflects the information that was provided in the
    -- /CreateScript/ request; (2) If the script file was uploaded from a local
    -- zip file, the storage location reflects an S3 location controls by the
    -- Amazon GameLift service.
    UpdateScriptResponse -> Maybe Script
script :: Prelude.Maybe Script,
    -- | The response's http status code.
    UpdateScriptResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateScriptResponse -> UpdateScriptResponse -> Bool
(UpdateScriptResponse -> UpdateScriptResponse -> Bool)
-> (UpdateScriptResponse -> UpdateScriptResponse -> Bool)
-> Eq UpdateScriptResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateScriptResponse -> UpdateScriptResponse -> Bool
$c/= :: UpdateScriptResponse -> UpdateScriptResponse -> Bool
== :: UpdateScriptResponse -> UpdateScriptResponse -> Bool
$c== :: UpdateScriptResponse -> UpdateScriptResponse -> Bool
Prelude.Eq, ReadPrec [UpdateScriptResponse]
ReadPrec UpdateScriptResponse
Int -> ReadS UpdateScriptResponse
ReadS [UpdateScriptResponse]
(Int -> ReadS UpdateScriptResponse)
-> ReadS [UpdateScriptResponse]
-> ReadPrec UpdateScriptResponse
-> ReadPrec [UpdateScriptResponse]
-> Read UpdateScriptResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateScriptResponse]
$creadListPrec :: ReadPrec [UpdateScriptResponse]
readPrec :: ReadPrec UpdateScriptResponse
$creadPrec :: ReadPrec UpdateScriptResponse
readList :: ReadS [UpdateScriptResponse]
$creadList :: ReadS [UpdateScriptResponse]
readsPrec :: Int -> ReadS UpdateScriptResponse
$creadsPrec :: Int -> ReadS UpdateScriptResponse
Prelude.Read, Int -> UpdateScriptResponse -> ShowS
[UpdateScriptResponse] -> ShowS
UpdateScriptResponse -> String
(Int -> UpdateScriptResponse -> ShowS)
-> (UpdateScriptResponse -> String)
-> ([UpdateScriptResponse] -> ShowS)
-> Show UpdateScriptResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateScriptResponse] -> ShowS
$cshowList :: [UpdateScriptResponse] -> ShowS
show :: UpdateScriptResponse -> String
$cshow :: UpdateScriptResponse -> String
showsPrec :: Int -> UpdateScriptResponse -> ShowS
$cshowsPrec :: Int -> UpdateScriptResponse -> ShowS
Prelude.Show, (forall x. UpdateScriptResponse -> Rep UpdateScriptResponse x)
-> (forall x. Rep UpdateScriptResponse x -> UpdateScriptResponse)
-> Generic UpdateScriptResponse
forall x. Rep UpdateScriptResponse x -> UpdateScriptResponse
forall x. UpdateScriptResponse -> Rep UpdateScriptResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateScriptResponse x -> UpdateScriptResponse
$cfrom :: forall x. UpdateScriptResponse -> Rep UpdateScriptResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateScriptResponse' 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:
--
-- 'script', 'updateScriptResponse_script' - The newly created script record with a unique script ID. The new
-- script\'s storage location reflects an Amazon S3 location: (1) If the
-- script was uploaded from an S3 bucket under your account, the storage
-- location reflects the information that was provided in the
-- /CreateScript/ request; (2) If the script file was uploaded from a local
-- zip file, the storage location reflects an S3 location controls by the
-- Amazon GameLift service.
--
-- 'httpStatus', 'updateScriptResponse_httpStatus' - The response's http status code.
newUpdateScriptResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateScriptResponse
newUpdateScriptResponse :: Int -> UpdateScriptResponse
newUpdateScriptResponse Int
pHttpStatus_ =
  UpdateScriptResponse' :: Maybe Script -> Int -> UpdateScriptResponse
UpdateScriptResponse'
    { $sel:script:UpdateScriptResponse' :: Maybe Script
script = Maybe Script
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateScriptResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The newly created script record with a unique script ID. The new
-- script\'s storage location reflects an Amazon S3 location: (1) If the
-- script was uploaded from an S3 bucket under your account, the storage
-- location reflects the information that was provided in the
-- /CreateScript/ request; (2) If the script file was uploaded from a local
-- zip file, the storage location reflects an S3 location controls by the
-- Amazon GameLift service.
updateScriptResponse_script :: Lens.Lens' UpdateScriptResponse (Prelude.Maybe Script)
updateScriptResponse_script :: (Maybe Script -> f (Maybe Script))
-> UpdateScriptResponse -> f UpdateScriptResponse
updateScriptResponse_script = (UpdateScriptResponse -> Maybe Script)
-> (UpdateScriptResponse -> Maybe Script -> UpdateScriptResponse)
-> Lens
     UpdateScriptResponse
     UpdateScriptResponse
     (Maybe Script)
     (Maybe Script)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateScriptResponse' {Maybe Script
script :: Maybe Script
$sel:script:UpdateScriptResponse' :: UpdateScriptResponse -> Maybe Script
script} -> Maybe Script
script) (\s :: UpdateScriptResponse
s@UpdateScriptResponse' {} Maybe Script
a -> UpdateScriptResponse
s {$sel:script:UpdateScriptResponse' :: Maybe Script
script = Maybe Script
a} :: UpdateScriptResponse)

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

instance Prelude.NFData UpdateScriptResponse