{-# 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.S3.GetObjectTorrent
-- 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)
--
-- Returns torrent files from a bucket. BitTorrent can save you bandwidth
-- when you\'re distributing large files. For more information about
-- BitTorrent, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html Using BitTorrent with Amazon S3>.
--
-- You can get torrent only for objects that are less than 5 GB in size,
-- and that are not encrypted using server-side encryption with a
-- customer-provided encryption key.
--
-- To use GET, you must have READ access to the object.
--
-- This action is not supported by Amazon S3 on Outposts.
--
-- The following action is related to @GetObjectTorrent@:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html GetObject>
module Amazonka.S3.GetObjectTorrent
  ( -- * Creating a Request
    GetObjectTorrent (..),
    newGetObjectTorrent,

    -- * Request Lenses
    getObjectTorrent_requestPayer,
    getObjectTorrent_expectedBucketOwner,
    getObjectTorrent_bucket,
    getObjectTorrent_key,

    -- * Destructuring the Response
    GetObjectTorrentResponse (..),
    newGetObjectTorrentResponse,

    -- * Response Lenses
    getObjectTorrentResponse_requestCharged,
    getObjectTorrentResponse_httpStatus,
    getObjectTorrentResponse_body,
  )
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.S3.Types

-- | /See:/ 'newGetObjectTorrent' smart constructor.
data GetObjectTorrent = GetObjectTorrent'
  { GetObjectTorrent -> Maybe RequestPayer
requestPayer :: Prelude.Maybe RequestPayer,
    -- | The account ID of the expected bucket owner. If the bucket is owned by a
    -- different account, the request will fail with an HTTP
    -- @403 (Access Denied)@ error.
    GetObjectTorrent -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket containing the object for which to get the
    -- torrent files.
    GetObjectTorrent -> BucketName
bucket :: BucketName,
    -- | The object key for which to get the information.
    GetObjectTorrent -> ObjectKey
key :: ObjectKey
  }
  deriving (GetObjectTorrent -> GetObjectTorrent -> Bool
(GetObjectTorrent -> GetObjectTorrent -> Bool)
-> (GetObjectTorrent -> GetObjectTorrent -> Bool)
-> Eq GetObjectTorrent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetObjectTorrent -> GetObjectTorrent -> Bool
$c/= :: GetObjectTorrent -> GetObjectTorrent -> Bool
== :: GetObjectTorrent -> GetObjectTorrent -> Bool
$c== :: GetObjectTorrent -> GetObjectTorrent -> Bool
Prelude.Eq, ReadPrec [GetObjectTorrent]
ReadPrec GetObjectTorrent
Int -> ReadS GetObjectTorrent
ReadS [GetObjectTorrent]
(Int -> ReadS GetObjectTorrent)
-> ReadS [GetObjectTorrent]
-> ReadPrec GetObjectTorrent
-> ReadPrec [GetObjectTorrent]
-> Read GetObjectTorrent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetObjectTorrent]
$creadListPrec :: ReadPrec [GetObjectTorrent]
readPrec :: ReadPrec GetObjectTorrent
$creadPrec :: ReadPrec GetObjectTorrent
readList :: ReadS [GetObjectTorrent]
$creadList :: ReadS [GetObjectTorrent]
readsPrec :: Int -> ReadS GetObjectTorrent
$creadsPrec :: Int -> ReadS GetObjectTorrent
Prelude.Read, Int -> GetObjectTorrent -> ShowS
[GetObjectTorrent] -> ShowS
GetObjectTorrent -> String
(Int -> GetObjectTorrent -> ShowS)
-> (GetObjectTorrent -> String)
-> ([GetObjectTorrent] -> ShowS)
-> Show GetObjectTorrent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectTorrent] -> ShowS
$cshowList :: [GetObjectTorrent] -> ShowS
show :: GetObjectTorrent -> String
$cshow :: GetObjectTorrent -> String
showsPrec :: Int -> GetObjectTorrent -> ShowS
$cshowsPrec :: Int -> GetObjectTorrent -> ShowS
Prelude.Show, (forall x. GetObjectTorrent -> Rep GetObjectTorrent x)
-> (forall x. Rep GetObjectTorrent x -> GetObjectTorrent)
-> Generic GetObjectTorrent
forall x. Rep GetObjectTorrent x -> GetObjectTorrent
forall x. GetObjectTorrent -> Rep GetObjectTorrent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetObjectTorrent x -> GetObjectTorrent
$cfrom :: forall x. GetObjectTorrent -> Rep GetObjectTorrent x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectTorrent' 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:
--
-- 'requestPayer', 'getObjectTorrent_requestPayer' - Undocumented member.
--
-- 'expectedBucketOwner', 'getObjectTorrent_expectedBucketOwner' - The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
--
-- 'bucket', 'getObjectTorrent_bucket' - The name of the bucket containing the object for which to get the
-- torrent files.
--
-- 'key', 'getObjectTorrent_key' - The object key for which to get the information.
newGetObjectTorrent ::
  -- | 'bucket'
  BucketName ->
  -- | 'key'
  ObjectKey ->
  GetObjectTorrent
newGetObjectTorrent :: BucketName -> ObjectKey -> GetObjectTorrent
newGetObjectTorrent BucketName
pBucket_ ObjectKey
pKey_ =
  GetObjectTorrent' :: Maybe RequestPayer
-> Maybe Text -> BucketName -> ObjectKey -> GetObjectTorrent
GetObjectTorrent'
    { $sel:requestPayer:GetObjectTorrent' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedBucketOwner:GetObjectTorrent' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucket:GetObjectTorrent' :: BucketName
bucket = BucketName
pBucket_,
      $sel:key:GetObjectTorrent' :: ObjectKey
key = ObjectKey
pKey_
    }

-- | Undocumented member.
getObjectTorrent_requestPayer :: Lens.Lens' GetObjectTorrent (Prelude.Maybe RequestPayer)
getObjectTorrent_requestPayer :: (Maybe RequestPayer -> f (Maybe RequestPayer))
-> GetObjectTorrent -> f GetObjectTorrent
getObjectTorrent_requestPayer = (GetObjectTorrent -> Maybe RequestPayer)
-> (GetObjectTorrent -> Maybe RequestPayer -> GetObjectTorrent)
-> Lens
     GetObjectTorrent
     GetObjectTorrent
     (Maybe RequestPayer)
     (Maybe RequestPayer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectTorrent' {Maybe RequestPayer
requestPayer :: Maybe RequestPayer
$sel:requestPayer:GetObjectTorrent' :: GetObjectTorrent -> Maybe RequestPayer
requestPayer} -> Maybe RequestPayer
requestPayer) (\s :: GetObjectTorrent
s@GetObjectTorrent' {} Maybe RequestPayer
a -> GetObjectTorrent
s {$sel:requestPayer:GetObjectTorrent' :: Maybe RequestPayer
requestPayer = Maybe RequestPayer
a} :: GetObjectTorrent)

-- | The account ID of the expected bucket owner. If the bucket is owned by a
-- different account, the request will fail with an HTTP
-- @403 (Access Denied)@ error.
getObjectTorrent_expectedBucketOwner :: Lens.Lens' GetObjectTorrent (Prelude.Maybe Prelude.Text)
getObjectTorrent_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> GetObjectTorrent -> f GetObjectTorrent
getObjectTorrent_expectedBucketOwner = (GetObjectTorrent -> Maybe Text)
-> (GetObjectTorrent -> Maybe Text -> GetObjectTorrent)
-> Lens GetObjectTorrent GetObjectTorrent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectTorrent' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetObjectTorrent' :: GetObjectTorrent -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetObjectTorrent
s@GetObjectTorrent' {} Maybe Text
a -> GetObjectTorrent
s {$sel:expectedBucketOwner:GetObjectTorrent' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetObjectTorrent)

-- | The name of the bucket containing the object for which to get the
-- torrent files.
getObjectTorrent_bucket :: Lens.Lens' GetObjectTorrent BucketName
getObjectTorrent_bucket :: (BucketName -> f BucketName)
-> GetObjectTorrent -> f GetObjectTorrent
getObjectTorrent_bucket = (GetObjectTorrent -> BucketName)
-> (GetObjectTorrent -> BucketName -> GetObjectTorrent)
-> Lens GetObjectTorrent GetObjectTorrent BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectTorrent' {BucketName
bucket :: BucketName
$sel:bucket:GetObjectTorrent' :: GetObjectTorrent -> BucketName
bucket} -> BucketName
bucket) (\s :: GetObjectTorrent
s@GetObjectTorrent' {} BucketName
a -> GetObjectTorrent
s {$sel:bucket:GetObjectTorrent' :: BucketName
bucket = BucketName
a} :: GetObjectTorrent)

-- | The object key for which to get the information.
getObjectTorrent_key :: Lens.Lens' GetObjectTorrent ObjectKey
getObjectTorrent_key :: (ObjectKey -> f ObjectKey)
-> GetObjectTorrent -> f GetObjectTorrent
getObjectTorrent_key = (GetObjectTorrent -> ObjectKey)
-> (GetObjectTorrent -> ObjectKey -> GetObjectTorrent)
-> Lens GetObjectTorrent GetObjectTorrent ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectTorrent' {ObjectKey
key :: ObjectKey
$sel:key:GetObjectTorrent' :: GetObjectTorrent -> ObjectKey
key} -> ObjectKey
key) (\s :: GetObjectTorrent
s@GetObjectTorrent' {} ObjectKey
a -> GetObjectTorrent
s {$sel:key:GetObjectTorrent' :: ObjectKey
key = ObjectKey
a} :: GetObjectTorrent)

