{-# 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.EC2.DescribeAddresses
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the specified Elastic IP addresses or all of your Elastic IP
-- addresses.
--
-- An Elastic IP address is for use in either the EC2-Classic platform or
-- in a VPC. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html Elastic IP Addresses>
-- in the /Amazon Elastic Compute Cloud User Guide/.
--
-- We are retiring EC2-Classic. We recommend that you migrate from
-- EC2-Classic to a VPC. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html Migrate from EC2-Classic to a VPC>
-- in the /Amazon Elastic Compute Cloud User Guide/.
module Amazonka.EC2.DescribeAddresses
  ( -- * Creating a Request
    DescribeAddresses (..),
    newDescribeAddresses,

    -- * Request Lenses
    describeAddresses_allocationIds,
    describeAddresses_dryRun,
    describeAddresses_filters,
    describeAddresses_publicIps,

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

    -- * Response Lenses
    describeAddressesResponse_addresses,
    describeAddressesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeAddresses' smart constructor.
data DescribeAddresses = DescribeAddresses'
  { -- | [EC2-VPC] Information about the allocation IDs.
    DescribeAddresses -> Maybe [Text]
allocationIds :: Prelude.Maybe [Prelude.Text],
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribeAddresses -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters. Filter names and values are case-sensitive.
    --
    -- -   @allocation-id@ - [EC2-VPC] The allocation ID for the address.
    --
    -- -   @association-id@ - [EC2-VPC] The association ID for the address.
    --
    -- -   @domain@ - Indicates whether the address is for use in EC2-Classic
    --     (@standard@) or in a VPC (@vpc@).
    --
    -- -   @instance-id@ - The ID of the instance the address is associated
    --     with, if any.
    --
    -- -   @network-border-group@ - A unique set of Availability Zones, Local
    --     Zones, or Wavelength Zones from where Amazon Web Services advertises
    --     IP addresses.
    --
    -- -   @network-interface-id@ - [EC2-VPC] The ID of the network interface
    --     that the address is associated with, if any.
    --
    -- -   @network-interface-owner-id@ - The Amazon Web Services account ID of
    --     the owner.
    --
    -- -   @private-ip-address@ - [EC2-VPC] The private IP address associated
    --     with the Elastic IP address.
    --
    -- -   @public-ip@ - The Elastic IP address, or the carrier IP address.
    --
    -- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
    --     resource. Use the tag key in the filter name and the tag value as
    --     the filter value. For example, to find all resources that have a tag
    --     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
    --     the filter name and @TeamA@ for the filter value.
    --
    -- -   @tag-key@ - The key of a tag assigned to the resource. Use this
    --     filter to find all resources assigned a tag with a specific key,
    --     regardless of the tag value.
    DescribeAddresses -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | One or more Elastic IP addresses.
    --
    -- Default: Describes all your Elastic IP addresses.
    DescribeAddresses -> Maybe [Text]
publicIps :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeAddresses -> DescribeAddresses -> Bool
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]
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
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. 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:
--
-- 'allocationIds', 'describeAddresses_allocationIds' - [EC2-VPC] Information about the allocation IDs.
--
-- 'dryRun', 'describeAddresses_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeAddresses_filters' - One or more filters. Filter names and values are case-sensitive.
--
-- -   @allocation-id@ - [EC2-VPC] The allocation ID for the address.
--
-- -   @association-id@ - [EC2-VPC] The association ID for the address.
--
-- -   @domain@ - Indicates whether the address is for use in EC2-Classic
--     (@standard@) or in a VPC (@vpc@).
--
-- -   @instance-id@ - The ID of the instance the address is associated
--     with, if any.
--
-- -   @network-border-group@ - A unique set of Availability Zones, Local
--     Zones, or Wavelength Zones from where Amazon Web Services advertises
--     IP addresses.
--
-- -   @network-interface-id@ - [EC2-VPC] The ID of the network interface
--     that the address is associated with, if any.
--
-- -   @network-interface-owner-id@ - The Amazon Web Services account ID of
--     the owner.
--
-- -   @private-ip-address@ - [EC2-VPC] The private IP address associated
--     with the Elastic IP address.
--
-- -   @public-ip@ - The Elastic IP address, or the carrier IP address.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- 'publicIps', 'describeAddresses_publicIps' - One or more Elastic IP addresses.
--
-- Default: Describes all your Elastic IP addresses.
newDescribeAddresses ::
  DescribeAddresses
newDescribeAddresses :: DescribeAddresses
newDescribeAddresses =
  DescribeAddresses'
    { $sel:allocationIds:DescribeAddresses' :: Maybe [Text]
allocationIds = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:DescribeAddresses' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeAddresses' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:publicIps:DescribeAddresses' :: Maybe [Text]
publicIps = forall a. Maybe a
Prelude.Nothing
    }

-- | [EC2-VPC] Information about the allocation IDs.
describeAddresses_allocationIds :: Lens.Lens' DescribeAddresses (Prelude.Maybe [Prelude.Text])
describeAddresses_allocationIds :: Lens' DescribeAddresses (Maybe [Text])
describeAddresses_allocationIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddresses' {Maybe [Text]
allocationIds :: Maybe [Text]
$sel:allocationIds:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
allocationIds} -> Maybe [Text]
allocationIds) (\s :: DescribeAddresses
s@DescribeAddresses' {} Maybe [Text]
a -> DescribeAddresses
s {$sel:allocationIds:DescribeAddresses' :: Maybe [Text]
allocationIds = Maybe [Text]
a} :: DescribeAddresses) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeAddresses_dryRun :: Lens.Lens' DescribeAddresses (Prelude.Maybe Prelude.Bool)
describeAddresses_dryRun :: Lens' DescribeAddresses (Maybe Bool)
describeAddresses_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddresses' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeAddresses' :: DescribeAddresses -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeAddresses
s@DescribeAddresses' {} Maybe Bool
a -> DescribeAddresses
s {$sel:dryRun:DescribeAddresses' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeAddresses)

-- | One or more filters. Filter names and values are case-sensitive.
--
-- -   @allocation-id@ - [EC2-VPC] The allocation ID for the address.
--
-- -   @association-id@ - [EC2-VPC] The association ID for the address.
--
-- -   @domain@ - Indicates whether the address is for use in EC2-Classic
--     (@standard@) or in a VPC (@vpc@).
--
-- -   @instance-id@ - The ID of the instance the address is associated
--     with, if any.
--
-- -   @network-border-group@ - A unique set of Availability Zones, Local
--     Zones, or Wavelength Zones from where Amazon Web Services advertises
--     IP addresses.
--
-- -   @network-interface-id@ - [EC2-VPC] The ID of the network interface
--     that the address is associated with, if any.
--
-- -   @network-interface-owner-id@ - The Amazon Web Services account ID of
--     the owner.
--
-- -   @private-ip-address@ - [EC2-VPC] The private IP address associated
--     with the Elastic IP address.
--
-- -   @public-ip@ - The Elastic IP address, or the carrier IP address.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
describeAddresses_filters :: Lens.Lens' DescribeAddresses (Prelude.Maybe [Filter])
describeAddresses_filters :: Lens' DescribeAddresses (Maybe [Filter])
describeAddresses_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddresses' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeAddresses' :: DescribeAddresses -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeAddresses
s@DescribeAddresses' {} Maybe [Filter]
a -> DescribeAddresses
s {$sel:filters:DescribeAddresses' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeAddresses) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | One or more Elastic IP addresses.
--
-- Default: Describes all your Elastic IP addresses.
describeAddresses_publicIps :: Lens.Lens' DescribeAddresses (Prelude.Maybe [Prelude.Text])
describeAddresses_publicIps :: Lens' DescribeAddresses (Maybe [Text])
describeAddresses_publicIps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddresses' {Maybe [Text]
publicIps :: Maybe [Text]
$sel:publicIps:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
publicIps} -> Maybe [Text]
publicIps) (\s :: DescribeAddresses
s@DescribeAddresses' {} Maybe [Text]
a -> DescribeAddresses
s {$sel:publicIps:DescribeAddresses' :: Maybe [Text]
publicIps = Maybe [Text]
a} :: DescribeAddresses) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest DescribeAddresses where
  type
    AWSResponse DescribeAddresses =
      DescribeAddressesResponse
  request :: (Service -> Service)
