{-# 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.MediaStoreData.PutObject
-- 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)
--
-- Uploads an object to the specified path. Object sizes are limited to 25
-- MB for standard upload availability and 10 MB for streaming upload
-- availability.
module Amazonka.MediaStoreData.PutObject
  ( -- * Creating a Request
    PutObject (..),
    newPutObject,

    -- * Request Lenses
    putObject_storageClass,
    putObject_uploadAvailability,
    putObject_cacheControl,
    putObject_contentType,
    putObject_path,
    putObject_body,

    -- * Destructuring the Response
    PutObjectResponse (..),
    newPutObjectResponse,

    -- * Response Lenses
    putObjectResponse_eTag,
    putObjectResponse_storageClass,
    putObjectResponse_contentSHA256,
    putObjectResponse_httpStatus,
  )
where

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

-- | /See:/ 'newPutObject' smart constructor.
data PutObject = PutObject'
  { -- | Indicates the storage class of a @Put@ request. Defaults to
    -- high-performance temporal storage class, and objects are persisted into
    -- durable storage shortly after being received.
    PutObject -> Maybe StorageClass
storageClass :: Prelude.Maybe StorageClass,
    -- | Indicates the availability of an object while it is still uploading. If
    -- the value is set to @streaming@, the object is available for downloading
    -- after some initial buffering but before the object is uploaded
    -- completely. If the value is set to @standard@, the object is available
    -- for downloading only when it is uploaded completely. The default value
    -- for this header is @standard@.
    --
    -- To use this header, you must also set the HTTP @Transfer-Encoding@
    -- header to @chunked@.
    PutObject -> Maybe UploadAvailability
uploadAvailability :: Prelude.Maybe UploadAvailability,
    -- | An optional @CacheControl@ header that allows the caller to control the
    -- object\'s cache behavior. Headers can be passed in as specified in the
    -- HTTP at
    -- <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
    --
    -- Headers with a custom user-defined value are also accepted.
    PutObject -> Maybe Text
cacheControl :: Prelude.Maybe Prelude.Text,
    -- | The content type of the object.
    PutObject -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The path (including the file name) where the object is stored in the
    -- container. Format: \<folder name>\/\<folder name>\/\<file name>
    --
    -- For example, to upload the file @mlaw.avi@ to the folder path
    -- @premium\\canada@ in the container @movies@, enter the path
    -- @premium\/canada\/mlaw.avi@.
    --
    -- Do not include the container name in this path.
    --
    -- If the path includes any folders that don\'t exist yet, the service
    -- creates them. For example, suppose you have an existing @premium\/usa@
    -- subfolder. If you specify @premium\/canada@, the service creates a
    -- @canada@ subfolder in the @premium@ folder. You then have two
    -- subfolders, @usa@ and @canada@, in the @premium@ folder.
    --
    -- There is no correlation between the path to the source and the path
    -- (folders) in the container in AWS Elemental MediaStore.
    --
    -- For more information about folders and how they exist in a container,
    -- see the
    -- <http://docs.aws.amazon.com/mediastore/latest/ug/ AWS Elemental MediaStore User Guide>.
    --
    -- The file name is the name that is assigned to the file that you upload.
    -- The file can have the same name inside and outside of AWS Elemental
    -- MediaStore, or it can have the same name. The file name can include or
    -- omit an extension.
    PutObject -> Text
path :: Prelude.Text,
    -- | The bytes to be stored.
    PutObject -> HashedBody
body :: Core.HashedBody
  }
  deriving (Int -> PutObject -> ShowS
[PutObject] -> ShowS
PutObject -> String
(Int -> PutObject -> ShowS)
-> (PutObject -> String)
-> ([PutObject] -> ShowS)
-> Show PutObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObject] -> ShowS
$cshowList :: [PutObject] -> ShowS
show :: PutObject -> String
$cshow :: PutObject -> String
showsPrec :: Int -> PutObject -> ShowS
$cshowsPrec :: Int -> PutObject -> ShowS
Prelude.Show, (forall x. PutObject -> Rep PutObject x)
-> (forall x. Rep PutObject x -> PutObject) -> Generic PutObject
forall x. Rep PutObject x -> PutObject
forall x. PutObject -> Rep PutObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutObject x -> PutObject
$cfrom :: forall x. PutObject -> Rep PutObject x
Prelude.Generic)

