{-# 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.Snowball.DescribeAddresses
-- 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 a specified number of @ADDRESS@ objects. Calling this API in one
-- of the US regions will return addresses from the list of all addresses
-- associated with this account in all US regions.
--
-- This operation returns paginated results.
module Amazonka.Snowball.DescribeAddresses
  ( -- * Creating a Request
    DescribeAddresses (..),
    newDescribeAddresses,

    -- * Request Lenses
    describeAddresses_nextToken,
    describeAddresses_maxResults,

    -- * Destructuring the Response
    DescribeAddressesResponse (..),
    newDescribeAddressesResponse,

    -- * Response Lenses
    describeAddressesResponse_addresses,
    describeAddressesResponse_nextToken,
    describeAddressesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeAddresses' smart constructor.
data DescribeAddresses = DescribeAddresses'
  { -- | HTTP requests are stateless. To identify what object comes \"next\" in
    -- the list of @ADDRESS@ objects, you have the option of specifying a value
    -- for @NextToken@ as the starting point for your list of returned
    -- addresses.
    DescribeAddresses -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of @ADDRESS@ objects to return.
    DescribeAddresses -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeAddresses -> DescribeAddresses -> Bool
(DescribeAddresses -> DescribeAddresses -> Bool)
-> (DescribeAddresses -> DescribeAddresses -> Bool)
-> Eq DescribeAddresses
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAddresses -> DescribeAddresses -> Bool
$c/= :: DescribeAddresses -> DescribeAddresses -> Bool
== :: DescribeAddresses -> DescribeAddresses -> Bool
$c== :: DescribeAddresses -> DescribeAddresses -> Bool
Prelude.Eq, ReadPrec [DescribeAddresses]
ReadPrec DescribeAddresses
Int -> ReadS DescribeAddresses
ReadS [DescribeAddresses]
(Int -> ReadS DescribeAddresses)
-> ReadS [DescribeAddresses]
-> ReadPrec DescribeAddresses
-> ReadPrec [DescribeAddresses]
-> Read DescribeAddresses
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAddresses]
$creadListPrec :: ReadPrec [DescribeAddresses]
readPrec :: ReadPrec DescribeAddresses
$creadPrec :: ReadPrec DescribeAddresses
readList :: ReadS [DescribeAddresses]
$creadList :: ReadS [DescribeAddresses]
readsPrec :: Int -> ReadS DescribeAddresses
$creadsPrec :: Int -> ReadS DescribeAddresses
Prelude.Read, Int -> DescribeAddresses -> ShowS
[DescribeAddresses] -> ShowS
DescribeAddresses -> String
(Int -> DescribeAddresses -> ShowS)
-> (DescribeAddresses -> String)
-> ([DescribeAddresses] -> ShowS)
-> Show DescribeAddresses
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAddresses] -> ShowS
$cshowList :: [DescribeAddresses] -> ShowS
show :: DescribeAddresses -> String
$cshow :: DescribeAddresses -> String
showsPrec :: Int -> DescribeAddresses -> ShowS
$cshowsPrec :: Int -> DescribeAddresses -> ShowS
Prelude.Show, (forall x. DescribeAddresses -> Rep DescribeAddresses x)
-> (forall x. Rep DescribeAddresses x -> DescribeAddresses)
-> Generic DescribeAddresses
forall x. Rep DescribeAddresses x -> DescribeAddresses
forall x. DescribeAddresses -> Rep DescribeAddresses x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAddresses x -> DescribeAddresses
$cfrom :: forall x. DescribeAddresses -> Rep DescribeAddresses x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAddresses' 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:
--
-- 'nextToken', 'describeAddresses_nextToken' - HTTP requests are stateless. To identify what object comes \"next\" in
-- the list of @ADDRESS@ objects, you have the option of specifying a value
-- for @NextToken@ as the starting point for your list of returned
-- addresses.
--
-- 'maxResults', 'describeAddresses_maxResults' - The number of @ADDRESS@ objects to return.
newDescribeAddresses ::
  DescribeAddresses
newDescribeAddresses :: DescribeAddresses
newDescribeAddresses =
  DescribeAddresses' :: Maybe Text -> Maybe Natural -> DescribeAddresses
DescribeAddresses'
    { $sel:nextToken:DescribeAddresses' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeAddresses' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | HTTP requests are stateless. To identify what object comes \"next\" in
-- the list of @ADDRESS@ objects, you have the option of specifying a value
-- for @NextToken@ as the starting point for your list of returned
-- addresses.
describeAddresses_nextToken :: Lens.Lens' DescribeAddresses (Prelude.Maybe Prelude.Text)
describeAddresses_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAddresses -> f DescribeAddresses
describeAddresses_nextToken = (DescribeAddresses -> Maybe Text)
-> (DescribeAddresses -> Maybe Text -> DescribeAddresses)
-> Lens
     DescribeAddresses DescribeAddresses (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddresses' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAddresses' :: DescribeAddresses -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAddresses
s@DescribeAddresses' {} Maybe Text
a -> DescribeAddresses
s {$sel:nextToken:DescribeAddresses' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAddresses)

-- | The number of @ADDRESS@ objects to return.
describeAddresses_maxResults :: Lens.Lens' DescribeAddresses (Prelude.Maybe Prelude.Natural)
describeAddresses_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeAddresses -> f DescribeAddresses
describeAddresses_maxResults = (DescribeAddresses -> Maybe Natural)
-> (DescribeAddresses -> Maybe Natural -> DescribeAddresses)
-> Lens
     DescribeAddresses DescribeAddresses (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddresses' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeAddresses' :: DescribeAddresses -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeAddresses
s@DescribeAddresses' {} Maybe Natural
a -> DescribeAddresses
s {$sel:maxResults:DescribeAddresses' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeAddresses)

instance Core.AWSPager DescribeAddresses where
  page :: DescribeAddresses
-> AWSResponse DescribeAddresses -> Maybe DescribeAddresses
page DescribeAddresses
rq AWSResponse DescribeAddresses
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAddresses
DescribeAddressesResponse
rs
            DescribeAddressesResponse
-> Getting (First Text) DescribeAddressesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAddressesResponse
-> Const (First Text) DescribeAddressesResponse
Lens' DescribeAddressesResponse (Maybe Text)
describeAddressesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAddressesResponse
 -> Const (First Text) DescribeAddressesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeAddressesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAddresses
forall a. Maybe a
Prelude.Nothing
    | Maybe [Address] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAddresses
DescribeAddressesResponse
rs
            DescribeAddressesResponse
-> Getting (First [Address]) DescribeAddressesResponse [Address]
-> Maybe [Address]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Address] -> Const (First [Address]) (Maybe [Address]))
-> DescribeAddressesResponse
-> Const (First [Address]) DescribeAddressesResponse
Lens' DescribeAddressesResponse (Maybe [Address])
describeAddressesResponse_addresses
              ((Maybe [Address] -> Const (First [Address]) (Maybe [Address]))
 -> DescribeAddressesResponse
 -> Const (First [Address]) DescribeAddressesResponse)
-> (([Address] -> Const (First [Address]) [Address])
    -> Maybe [Address] -> Const (First [Address]) (Maybe [Address]))
-> Getting (First [Address]) DescribeAddressesResponse [Address]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Address] -> Const (First [Address]) [Address])
-> Maybe [Address] -> Const (First [Address]) (Maybe [Address])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAddresses
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeAddresses -> Maybe DescribeAddresses
forall a. a -> Maybe a
Prelude.Just (DescribeAddresses -> Maybe DescribeAddresses)
-> DescribeAddresses -> Maybe DescribeAddresses
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeAddresses
rq
          DescribeAddresses
-> (DescribeAddresses -> DescribeAddresses) -> DescribeAddresses
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeAddresses -> Identity DescribeAddresses
Lens DescribeAddresses DescribeAddresses (Maybe Text) (Maybe Text)
describeAddresses_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeAddresses -> Identity DescribeAddresses)
-> Maybe Text -> DescribeAddresses -> DescribeAddresses
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAddresses
DescribeAddressesResponse
rs
          DescribeAddressesResponse
-> Getting (First Text) DescribeAddressesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAddressesResponse
-> Const (First Text) DescribeAddressesResponse
Lens' DescribeAddressesResponse (Maybe Text)
describeAddressesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAddressesResponse
 -> Const (First Text) DescribeAddressesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeAddressesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeAddresses where
  type
    AWSResponse DescribeAddresses =
      DescribeAddressesResponse
  request :: DescribeAddresses -> Request DescribeAddresses
request = Service -> DescribeAddresses -> Request DescribeAddresses
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAddresses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAddresses)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAddresses))
-> Logger
-> Service
-> Proxy DescribeAddresses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAddresses)))
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 [Address] -> Maybe Text -> Int -> DescribeAddressesResponse
DescribeAddressesResponse'
            (Maybe [Address] -> Maybe Text -> Int -> DescribeAddressesResponse)
-> Either String (Maybe [Address])
-> Either String (Maybe Text -> Int -> DescribeAddressesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Address]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Addresses" Either String (Maybe (Maybe [Address]))
-> Maybe [Address] -> Either String (Maybe [Address])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Address]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeAddressesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeAddressesResponse)
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
"NextToken")
            Either String (Int -> DescribeAddressesResponse)
-> Either String Int -> Either String DescribeAddressesResponse
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 DescribeAddresses

instance Prelude.NFData DescribeAddresses

instance Core.ToHeaders DescribeAddresses where
  toHeaders :: DescribeAddresses -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeAddresses -> 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
"AWSIESnowballJobManagementService.DescribeAddresses" ::
                          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 DescribeAddresses where
  toJSON :: DescribeAddresses -> Value
toJSON DescribeAddresses' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:DescribeAddresses' :: DescribeAddresses -> Maybe Natural
$sel:nextToken:DescribeAddresses' :: DescribeAddresses -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newDescribeAddressesResponse' smart constructor.
data DescribeAddressesResponse = DescribeAddressesResponse'
  { -- | The Snow device shipping addresses that were created for this account.
    DescribeAddressesResponse -> Maybe [Address]
addresses :: Prelude.Maybe [Address],
    -- | HTTP requests are stateless. If you use the automatically generated
    -- @NextToken@ value in your next @DescribeAddresses@ call, your list of
    -- returned addresses will start from this point in the array.
    DescribeAddressesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAddressesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAddressesResponse -> DescribeAddressesResponse -> Bool
(DescribeAddressesResponse -> DescribeAddressesResponse -> Bool)
-> (DescribeAddressesResponse -> DescribeAddressesResponse -> Bool)
-> Eq DescribeAddressesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAddressesResponse -> DescribeAddressesResponse -> Bool
$c/= :: DescribeAddressesResponse -> DescribeAddressesResponse -> Bool
== :: DescribeAddressesResponse -> DescribeAddressesResponse -> Bool
$c== :: DescribeAddressesResponse -> DescribeAddressesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAddressesResponse]
ReadPrec DescribeAddressesResponse
Int -> ReadS DescribeAddressesResponse
ReadS [DescribeAddressesResponse]
(Int -> ReadS DescribeAddressesResponse)
-> ReadS [DescribeAddressesResponse]
-> ReadPrec DescribeAddressesResponse
-> ReadPrec [DescribeAddressesResponse]
-> Read DescribeAddressesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAddressesResponse]
$creadListPrec :: ReadPrec [DescribeAddressesResponse]
readPrec :: ReadPrec DescribeAddressesResponse
$creadPrec :: ReadPrec DescribeAddressesResponse
readList :: ReadS [DescribeAddressesResponse]
$creadList :: ReadS [DescribeAddressesResponse]
readsPrec :: Int -> ReadS DescribeAddressesResponse
$creadsPrec :: Int -> ReadS DescribeAddressesResponse
Prelude.Read, Int -> DescribeAddressesResponse -> ShowS
[DescribeAddressesResponse] -> ShowS
DescribeAddressesResponse -> String
(Int -> DescribeAddressesResponse -> ShowS)
-> (DescribeAddressesResponse -> String)
-> ([DescribeAddressesResponse] -> ShowS)
-> Show DescribeAddressesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAddressesResponse] -> ShowS
$cshowList :: [DescribeAddressesResponse] -> ShowS
show :: DescribeAddressesResponse -> String
$cshow :: DescribeAddressesResponse -> String
showsPrec :: Int -> DescribeAddressesResponse -> ShowS
$cshowsPrec :: Int -> DescribeAddressesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAddressesResponse -> Rep DescribeAddressesResponse x)
-> (forall x.
    Rep DescribeAddressesResponse x -> DescribeAddressesResponse)