-> DescribeAddresses -> Request DescribeAddresses
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeAddresses
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAddresses)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [Address] -> Int -> DescribeAddressesResponse
DescribeAddressesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"addressesSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeAddresses where
  hashWithSalt :: Int -> DescribeAddresses -> Int
hashWithSalt Int
_salt DescribeAddresses' {Maybe Bool
Maybe [Text]
Maybe [Filter]
publicIps :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
allocationIds :: Maybe [Text]
$sel:publicIps:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
$sel:filters:DescribeAddresses' :: DescribeAddresses -> Maybe [Filter]
$sel:dryRun:DescribeAddresses' :: DescribeAddresses -> Maybe Bool
$sel:allocationIds:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
allocationIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
publicIps

instance Prelude.NFData DescribeAddresses where
  rnf :: DescribeAddresses -> ()
rnf DescribeAddresses' {Maybe Bool
Maybe [Text]
Maybe [Filter]
publicIps :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
allocationIds :: Maybe [Text]
$sel:publicIps:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
$sel:filters:DescribeAddresses' :: DescribeAddresses -> Maybe [Filter]
$sel:dryRun:DescribeAddresses' :: DescribeAddresses -> Maybe Bool
$sel:allocationIds:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
allocationIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
publicIps

instance Data.ToHeaders DescribeAddresses where
  toHeaders :: DescribeAddresses -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery DescribeAddresses where
  toQuery :: DescribeAddresses -> QueryString