-- |
-- Create a value of 'PutObject' 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:
--
-- 'storageClass', 'putObject_storageClass' - Indicates the storage class of a @Put@ request. Defaults to
-- high-performance temporal storage class, and objects are persisted into
-- durable storage shortly after being received.
--
-- 'uploadAvailability', 'putObject_uploadAvailability' - Indicates the availability of an object while it is still uploading. If
-- the value is set to @streaming@, the object is available for downloading
-- after some initial buffering but before the object is uploaded
-- completely. If the value is set to @standard@, the object is available
-- for downloading only when it is uploaded completely. The default value
-- for this header is @standard@.
--
-- To use this header, you must also set the HTTP @Transfer-Encoding@
-- header to @chunked@.
--
-- 'cacheControl', 'putObject_cacheControl' - An optional @CacheControl@ header that allows the caller to control the
-- object\'s cache behavior. Headers can be passed in as specified in the
-- HTTP at
-- <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
--
-- Headers with a custom user-defined value are also accepted.
--
-- 'contentType', 'putObject_contentType' - The content type of the object.
--
-- 'path', 'putObject_path' - The path (including the file name) where the object is stored in the
-- container. Format: \<folder name>\/\<folder name>\/\<file name>
--
-- For example, to upload the file @mlaw.avi@ to the folder path
-- @premium\\canada@ in the container @movies@, enter the path
-- @premium\/canada\/mlaw.avi@.
--
-- Do not include the container name in this path.
--
-- If the path includes any folders that don\'t exist yet, the service
-- creates them. For example, suppose you have an existing @premium\/usa@
-- subfolder. If you specify @premium\/canada@, the service creates a
-- @canada@ subfolder in the @premium@ folder. You then have two
-- subfolders, @usa@ and @canada@, in the @premium@ folder.
--
-- There is no correlation between the path to the source and the path
-- (folders) in the container in AWS Elemental MediaStore.
--
-- For more information about folders and how they exist in a container,
-- see the
-- <http://docs.aws.amazon.com/mediastore/latest/ug/ AWS Elemental MediaStore User Guide>.
--
-- The file name is the name that is assigned to the file that you upload.
-- The file can have the same name inside and outside of AWS Elemental
-- MediaStore, or it can have the same name. The file name can include or
-- omit an extension.
--
-- 'body', 'putObject_body' - The bytes to be stored.
newPutObject ::
  -- | 'path'
  Prelude.Text ->
  -- | 'body'
  Core.HashedBody ->
  PutObject
newPutObject :: Text -> HashedBody -> PutObject
newPutObject Text
pPath_ HashedBody
pBody_ =
  PutObject' :: Maybe StorageClass
-> Maybe UploadAvailability
-> Maybe Text
-> Maybe Text
-> Text
-> HashedBody
-> PutObject
PutObject'
    { $sel:storageClass:PutObject' :: Maybe StorageClass
storageClass = Maybe StorageClass
forall a. Maybe a
Prelude.Nothing,
      $sel:uploadAvailability:PutObject' :: Maybe UploadAvailability
uploadAvailability = Maybe UploadAvailability
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheControl:PutObject' :: Maybe Text
cacheControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:PutObject' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:path:PutObject' :: Text
path = Text
pPath_,
      $sel:body:PutObject' :: HashedBody
body = HashedBody
pBody_
    }

-- | Indicates the storage class of a @Put@ request. Defaults to
-- high-performance temporal storage class, and objects are persisted into
-- durable storage shortly after being received.
putObject_storageClass :: Lens.Lens' PutObject (Prelude.Maybe StorageClass)
putObject_storageClass :: (Maybe StorageClass -> f (Maybe StorageClass))
-> PutObject -> f PutObject
putObject_storageClass = (PutObject -> Maybe StorageClass)
-> (PutObject -> Maybe StorageClass -> PutObject)
-> Lens
     PutObject PutObject (Maybe StorageClass) (Maybe StorageClass)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe StorageClass