instance Core.AWSRequest GetObjectTorrent where
  type
    AWSResponse GetObjectTorrent =
      GetObjectTorrentResponse
  request :: GetObjectTorrent -> Request GetObjectTorrent
request =
    Request GetObjectTorrent -> Request GetObjectTorrent
forall a. Request a -> Request a
Request.s3vhost
      (Request GetObjectTorrent -> Request GetObjectTorrent)
-> (GetObjectTorrent -> Request GetObjectTorrent)
-> GetObjectTorrent
-> Request GetObjectTorrent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> GetObjectTorrent -> Request GetObjectTorrent
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetObjectTorrent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetObjectTorrent)))
response =
    (Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse GetObjectTorrent))
-> Logger
-> Service
-> Proxy GetObjectTorrent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetObjectTorrent)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBody
      ( \Int
s ResponseHeaders
h ResponseBody
x ->
          Maybe RequestCharged
-> Int -> ResponseBody -> GetObjectTorrentResponse
GetObjectTorrentResponse'
            (Maybe RequestCharged
 -> Int -> ResponseBody -> GetObjectTorrentResponse)
-> Either String (Maybe RequestCharged)
-> Either String (Int -> ResponseBody -> GetObjectTorrentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe RequestCharged)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-request-charged")
            Either String (Int -> ResponseBody -> GetObjectTorrentResponse)
-> Either String Int
-> Either String (ResponseBody -> GetObjectTorrentResponse)
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))
            Either String (ResponseBody -> GetObjectTorrentResponse)
-> Either String ResponseBody
-> Either String GetObjectTorrentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseBody -> Either String ResponseBody
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure ResponseBody
x)
      )

instance Prelude.Hashable GetObjectTorrent

instance Prelude.NFData GetObjectTorrent

instance Core.ToHeaders GetObjectTorrent where
  toHeaders :: GetObjectTorrent -> ResponseHeaders
toHeaders GetObjectTorrent' {Maybe Text
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
$sel:key:GetObjectTorrent' :: GetObjectTorrent -> ObjectKey
$sel:bucket:GetObjectTorrent' :: GetObjectTorrent -> BucketName
$sel:expectedBucketOwner:GetObjectTorrent' :: GetObjectTorrent -> Maybe Text
$sel:requestPayer:GetObjectTorrent' :: GetObjectTorrent -> Maybe RequestPayer
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"x-amz-request-payer" HeaderName -> Maybe RequestPayer -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe RequestPayer
requestPayer,
        HeaderName
"x-amz-expected-bucket-owner"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
      ]

instance Core.ToPath GetObjectTorrent where
  toPath :: GetObjectTorrent -> ByteString
toPath GetObjectTorrent' {Maybe Text
Maybe RequestPayer
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
requestPayer :: Maybe RequestPayer
$sel:key:GetObjectTorrent' :: GetObjectTorrent -> ObjectKey
$sel:bucket:GetObjectTorrent' :: GetObjectTorrent -> BucketName
$sel:expectedBucketOwner:GetObjectTorrent' :: GetObjectTorrent -> Maybe Text
$sel:requestPayer:GetObjectTorrent' :: GetObjectTorrent -> Maybe RequestPayer
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket, ByteString
"/", ObjectKey -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ObjectKey
key]

instance Core.ToQuery GetObjectTorrent where
  toQuery :: GetObjectTorrent -> QueryString
toQuery = QueryString -> GetObjectTorrent -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"torrent"])

-- | /See:/ 'newGetObjectTorrentResponse' smart constructor.
data GetObjectTorrentResponse = GetObjectTorrentResponse'
  { GetObjectTorrentResponse -> Maybe RequestCharged
requestCharged :: Prelude.Maybe RequestCharged,
    -- | The response's http status code.
    GetObjectTorrentResponse -> Int
httpStatus :: Prelude.Int,
    -- | A Bencoded dictionary as defined by the BitTorrent specification
    GetObjectTorrentResponse -> ResponseBody
body :: Core.ResponseBody
  }
  deriving (Int -> GetObjectTorrentResponse -> ShowS
[GetObjectTorrentResponse] -> ShowS
GetObjectTorrentResponse -> String
(Int -> GetObjectTorrentResponse -> ShowS)
-> (GetObjectTorrentResponse -> String)
-> ([GetObjectTorrentResponse] -> ShowS)
-> Show GetObjectTorrentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetObjectTorrentResponse] -> ShowS
$cshowList :: [GetObjectTorrentResponse] -> ShowS
show :: GetObjectTorrentResponse -> String
$cshow :: GetObjectTorrentResponse -> String
showsPrec :: Int -> GetObjectTorrentResponse -> ShowS
$cshowsPrec :: Int -> GetObjectTorrentResponse -> ShowS
Prelude.Show, (forall x.
 GetObjectTorrentResponse -> Rep GetObjectTorrentResponse x)
-> (forall x.
    Rep GetObjectTorrentResponse x -> GetObjectTorrentResponse)
-> Generic GetObjectTorrentResponse
forall x.
Rep GetObjectTorrentResponse x -> GetObjectTorrentResponse
forall x.
GetObjectTorrentResponse -> Rep GetObjectTorrentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetObjectTorrentResponse x -> GetObjectTorrentResponse
$cfrom :: forall x.
GetObjectTorrentResponse -> Rep GetObjectTorrentResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetObjectTorrentResponse' 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:
--
-- 'requestCharged', 'getObjectTorrentResponse_requestCharged' - Undocumented member.
--
-- 'httpStatus', 'getObjectTorrentResponse_httpStatus' - The response's http status code.
--
-- 'body', 'getObjectTorrentResponse_body' - A Bencoded dictionary as defined by the BitTorrent specification
newGetObjectTorrentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'body'
  Core.ResponseBody ->
  GetObjectTorrentResponse
newGetObjectTorrentResponse :: Int -> ResponseBody -> GetObjectTorrentResponse
newGetObjectTorrentResponse Int
pHttpStatus_ ResponseBody
pBody_ =
  GetObjectTorrentResponse' :: Maybe RequestCharged
-> Int -> ResponseBody -> GetObjectTorrentResponse
GetObjectTorrentResponse'
    { $sel:requestCharged:GetObjectTorrentResponse' :: Maybe RequestCharged
requestCharged =
        Maybe RequestCharged
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetObjectTorrentResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:body:GetObjectTorrentResponse' :: ResponseBody
body = ResponseBody
pBody_
    }

-- | Undocumented member.
getObjectTorrentResponse_requestCharged :: Lens.Lens' GetObjectTorrentResponse (Prelude.Maybe RequestCharged)
getObjectTorrentResponse_requestCharged :: (Maybe RequestCharged -> f (Maybe RequestCharged))
-> GetObjectTorrentResponse -> f GetObjectTorrentResponse
getObjectTorrentResponse_requestCharged = (GetObjectTorrentResponse -> Maybe RequestCharged)
-> (GetObjectTorrentResponse
    -> Maybe RequestCharged -> GetObjectTorrentResponse)
-> Lens
     GetObjectTorrentResponse
     GetObjectTorrentResponse
     (Maybe RequestCharged)
     (Maybe RequestCharged)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectTorrentResponse' {Maybe RequestCharged
requestCharged :: Maybe RequestCharged
$sel:requestCharged:GetObjectTorrentResponse' :: GetObjectTorrentResponse -> Maybe RequestCharged
requestCharged} -> Maybe RequestCharged
requestCharged) (\s :: GetObjectTorrentResponse
s@GetObjectTorrentResponse' {} Maybe RequestCharged
a -> GetObjectTorrentResponse
s {$sel:requestCharged:GetObjectTorrentResponse' :: Maybe RequestCharged
requestCharged = Maybe RequestCharged
a} :: GetObjectTorrentResponse)

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

-- | A Bencoded dictionary as defined by the BitTorrent specification
getObjectTorrentResponse_body :: Lens.Lens' GetObjectTorrentResponse Core.ResponseBody
getObjectTorrentResponse_body :: (ResponseBody -> f ResponseBody)
-> GetObjectTorrentResponse -> f GetObjectTorrentResponse
getObjectTorrentResponse_body = (GetObjectTorrentResponse -> ResponseBody)
-> (GetObjectTorrentResponse
    -> ResponseBody -> GetObjectTorrentResponse)
-> Lens
     GetObjectTorrentResponse
     GetObjectTorrentResponse
     ResponseBody
     ResponseBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetObjectTorrentResponse' {ResponseBody
body :: ResponseBody
$sel:body:GetObjectTorrentResponse' :: GetObjectTorrentResponse -> ResponseBody
body} -> ResponseBody
body) (\s :: GetObjectTorrentResponse
s@GetObjectTorrentResponse' {} ResponseBody
a -> GetObjectTorrentResponse
s {$sel:body:GetObjectTorrentResponse' :: ResponseBody
body = ResponseBody
a} :: GetObjectTorrentResponse)