-> Generic DescribeAddressesResponse
forall x.
Rep DescribeAddressesResponse x -> DescribeAddressesResponse
forall x.
DescribeAddressesResponse -> Rep DescribeAddressesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAddressesResponse x -> DescribeAddressesResponse
$cfrom :: forall x.
DescribeAddressesResponse -> Rep DescribeAddressesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAddressesResponse' 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:
--
-- 'addresses', 'describeAddressesResponse_addresses' - The Snow device shipping addresses that were created for this account.
--
-- 'nextToken', 'describeAddressesResponse_nextToken' - HTTP requests are stateless. If you use the automatically generated
-- @NextToken@ value in your next @DescribeAddresses@ call, your list of
-- returned addresses will start from this point in the array.
--
-- 'httpStatus', 'describeAddressesResponse_httpStatus' - The response's http status code.
newDescribeAddressesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAddressesResponse
newDescribeAddressesResponse :: Int -> DescribeAddressesResponse
newDescribeAddressesResponse Int
pHttpStatus_ =
  DescribeAddressesResponse' :: Maybe [Address] -> Maybe Text -> Int -> DescribeAddressesResponse
DescribeAddressesResponse'
    { $sel:addresses:DescribeAddressesResponse' :: Maybe [Address]
addresses =
        Maybe [Address]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAddressesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAddressesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Snow device shipping addresses that were created for this account.
describeAddressesResponse_addresses :: Lens.Lens' DescribeAddressesResponse (Prelude.Maybe [Address])
describeAddressesResponse_addresses :: (Maybe [Address] -> f (Maybe [Address]))
-> DescribeAddressesResponse -> f DescribeAddressesResponse
describeAddressesResponse_addresses = (DescribeAddressesResponse -> Maybe [Address])
-> (DescribeAddressesResponse
    -> Maybe [Address] -> DescribeAddressesResponse)
-> Lens' DescribeAddressesResponse (Maybe [Address])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddressesResponse' {Maybe [Address]
addresses :: Maybe [Address]
$sel:addresses:DescribeAddressesResponse' :: DescribeAddressesResponse -> Maybe [Address]
addresses} -> Maybe [Address]
addresses) (\s :: DescribeAddressesResponse
s@DescribeAddressesResponse' {} Maybe [Address]
a -> DescribeAddressesResponse
s {$sel:addresses:DescribeAddressesResponse' :: Maybe [Address]
addresses = Maybe [Address]
a} :: DescribeAddressesResponse) ((Maybe [Address] -> f (Maybe [Address]))
 -> DescribeAddressesResponse -> f DescribeAddressesResponse)
-> ((Maybe [Address] -> f (Maybe [Address]))
    -> Maybe [Address] -> f (Maybe [Address]))
-> (Maybe [Address] -> f (Maybe [Address]))
-> DescribeAddressesResponse
-> f DescribeAddressesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Address] [Address] [Address] [Address]
-> Iso
     (Maybe [Address])
     (Maybe [Address])
     (Maybe [Address])
     (Maybe [Address])
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 [Address] [Address] [Address] [Address]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | HTTP requests are stateless. If you use the automatically generated
-- @NextToken@ value in your next @DescribeAddresses@ call, your list of
-- returned addresses will start from this point in the array.
describeAddressesResponse_nextToken :: Lens.Lens' DescribeAddressesResponse (Prelude.Maybe Prelude.Text)
describeAddressesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAddressesResponse -> f DescribeAddressesResponse
describeAddressesResponse_nextToken = (DescribeAddressesResponse -> Maybe Text)
-> (DescribeAddressesResponse
    -> Maybe Text -> DescribeAddressesResponse)
-> Lens' DescribeAddressesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddressesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAddressesResponse' :: DescribeAddressesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAddressesResponse
s@DescribeAddressesResponse' {} Maybe Text
a -> DescribeAddressesResponse
s {$sel:nextToken:DescribeAddressesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAddressesResponse)

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

instance Prelude.NFData DescribeAddressesResponse