storageClass :: Maybe StorageClass
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
storageClass} -> Maybe StorageClass
storageClass) (\s :: PutObject
s@PutObject' {} Maybe StorageClass
a -> PutObject
s {$sel:storageClass:PutObject' :: Maybe StorageClass
storageClass = Maybe StorageClass
a} :: PutObject)

-- | Indicates the availability of an object while it is still uploading. If
-- the value is set to @streaming@, the object is available for downloading
-- after some initial buffering but before the object is uploaded
-- completely. If the value is set to @standard@, the object is available
-- for downloading only when it is uploaded completely. The default value
-- for this header is @standard@.
--
-- To use this header, you must also set the HTTP @Transfer-Encoding@
-- header to @chunked@.
putObject_uploadAvailability :: Lens.Lens' PutObject (Prelude.Maybe UploadAvailability)
putObject_uploadAvailability :: (Maybe UploadAvailability -> f (Maybe UploadAvailability))
-> PutObject -> f PutObject
putObject_uploadAvailability = (PutObject -> Maybe UploadAvailability)
-> (PutObject -> Maybe UploadAvailability -> PutObject)
-> Lens
     PutObject
     PutObject
     (Maybe UploadAvailability)
     (Maybe UploadAvailability)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe UploadAvailability
uploadAvailability :: Maybe UploadAvailability
$sel:uploadAvailability:PutObject' :: PutObject -> Maybe UploadAvailability
uploadAvailability} -> Maybe UploadAvailability
uploadAvailability) (\s :: PutObject
s@PutObject' {} Maybe UploadAvailability
a -> PutObject
s {$sel:uploadAvailability:PutObject' :: Maybe UploadAvailability
uploadAvailability = Maybe UploadAvailability
a} :: PutObject)

-- | An optional @CacheControl@ header that allows the caller to control the
-- object\'s cache behavior. Headers can be passed in as specified in the
-- HTTP at
-- <https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
--
-- Headers with a custom user-defined value are also accepted.
putObject_cacheControl :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_cacheControl :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_cacheControl = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
cacheControl :: Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
cacheControl} -> Maybe Text
cacheControl) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:cacheControl:PutObject' :: Maybe Text
cacheControl = Maybe Text
a} :: PutObject)

-- | The content type of the object.
putObject_contentType :: Lens.Lens' PutObject (Prelude.Maybe Prelude.Text)
putObject_contentType :: (Maybe Text -> f (Maybe Text)) -> PutObject -> f PutObject
putObject_contentType = (PutObject -> Maybe Text)
-> (PutObject -> Maybe Text -> PutObject)
-> Lens PutObject PutObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Maybe Text
contentType :: Maybe Text
$sel:contentType:PutObject' :: PutObject -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: PutObject
s@PutObject' {} Maybe Text
a -> PutObject
s {$sel:contentType:PutObject' :: Maybe Text
contentType = Maybe Text
a} :: PutObject)

-- | The path (including the file name) where the object is stored in the
-- container. Format: \<folder name>\/\<folder name>\/\<file name>
--
-- For example, to upload the file @mlaw.avi@ to the folder path
-- @premium\\canada@ in the container @movies@, enter the path
-- @premium\/canada\/mlaw.avi@.
--
-- Do not include the container name in this path.
--
-- If the path includes any folders that don\'t exist yet, the service
-- creates them. For example, suppose you have an existing @premium\/usa@
-- subfolder. If you specify @premium\/canada@, the service creates a
-- @canada@ subfolder in the @premium@ folder. You then have two
-- subfolders, @usa@ and @canada@, in the @premium@ folder.
--
-- There is no correlation between the path to the source and the path
-- (folders) in the container in AWS Elemental MediaStore.
--
-- For more information about folders and how they exist in a container,
-- see the
-- <http://docs.aws.amazon.com/mediastore/latest/ug/ AWS Elemental MediaStore User Guide>.
--
-- The file name is the name that is assigned to the file that you upload.
-- The file can have the same name inside and outside of AWS Elemental
-- MediaStore, or it can have the same name. The file name can include or
-- omit an extension.
putObject_path :: Lens.Lens' PutObject Prelude.Text
putObject_path :: (Text -> f Text) -> PutObject -> f PutObject
putObject_path = (PutObject -> Text)
-> (PutObject -> Text -> PutObject)
-> Lens PutObject PutObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {Text
path :: Text
$sel:path:PutObject' :: PutObject -> Text
path} -> Text
path) (\s :: PutObject
s@PutObject' {} Text
a -> PutObject
s {$sel:path:PutObject' :: Text
path = Text
a} :: PutObject)