toQuery DescribeAddresses' {Maybe Bool
Maybe [Text]
Maybe [Filter]
publicIps :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
allocationIds :: Maybe [Text]
$sel:publicIps:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
$sel:filters:DescribeAddresses' :: DescribeAddresses -> Maybe [Filter]
$sel:dryRun:DescribeAddresses' :: DescribeAddresses -> Maybe Bool
$sel:allocationIds:DescribeAddresses' :: DescribeAddresses -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeAddresses" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AllocationId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
allocationIds
          ),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"PublicIp" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
publicIps)
      ]

-- | /See:/ 'newDescribeAddressesResponse' smart constructor.
data DescribeAddressesResponse = DescribeAddressesResponse'
  { -- | Information about the Elastic IP addresses.
    DescribeAddressesResponse -> Maybe [Address]
addresses :: Prelude.Maybe [Address],
    -- | The response's http status code.
    DescribeAddressesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAddressesResponse -> DescribeAddressesResponse -> Bool
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]
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
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.
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' - Information about the Elastic IP addresses.
--
-- 'httpStatus', 'describeAddressesResponse_httpStatus' - The response's http status code.
newDescribeAddressesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAddressesResponse
newDescribeAddressesResponse :: Int -> DescribeAddressesResponse
newDescribeAddressesResponse Int
pHttpStatus_ =
  DescribeAddressesResponse'
    { $sel:addresses:DescribeAddressesResponse' :: Maybe [Address]
addresses =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAddressesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the Elastic IP addresses.
describeAddressesResponse_addresses :: Lens.Lens' DescribeAddressesResponse (Prelude.Maybe [Address])
describeAddressesResponse_addresses :: Lens' DescribeAddressesResponse (Maybe [Address])
describeAddressesResponse_addresses = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeAddressesResponse_httpStatus :: Lens.Lens' DescribeAddressesResponse Prelude.Int
describeAddressesResponse_httpStatus :: Lens' DescribeAddressesResponse Int
describeAddressesResponse_httpStatus = 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 where
  rnf :: DescribeAddressesResponse -> ()
rnf DescribeAddressesResponse' {Int
Maybe [Address]
httpStatus :: Int
addresses :: Maybe [Address]
$sel:httpStatus:DescribeAddressesResponse' :: DescribeAddressesResponse -> Int
$sel:addresses:DescribeAddressesResponse' :: DescribeAddressesResponse -> Maybe [Address]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Address]
addresses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus