{-# 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.GetCoipPoolUsage
-- 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 allocations from the specified customer-owned address
-- pool.
module Amazonka.EC2.GetCoipPoolUsage
  ( -- * Creating a Request
    GetCoipPoolUsage (..),
    newGetCoipPoolUsage,

    -- * Request Lenses
    getCoipPoolUsage_dryRun,
    getCoipPoolUsage_filters,
    getCoipPoolUsage_maxResults,
    getCoipPoolUsage_nextToken,
    getCoipPoolUsage_poolId,

    -- * Destructuring the Response
    GetCoipPoolUsageResponse (..),
    newGetCoipPoolUsageResponse,

    -- * Response Lenses
    getCoipPoolUsageResponse_coipAddressUsages,
    getCoipPoolUsageResponse_coipPoolId,
    getCoipPoolUsageResponse_localGatewayRouteTableId,
    getCoipPoolUsageResponse_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:/ 'newGetCoipPoolUsage' smart constructor.
data GetCoipPoolUsage = GetCoipPoolUsage'
  { -- | 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@.
    GetCoipPoolUsage -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @coip-address-usage.allocation-id@ - The allocation ID of the
    --     address.
    --
    -- -   @coip-address-usage.aws-account-id@ - The ID of the Amazon Web
    --     Services account that is using the customer-owned IP address.
    --
    -- -   @coip-address-usage.aws-service@ - The Amazon Web Services service
    --     that is using the customer-owned IP address.
    --
    -- -   @coip-address-usage.co-ip@ - The customer-owned IP address.
    GetCoipPoolUsage -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    GetCoipPoolUsage -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetCoipPoolUsage -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the address pool.
    GetCoipPoolUsage -> Text
poolId :: Prelude.Text
  }
  deriving (GetCoipPoolUsage -> GetCoipPoolUsage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCoipPoolUsage -> GetCoipPoolUsage -> Bool
$c/= :: GetCoipPoolUsage -> GetCoipPoolUsage -> Bool
== :: GetCoipPoolUsage -> GetCoipPoolUsage -> Bool
$c== :: GetCoipPoolUsage -> GetCoipPoolUsage -> Bool
Prelude.Eq, ReadPrec [GetCoipPoolUsage]
ReadPrec GetCoipPoolUsage
Int -> ReadS GetCoipPoolUsage
ReadS [GetCoipPoolUsage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCoipPoolUsage]
$creadListPrec :: ReadPrec [GetCoipPoolUsage]
readPrec :: ReadPrec GetCoipPoolUsage
$creadPrec :: ReadPrec GetCoipPoolUsage
readList :: ReadS [GetCoipPoolUsage]
$creadList :: ReadS [GetCoipPoolUsage]
readsPrec :: Int -> ReadS GetCoipPoolUsage
$creadsPrec :: Int -> ReadS GetCoipPoolUsage
Prelude.Read, Int -> GetCoipPoolUsage -> ShowS
[GetCoipPoolUsage] -> ShowS
GetCoipPoolUsage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCoipPoolUsage] -> ShowS
$cshowList :: [GetCoipPoolUsage] -> ShowS
show :: GetCoipPoolUsage -> String
$cshow :: GetCoipPoolUsage -> String
showsPrec :: Int -> GetCoipPoolUsage -> ShowS
$cshowsPrec :: Int -> GetCoipPoolUsage -> ShowS
Prelude.Show, forall x. Rep GetCoipPoolUsage x -> GetCoipPoolUsage
forall x. GetCoipPoolUsage -> Rep GetCoipPoolUsage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCoipPoolUsage x -> GetCoipPoolUsage
$cfrom :: forall x. GetCoipPoolUsage -> Rep GetCoipPoolUsage x
Prelude.Generic)

-- |
-- Create a value of 'GetCoipPoolUsage' 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:
--
-- 'dryRun', 'getCoipPoolUsage_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', 'getCoipPoolUsage_filters' - One or more filters.
--
-- -   @coip-address-usage.allocation-id@ - The allocation ID of the
--     address.
--
-- -   @coip-address-usage.aws-account-id@ - The ID of the Amazon Web
--     Services account that is using the customer-owned IP address.
--
-- -   @coip-address-usage.aws-service@ - The Amazon Web Services service
--     that is using the customer-owned IP address.
--
-- -   @coip-address-usage.co-ip@ - The customer-owned IP address.
--
-- 'maxResults', 'getCoipPoolUsage_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- 'nextToken', 'getCoipPoolUsage_nextToken' - The token for the next page of results.
--
-- 'poolId', 'getCoipPoolUsage_poolId' - The ID of the address pool.
newGetCoipPoolUsage ::
  -- | 'poolId'
  Prelude.Text ->
  GetCoipPoolUsage
newGetCoipPoolUsage :: Text -> GetCoipPoolUsage
newGetCoipPoolUsage Text
pPoolId_ =
  GetCoipPoolUsage'
    { $sel:dryRun:GetCoipPoolUsage' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:GetCoipPoolUsage' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetCoipPoolUsage' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetCoipPoolUsage' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:poolId:GetCoipPoolUsage' :: Text
poolId = Text
pPoolId_
    }

-- | 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@.
getCoipPoolUsage_dryRun :: Lens.Lens' GetCoipPoolUsage (Prelude.Maybe Prelude.Bool)
getCoipPoolUsage_dryRun :: Lens' GetCoipPoolUsage (Maybe Bool)
getCoipPoolUsage_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsage' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: GetCoipPoolUsage
s@GetCoipPoolUsage' {} Maybe Bool
a -> GetCoipPoolUsage
s {$sel:dryRun:GetCoipPoolUsage' :: Maybe Bool
dryRun = Maybe Bool
a} :: GetCoipPoolUsage)

-- | One or more filters.
--
-- -   @coip-address-usage.allocation-id@ - The allocation ID of the
--     address.
--
-- -   @coip-address-usage.aws-account-id@ - The ID of the Amazon Web
--     Services account that is using the customer-owned IP address.
--
-- -   @coip-address-usage.aws-service@ - The Amazon Web Services service
--     that is using the customer-owned IP address.
--
-- -   @coip-address-usage.co-ip@ - The customer-owned IP address.
getCoipPoolUsage_filters :: Lens.Lens' GetCoipPoolUsage (Prelude.Maybe [Filter])
getCoipPoolUsage_filters :: Lens' GetCoipPoolUsage (Maybe [Filter])
getCoipPoolUsage_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsage' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: GetCoipPoolUsage
s@GetCoipPoolUsage' {} Maybe [Filter]
a -> GetCoipPoolUsage
s {$sel:filters:GetCoipPoolUsage' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: GetCoipPoolUsage) 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 maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
getCoipPoolUsage_maxResults :: Lens.Lens' GetCoipPoolUsage (Prelude.Maybe Prelude.Natural)
getCoipPoolUsage_maxResults :: Lens' GetCoipPoolUsage (Maybe Natural)
getCoipPoolUsage_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsage' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetCoipPoolUsage
s@GetCoipPoolUsage' {} Maybe Natural
a -> GetCoipPoolUsage
s {$sel:maxResults:GetCoipPoolUsage' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetCoipPoolUsage)

-- | The token for the next page of results.
getCoipPoolUsage_nextToken :: Lens.Lens' GetCoipPoolUsage (Prelude.Maybe Prelude.Text)
getCoipPoolUsage_nextToken :: Lens' GetCoipPoolUsage (Maybe Text)
getCoipPoolUsage_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsage' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCoipPoolUsage
s@GetCoipPoolUsage' {} Maybe Text
a -> GetCoipPoolUsage
s {$sel:nextToken:GetCoipPoolUsage' :: Maybe Text
nextToken = Maybe Text
a} :: GetCoipPoolUsage)

-- | The ID of the address pool.
getCoipPoolUsage_poolId :: Lens.Lens' GetCoipPoolUsage Prelude.Text
getCoipPoolUsage_poolId :: Lens' GetCoipPoolUsage Text
getCoipPoolUsage_poolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsage' {Text
poolId :: Text
$sel:poolId:GetCoipPoolUsage' :: GetCoipPoolUsage -> Text
poolId} -> Text
poolId) (\s :: GetCoipPoolUsage
s@GetCoipPoolUsage' {} Text
a -> GetCoipPoolUsage
s {$sel:poolId:GetCoipPoolUsage' :: Text
poolId = Text
a} :: GetCoipPoolUsage)

instance Core.AWSRequest GetCoipPoolUsage where
  type
    AWSResponse GetCoipPoolUsage =
      GetCoipPoolUsageResponse
  request :: (Service -> Service)
-> GetCoipPoolUsage -> Request GetCoipPoolUsage
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 GetCoipPoolUsage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetCoipPoolUsage)))
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 [CoipAddressUsage]
-> Maybe Text -> Maybe Text -> Int -> GetCoipPoolUsageResponse
GetCoipPoolUsageResponse'
            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
"coipAddressUsageSet"
                            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.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"coipPoolId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"localGatewayRouteTableId")
            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 GetCoipPoolUsage where
  hashWithSalt :: Int -> GetCoipPoolUsage -> Int
hashWithSalt Int
_salt GetCoipPoolUsage' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
poolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:poolId:GetCoipPoolUsage' :: GetCoipPoolUsage -> Text
$sel:nextToken:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Text
$sel:maxResults:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Natural
$sel:filters:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe [Filter]
$sel:dryRun:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Bool
..} =
    Int
_salt
      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 Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
poolId

instance Prelude.NFData GetCoipPoolUsage where
  rnf :: GetCoipPoolUsage -> ()
rnf GetCoipPoolUsage' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
poolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:poolId:GetCoipPoolUsage' :: GetCoipPoolUsage -> Text
$sel:nextToken:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Text
$sel:maxResults:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Natural
$sel:filters:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe [Filter]
$sel:dryRun:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Bool
..} =
    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 Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
poolId

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

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

instance Data.ToQuery GetCoipPoolUsage where
  toQuery :: GetCoipPoolUsage -> QueryString
toQuery GetCoipPoolUsage' {Maybe Bool
Maybe Natural
Maybe [Filter]
Maybe Text
Text
poolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:poolId:GetCoipPoolUsage' :: GetCoipPoolUsage -> Text
$sel:nextToken:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Text
$sel:maxResults:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Natural
$sel:filters:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe [Filter]
$sel:dryRun:GetCoipPoolUsage' :: GetCoipPoolUsage -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"GetCoipPoolUsage" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        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),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"PoolId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
poolId
      ]

-- | /See:/ 'newGetCoipPoolUsageResponse' smart constructor.
data GetCoipPoolUsageResponse = GetCoipPoolUsageResponse'
  { -- | Information about the address usage.
    GetCoipPoolUsageResponse -> Maybe [CoipAddressUsage]
coipAddressUsages :: Prelude.Maybe [CoipAddressUsage],
    -- | The ID of the customer-owned address pool.
    GetCoipPoolUsageResponse -> Maybe Text
coipPoolId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the local gateway route table.
    GetCoipPoolUsageResponse -> Maybe Text
localGatewayRouteTableId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetCoipPoolUsageResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCoipPoolUsageResponse -> GetCoipPoolUsageResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCoipPoolUsageResponse -> GetCoipPoolUsageResponse -> Bool
$c/= :: GetCoipPoolUsageResponse -> GetCoipPoolUsageResponse -> Bool
== :: GetCoipPoolUsageResponse -> GetCoipPoolUsageResponse -> Bool
$c== :: GetCoipPoolUsageResponse -> GetCoipPoolUsageResponse -> Bool
Prelude.Eq, ReadPrec [GetCoipPoolUsageResponse]
ReadPrec GetCoipPoolUsageResponse
Int -> ReadS GetCoipPoolUsageResponse
ReadS [GetCoipPoolUsageResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCoipPoolUsageResponse]
$creadListPrec :: ReadPrec [GetCoipPoolUsageResponse]
readPrec :: ReadPrec GetCoipPoolUsageResponse
$creadPrec :: ReadPrec GetCoipPoolUsageResponse
readList :: ReadS [GetCoipPoolUsageResponse]
$creadList :: ReadS [GetCoipPoolUsageResponse]
readsPrec :: Int -> ReadS GetCoipPoolUsageResponse
$creadsPrec :: Int -> ReadS GetCoipPoolUsageResponse
Prelude.Read, Int -> GetCoipPoolUsageResponse -> ShowS
[GetCoipPoolUsageResponse] -> ShowS
GetCoipPoolUsageResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCoipPoolUsageResponse] -> ShowS
$cshowList :: [GetCoipPoolUsageResponse] -> ShowS
show :: GetCoipPoolUsageResponse -> String
$cshow :: GetCoipPoolUsageResponse -> String
showsPrec :: Int -> GetCoipPoolUsageResponse -> ShowS
$cshowsPrec :: Int -> GetCoipPoolUsageResponse -> ShowS
Prelude.Show, forall x.
Rep GetCoipPoolUsageResponse x -> GetCoipPoolUsageResponse
forall x.
GetCoipPoolUsageResponse -> Rep GetCoipPoolUsageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCoipPoolUsageResponse x -> GetCoipPoolUsageResponse
$cfrom :: forall x.
GetCoipPoolUsageResponse -> Rep GetCoipPoolUsageResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCoipPoolUsageResponse' 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:
--
-- 'coipAddressUsages', 'getCoipPoolUsageResponse_coipAddressUsages' - Information about the address usage.
--
-- 'coipPoolId', 'getCoipPoolUsageResponse_coipPoolId' - The ID of the customer-owned address pool.
--
-- 'localGatewayRouteTableId', 'getCoipPoolUsageResponse_localGatewayRouteTableId' - The ID of the local gateway route table.
--
-- 'httpStatus', 'getCoipPoolUsageResponse_httpStatus' - The response's http status code.
newGetCoipPoolUsageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCoipPoolUsageResponse
newGetCoipPoolUsageResponse :: Int -> GetCoipPoolUsageResponse
newGetCoipPoolUsageResponse Int
pHttpStatus_ =
  GetCoipPoolUsageResponse'
    { $sel:coipAddressUsages:GetCoipPoolUsageResponse' :: Maybe [CoipAddressUsage]
coipAddressUsages =
        forall a. Maybe a
Prelude.Nothing,
      $sel:coipPoolId:GetCoipPoolUsageResponse' :: Maybe Text
coipPoolId = forall a. Maybe a
Prelude.Nothing,
      $sel:localGatewayRouteTableId:GetCoipPoolUsageResponse' :: Maybe Text
localGatewayRouteTableId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCoipPoolUsageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the address usage.
getCoipPoolUsageResponse_coipAddressUsages :: Lens.Lens' GetCoipPoolUsageResponse (Prelude.Maybe [CoipAddressUsage])
getCoipPoolUsageResponse_coipAddressUsages :: Lens' GetCoipPoolUsageResponse (Maybe [CoipAddressUsage])
getCoipPoolUsageResponse_coipAddressUsages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsageResponse' {Maybe [CoipAddressUsage]
coipAddressUsages :: Maybe [CoipAddressUsage]
$sel:coipAddressUsages:GetCoipPoolUsageResponse' :: GetCoipPoolUsageResponse -> Maybe [CoipAddressUsage]
coipAddressUsages} -> Maybe [CoipAddressUsage]
coipAddressUsages) (\s :: GetCoipPoolUsageResponse
s@GetCoipPoolUsageResponse' {} Maybe [CoipAddressUsage]
a -> GetCoipPoolUsageResponse
s {$sel:coipAddressUsages:GetCoipPoolUsageResponse' :: Maybe [CoipAddressUsage]
coipAddressUsages = Maybe [CoipAddressUsage]
a} :: GetCoipPoolUsageResponse) 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 ID of the customer-owned address pool.
getCoipPoolUsageResponse_coipPoolId :: Lens.Lens' GetCoipPoolUsageResponse (Prelude.Maybe Prelude.Text)
getCoipPoolUsageResponse_coipPoolId :: Lens' GetCoipPoolUsageResponse (Maybe Text)
getCoipPoolUsageResponse_coipPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsageResponse' {Maybe Text
coipPoolId :: Maybe Text
$sel:coipPoolId:GetCoipPoolUsageResponse' :: GetCoipPoolUsageResponse -> Maybe Text
coipPoolId} -> Maybe Text
coipPoolId) (\s :: GetCoipPoolUsageResponse
s@GetCoipPoolUsageResponse' {} Maybe Text
a -> GetCoipPoolUsageResponse
s {$sel:coipPoolId:GetCoipPoolUsageResponse' :: Maybe Text
coipPoolId = Maybe Text
a} :: GetCoipPoolUsageResponse)