-- | The bytes to be stored.
putObject_body :: Lens.Lens' PutObject Core.HashedBody
putObject_body :: (HashedBody -> f HashedBody) -> PutObject -> f PutObject
putObject_body = (PutObject -> HashedBody)
-> (PutObject -> HashedBody -> PutObject)
-> Lens PutObject PutObject HashedBody HashedBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObject' {HashedBody
body :: HashedBody
$sel:body:PutObject' :: PutObject -> HashedBody
body} -> HashedBody
body) (\s :: PutObject
s@PutObject' {} HashedBody
a -> PutObject
s {$sel:body:PutObject' :: HashedBody
body = HashedBody
a} :: PutObject)

instance Core.AWSRequest PutObject where
  type AWSResponse PutObject = PutObjectResponse
  request :: PutObject -> Request PutObject
request = Service -> PutObject -> Request PutObject
forall a. (ToRequest a, ToBody a) => Service -> a -> Request a
Request.putBody Service
defaultService
  response :: Logger
-> Service
-> Proxy PutObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutObject)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutObject))
-> Logger
-> Service
-> Proxy PutObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutObject)))
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
-> Maybe StorageClass -> Maybe Text -> Int -> PutObjectResponse
PutObjectResponse'
            (Maybe Text
 -> Maybe StorageClass -> Maybe Text -> Int -> PutObjectResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe StorageClass -> Maybe Text -> Int -> PutObjectResponse)
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
"ETag")
            Either
  String
  (Maybe StorageClass -> Maybe Text -> Int -> PutObjectResponse)
-> Either String (Maybe StorageClass)
-> Either String (Maybe Text -> Int -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe StorageClass)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StorageClass")
            Either String (Maybe Text -> Int -> PutObjectResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PutObjectResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ContentSHA256")
            Either String (Int -> PutObjectResponse)
-> Either String Int -> Either String PutObjectResponse
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 Core.ToBody PutObject where
  toBody :: PutObject -> RequestBody
toBody PutObject' {Maybe Text
Maybe StorageClass
Maybe UploadAvailability
Text
HashedBody
body :: HashedBody
path :: Text
contentType :: Maybe Text
cacheControl :: Maybe Text
uploadAvailability :: Maybe UploadAvailability
storageClass :: Maybe StorageClass
$sel:body:PutObject' :: PutObject -> HashedBody
$sel:path:PutObject' :: PutObject -> Text
$sel:contentType:PutObject' :: PutObject -> Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
$sel:uploadAvailability:PutObject' :: PutObject -> Maybe UploadAvailability
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
..} = HashedBody -> RequestBody
forall a. ToBody a => a -> RequestBody
Core.toBody HashedBody
body

instance Core.ToHeaders PutObject where
  toHeaders :: PutObject -> ResponseHeaders
toHeaders PutObject' {Maybe Text
Maybe StorageClass
Maybe UploadAvailability
Text
HashedBody
body :: HashedBody
path :: Text
contentType :: Maybe Text
cacheControl :: Maybe Text
uploadAvailability :: Maybe UploadAvailability
storageClass :: Maybe StorageClass
$sel:body:PutObject' :: PutObject -> HashedBody
$sel:path:PutObject' :: PutObject -> Text
$sel:contentType:PutObject' :: PutObject -> Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
$sel:uploadAvailability:PutObject' :: PutObject -> Maybe UploadAvailability
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-storage-class" HeaderName -> Maybe StorageClass -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe StorageClass
storageClass,
        HeaderName
"x-amz-upload-availability"
          HeaderName -> Maybe UploadAvailability -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe UploadAvailability
uploadAvailability,
        HeaderName
"Cache-Control" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
cacheControl,
        HeaderName
"Content-Type" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentType
      ]

instance Core.ToPath PutObject where
  toPath :: PutObject -> ByteString
toPath PutObject' {Maybe Text
Maybe StorageClass
Maybe UploadAvailability
Text
HashedBody
body :: HashedBody
path :: Text
contentType :: Maybe Text
cacheControl :: Maybe Text
uploadAvailability :: Maybe UploadAvailability
storageClass :: Maybe StorageClass
$sel:body:PutObject' :: PutObject -> HashedBody
$sel:path:PutObject' :: PutObject -> Text
$sel:contentType:PutObject' :: PutObject -> Maybe Text
$sel:cacheControl:PutObject' :: PutObject -> Maybe Text
$sel:uploadAvailability:PutObject' :: PutObject -> Maybe UploadAvailability
$sel:storageClass:PutObject' :: PutObject -> Maybe StorageClass
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
path]

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

-- | /See:/ 'newPutObjectResponse' smart constructor.
data PutObjectResponse = PutObjectResponse'
  { -- | Unique identifier of the object in the container.
    PutObjectResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
    -- | The storage class where the object was persisted. The class should be
    -- “Temporal”.
    PutObjectResponse -> Maybe StorageClass
storageClass :: Prelude.Maybe StorageClass,
    -- | The SHA256 digest of the object that is persisted.
    PutObjectResponse -> Maybe Text
contentSHA256 :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    PutObjectResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutObjectResponse -> PutObjectResponse -> Bool
(PutObjectResponse -> PutObjectResponse -> Bool)
-> (PutObjectResponse -> PutObjectResponse -> Bool)
-> Eq PutObjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutObjectResponse -> PutObjectResponse -> Bool
$c/= :: PutObjectResponse -> PutObjectResponse -> Bool
== :: PutObjectResponse -> PutObjectResponse -> Bool
$c== :: PutObjectResponse -> PutObjectResponse -> Bool
Prelude.Eq, ReadPrec [PutObjectResponse]
ReadPrec PutObjectResponse
Int -> ReadS PutObjectResponse
ReadS [PutObjectResponse]
(Int -> ReadS PutObjectResponse)
-> ReadS [PutObjectResponse]
-> ReadPrec PutObjectResponse
-> ReadPrec [PutObjectResponse]
-> Read PutObjectResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutObjectResponse]
$creadListPrec :: ReadPrec [PutObjectResponse]
readPrec :: ReadPrec PutObjectResponse
$creadPrec :: ReadPrec PutObjectResponse
readList :: ReadS [PutObjectResponse]
$creadList :: ReadS [PutObjectResponse]
readsPrec :: Int -> ReadS PutObjectResponse
$creadsPrec :: Int -> ReadS PutObjectResponse
Prelude.Read, Int -> PutObjectResponse -> ShowS
[PutObjectResponse] -> ShowS
PutObjectResponse -> String
(Int -> PutObjectResponse -> ShowS)
-> (PutObjectResponse -> String)
-> ([PutObjectResponse] -> ShowS)
-> Show PutObjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutObjectResponse] -> ShowS
$cshowList :: [PutObjectResponse] -> ShowS
show :: PutObjectResponse -> String
$cshow :: PutObjectResponse -> String
showsPrec :: Int -> PutObjectResponse -> ShowS
$cshowsPrec :: Int -> PutObjectResponse -> ShowS
Prelude.Show, (forall x. PutObjectResponse -> Rep PutObjectResponse x)
-> (forall x. Rep PutObjectResponse x -> PutObjectResponse)
-> Generic PutObjectResponse
forall x. Rep PutObjectResponse x -> PutObjectResponse
forall x. PutObjectResponse -> Rep PutObjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutObjectResponse x -> PutObjectResponse
$cfrom :: forall x. PutObjectResponse -> Rep PutObjectResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutObjectResponse' 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:
--
-- 'eTag', 'putObjectResponse_eTag' - Unique identifier of the object in the container.
--
-- 'storageClass', 'putObjectResponse_storageClass' - The storage class where the object was persisted. The class should be
-- “Temporal”.
--
-- 'contentSHA256', 'putObjectResponse_contentSHA256' - The SHA256 digest of the object that is persisted.
--
-- 'httpStatus', 'putObjectResponse_httpStatus' - The response's http status code.
newPutObjectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutObjectResponse
newPutObjectResponse :: Int -> PutObjectResponse
newPutObjectResponse Int
pHttpStatus_ =
  PutObjectResponse' :: Maybe Text
-> Maybe StorageClass -> Maybe Text -> Int -> PutObjectResponse
PutObjectResponse'
    { $sel:eTag:PutObjectResponse' :: Maybe Text
eTag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:storageClass:PutObjectResponse' :: Maybe StorageClass
storageClass = Maybe StorageClass
forall a. Maybe a
Prelude.Nothing,
      $sel:contentSHA256:PutObjectResponse' :: Maybe Text
contentSHA256 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutObjectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Unique identifier of the object in the container.
putObjectResponse_eTag :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Text)
putObjectResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_eTag = (PutObjectResponse -> Maybe Text)
-> (PutObjectResponse -> Maybe Text -> PutObjectResponse)
-> Lens
     PutObjectResponse PutObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:PutObjectResponse' :: PutObjectResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe Text
a -> PutObjectResponse
s {$sel:eTag:PutObjectResponse' :: Maybe Text
eTag = Maybe Text
a} :: PutObjectResponse)

-- | The storage class where the object was persisted. The class should be
-- “Temporal”.
putObjectResponse_storageClass :: Lens.Lens' PutObjectResponse (Prelude.Maybe StorageClass)
putObjectResponse_storageClass :: (Maybe StorageClass -> f (Maybe StorageClass))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_storageClass = (PutObjectResponse -> Maybe StorageClass)
-> (PutObjectResponse -> Maybe StorageClass -> PutObjectResponse)
-> Lens
     PutObjectResponse
     PutObjectResponse
     (Maybe StorageClass)
     (Maybe StorageClass)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe StorageClass
storageClass :: Maybe StorageClass
$sel:storageClass:PutObjectResponse' :: PutObjectResponse -> Maybe StorageClass
storageClass} -> Maybe StorageClass
storageClass) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe StorageClass
a -> PutObjectResponse
s {$sel:storageClass:PutObjectResponse' :: Maybe StorageClass
storageClass = Maybe StorageClass
a} :: PutObjectResponse)

-- | The SHA256 digest of the object that is persisted.
putObjectResponse_contentSHA256 :: Lens.Lens' PutObjectResponse (Prelude.Maybe Prelude.Text)
putObjectResponse_contentSHA256 :: (Maybe Text -> f (Maybe Text))
-> PutObjectResponse -> f PutObjectResponse
putObjectResponse_contentSHA256 = (PutObjectResponse -> Maybe Text)
-> (PutObjectResponse -> Maybe Text -> PutObjectResponse)
-> Lens
     PutObjectResponse PutObjectResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutObjectResponse' {Maybe Text
contentSHA256 :: Maybe Text
$sel:contentSHA256:PutObjectResponse' :: PutObjectResponse -> Maybe Text
contentSHA256} -> Maybe Text
contentSHA256) (\s :: PutObjectResponse
s@PutObjectResponse' {} Maybe Text
a -> PutObjectResponse
s {$sel:contentSHA256:PutObjectResponse' :: Maybe Text
contentSHA256 = Maybe Text
a} :: PutObjectResponse)

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

instance Prelude.NFData PutObjectResponse