-- | The ID of the local gateway route table.
getCoipPoolUsageResponse_localGatewayRouteTableId :: Lens.Lens' GetCoipPoolUsageResponse (Prelude.Maybe Prelude.Text)
getCoipPoolUsageResponse_localGatewayRouteTableId :: Lens' GetCoipPoolUsageResponse (Maybe Text)
getCoipPoolUsageResponse_localGatewayRouteTableId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCoipPoolUsageResponse' {Maybe Text
localGatewayRouteTableId :: Maybe Text
$sel:localGatewayRouteTableId:GetCoipPoolUsageResponse' :: GetCoipPoolUsageResponse -> Maybe Text
localGatewayRouteTableId} -> Maybe Text
localGatewayRouteTableId) (\s :: GetCoipPoolUsageResponse
s@GetCoipPoolUsageResponse' {} Maybe Text
a -> GetCoipPoolUsageResponse
s {$sel:localGatewayRouteTableId:GetCoipPoolUsageResponse' :: Maybe Text
localGatewayRouteTableId = Maybe Text
a} :: GetCoipPoolUsageResponse)

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

instance Prelude.NFData GetCoipPoolUsageResponse where
  rnf :: GetCoipPoolUsageResponse -> ()
rnf GetCoipPoolUsageResponse' {Int
Maybe [CoipAddressUsage]
Maybe Text
httpStatus :: Int
localGatewayRouteTableId :: Maybe Text
coipPoolId :: Maybe Text
coipAddressUsages :: Maybe [CoipAddressUsage]
$sel:httpStatus:GetCoipPoolUsageResponse' :: GetCoipPoolUsageResponse -> Int
$sel:localGatewayRouteTableId:GetCoipPoolUsageResponse' :: GetCoipPoolUsageResponse -> Maybe Text
$sel:coipPoolId:GetCoipPoolUsageResponse' :: GetCoipPoolUsageResponse -> Maybe Text
$sel:coipAddressUsages:GetCoipPoolUsageResponse' :: GetCoipPoolUsageResponse -> Maybe [CoipAddressUsage]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CoipAddressUsage]
coipAddressUsages
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
coipPoolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localGatewayRouteTableId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus