{-# 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.Pricing.GetAttributeValues
-- 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 list of attribute values. Attibutes are similar to the details
-- in a Price List API offer file. For a list of available attributes, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs Offer File Definitions>
-- in the
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html Amazon Web Services Billing and Cost Management User Guide>.
--
-- This operation returns paginated results.
module Amazonka.Pricing.GetAttributeValues
  ( -- * Creating a Request
    GetAttributeValues (..),
    newGetAttributeValues,

    -- * Request Lenses
    getAttributeValues_nextToken,
    getAttributeValues_maxResults,
    getAttributeValues_serviceCode,
    getAttributeValues_attributeName,

    -- * Destructuring the Response
    GetAttributeValuesResponse (..),
    newGetAttributeValuesResponse,

    -- * Response Lenses
    getAttributeValuesResponse_attributeValues,
    getAttributeValuesResponse_nextToken,
    getAttributeValuesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetAttributeValues' smart constructor.
data GetAttributeValues = GetAttributeValues'
  { -- | The pagination token that indicates the next set of results that you
    -- want to retrieve.
    GetAttributeValues -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in response.
    GetAttributeValues -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The service code for the service whose attributes you want to retrieve.
    -- For example, if you want the retrieve an EC2 attribute, use @AmazonEC2@.
    GetAttributeValues -> Text
serviceCode :: Prelude.Text,
    -- | The name of the attribute that you want to retrieve the values for, such
    -- as @volumeType@.
    GetAttributeValues -> Text
attributeName :: Prelude.Text
  }
  deriving (GetAttributeValues -> GetAttributeValues -> Bool
(GetAttributeValues -> GetAttributeValues -> Bool)
-> (GetAttributeValues -> GetAttributeValues -> Bool)
-> Eq GetAttributeValues
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAttributeValues -> GetAttributeValues -> Bool
$c/= :: GetAttributeValues -> GetAttributeValues -> Bool
== :: GetAttributeValues -> GetAttributeValues -> Bool
$c== :: GetAttributeValues -> GetAttributeValues -> Bool
Prelude.Eq, ReadPrec [GetAttributeValues]
ReadPrec GetAttributeValues
Int -> ReadS GetAttributeValues
ReadS [GetAttributeValues]
(Int -> ReadS GetAttributeValues)
-> ReadS [GetAttributeValues]
-> ReadPrec GetAttributeValues
-> ReadPrec [GetAttributeValues]
-> Read GetAttributeValues
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAttributeValues]
$creadListPrec :: ReadPrec [GetAttributeValues]
readPrec :: ReadPrec GetAttributeValues
$creadPrec :: ReadPrec GetAttributeValues
readList :: ReadS [GetAttributeValues]
$creadList :: ReadS [GetAttributeValues]
readsPrec :: Int -> ReadS GetAttributeValues
$creadsPrec :: Int -> ReadS GetAttributeValues
Prelude.Read, Int -> GetAttributeValues -> ShowS
[GetAttributeValues] -> ShowS
GetAttributeValues -> String
(Int -> GetAttributeValues -> ShowS)
-> (GetAttributeValues -> String)
-> ([GetAttributeValues] -> ShowS)
-> Show GetAttributeValues
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAttributeValues] -> ShowS
$cshowList :: [GetAttributeValues] -> ShowS
show :: GetAttributeValues -> String
$cshow :: GetAttributeValues -> String
showsPrec :: Int -> GetAttributeValues -> ShowS
$cshowsPrec :: Int -> GetAttributeValues -> ShowS
Prelude.Show, (forall x. GetAttributeValues -> Rep GetAttributeValues x)
-> (forall x. Rep GetAttributeValues x -> GetAttributeValues)
-> Generic GetAttributeValues
forall x. Rep GetAttributeValues x -> GetAttributeValues
forall x. GetAttributeValues -> Rep GetAttributeValues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAttributeValues x -> GetAttributeValues
$cfrom :: forall x. GetAttributeValues -> Rep GetAttributeValues x
Prelude.Generic)

-- |
-- Create a value of 'GetAttributeValues' 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', 'getAttributeValues_nextToken' - The pagination token that indicates the next set of results that you
-- want to retrieve.
--
-- 'maxResults', 'getAttributeValues_maxResults' - The maximum number of results to return in response.
--
-- 'serviceCode', 'getAttributeValues_serviceCode' - The service code for the service whose attributes you want to retrieve.
-- For example, if you want the retrieve an EC2 attribute, use @AmazonEC2@.
--
-- 'attributeName', 'getAttributeValues_attributeName' - The name of the attribute that you want to retrieve the values for, such
-- as @volumeType@.
newGetAttributeValues ::
  -- | 'serviceCode'
  Prelude.Text ->
  -- | 'attributeName'
  Prelude.Text ->
  GetAttributeValues
newGetAttributeValues :: Text -> Text -> GetAttributeValues
newGetAttributeValues Text
pServiceCode_ Text
pAttributeName_ =
  GetAttributeValues' :: Maybe Text -> Maybe Natural -> Text -> Text -> GetAttributeValues
GetAttributeValues'
    { $sel:nextToken:GetAttributeValues' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetAttributeValues' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceCode:GetAttributeValues' :: Text
serviceCode = Text
pServiceCode_,
      $sel:attributeName:GetAttributeValues' :: Text
attributeName = Text
pAttributeName_
    }

-- | The pagination token that indicates the next set of results that you
-- want to retrieve.
getAttributeValues_nextToken :: Lens.Lens' GetAttributeValues (Prelude.Maybe Prelude.Text)
getAttributeValues_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAttributeValues -> f GetAttributeValues
getAttributeValues_nextToken = (GetAttributeValues -> Maybe Text)
-> (GetAttributeValues -> Maybe Text -> GetAttributeValues)
-> Lens
     GetAttributeValues GetAttributeValues (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttributeValues' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAttributeValues' :: GetAttributeValues -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAttributeValues
s@GetAttributeValues' {} Maybe Text
a -> GetAttributeValues
s {$sel:nextToken:GetAttributeValues' :: Maybe Text
nextToken = Maybe Text
a} :: GetAttributeValues)

-- | The maximum number of results to return in response.
getAttributeValues_maxResults :: Lens.Lens' GetAttributeValues (Prelude.Maybe Prelude.Natural)
getAttributeValues_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetAttributeValues -> f GetAttributeValues
getAttributeValues_maxResults = (GetAttributeValues -> Maybe Natural)
-> (GetAttributeValues -> Maybe Natural -> GetAttributeValues)
-> Lens
     GetAttributeValues
     GetAttributeValues
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttributeValues' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetAttributeValues' :: GetAttributeValues -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetAttributeValues
s@GetAttributeValues' {} Maybe Natural
a -> GetAttributeValues
s {$sel:maxResults:GetAttributeValues' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetAttributeValues)

-- | The service code for the service whose attributes you want to retrieve.
-- For example, if you want the retrieve an EC2 attribute, use @AmazonEC2@.
getAttributeValues_serviceCode :: Lens.Lens' GetAttributeValues Prelude.Text
getAttributeValues_serviceCode :: (Text -> f Text) -> GetAttributeValues -> f GetAttributeValues
getAttributeValues_serviceCode = (GetAttributeValues -> Text)
-> (GetAttributeValues -> Text -> GetAttributeValues)
-> Lens GetAttributeValues GetAttributeValues Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttributeValues' {Text
serviceCode :: Text
$sel:serviceCode:GetAttributeValues' :: GetAttributeValues -> Text
serviceCode} -> Text
serviceCode) (\s :: GetAttributeValues
s@GetAttributeValues' {} Text
a -> GetAttributeValues
s {$sel:serviceCode:GetAttributeValues' :: Text
serviceCode = Text
a} :: GetAttributeValues)

-- | The name of the attribute that you want to retrieve the values for, such
-- as @volumeType@.
getAttributeValues_attributeName :: Lens.Lens' GetAttributeValues Prelude.Text
getAttributeValues_attributeName :: (Text -> f Text) -> GetAttributeValues -> f GetAttributeValues
getAttributeValues_attributeName = (GetAttributeValues -> Text)
-> (GetAttributeValues -> Text -> GetAttributeValues)
-> Lens GetAttributeValues GetAttributeValues Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttributeValues' {Text
attributeName :: Text
$sel:attributeName:GetAttributeValues' :: GetAttributeValues -> Text
attributeName} -> Text
attributeName) (\s :: GetAttributeValues
s@GetAttributeValues' {} Text
a -> GetAttributeValues
s {$sel:attributeName:GetAttributeValues' :: Text
attributeName = Text
a} :: GetAttributeValues)

instance Core.AWSPager GetAttributeValues where
  page :: GetAttributeValues
-> AWSResponse GetAttributeValues -> Maybe GetAttributeValues
page GetAttributeValues
rq AWSResponse GetAttributeValues
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAttributeValues
GetAttributeValuesResponse
rs
            GetAttributeValuesResponse
-> Getting (First Text) GetAttributeValuesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAttributeValuesResponse
-> Const (First Text) GetAttributeValuesResponse
Lens' GetAttributeValuesResponse (Maybe Text)
getAttributeValuesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAttributeValuesResponse
 -> Const (First Text) GetAttributeValuesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAttributeValuesResponse 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 GetAttributeValues
forall a. Maybe a
Prelude.Nothing
    | Maybe [AttributeValue] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAttributeValues
GetAttributeValuesResponse
rs
            GetAttributeValuesResponse
-> Getting
     (First [AttributeValue])
     GetAttributeValuesResponse
     [AttributeValue]
-> Maybe [AttributeValue]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AttributeValue]
 -> Const (First [AttributeValue]) (Maybe [AttributeValue]))
-> GetAttributeValuesResponse
-> Const (First [AttributeValue]) GetAttributeValuesResponse
Lens' GetAttributeValuesResponse (Maybe [AttributeValue])
getAttributeValuesResponse_attributeValues
              ((Maybe [AttributeValue]
  -> Const (First [AttributeValue]) (Maybe [AttributeValue]))
 -> GetAttributeValuesResponse
 -> Const (First [AttributeValue]) GetAttributeValuesResponse)
-> (([AttributeValue]
     -> Const (First [AttributeValue]) [AttributeValue])
    -> Maybe [AttributeValue]
    -> Const (First [AttributeValue]) (Maybe [AttributeValue]))
-> Getting
     (First [AttributeValue])
     GetAttributeValuesResponse
     [AttributeValue]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AttributeValue]
 -> Const (First [AttributeValue]) [AttributeValue])
-> Maybe [AttributeValue]
-> Const (First [AttributeValue]) (Maybe [AttributeValue])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetAttributeValues
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetAttributeValues -> Maybe GetAttributeValues
forall a. a -> Maybe a
Prelude.Just (GetAttributeValues -> Maybe GetAttributeValues)
-> GetAttributeValues -> Maybe GetAttributeValues
forall a b. (a -> b) -> a -> b
Prelude.$
        GetAttributeValues
rq
          GetAttributeValues
-> (GetAttributeValues -> GetAttributeValues) -> GetAttributeValues
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetAttributeValues -> Identity GetAttributeValues
Lens
  GetAttributeValues GetAttributeValues (Maybe Text) (Maybe Text)
getAttributeValues_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetAttributeValues -> Identity GetAttributeValues)
-> Maybe Text -> GetAttributeValues -> GetAttributeValues
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetAttributeValues
GetAttributeValuesResponse
rs
          GetAttributeValuesResponse
-> Getting (First Text) GetAttributeValuesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAttributeValuesResponse
-> Const (First Text) GetAttributeValuesResponse
Lens' GetAttributeValuesResponse (Maybe Text)
getAttributeValuesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAttributeValuesResponse
 -> Const (First Text) GetAttributeValuesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAttributeValuesResponse 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 GetAttributeValues where
  type
    AWSResponse GetAttributeValues =
      GetAttributeValuesResponse
  request :: GetAttributeValues -> Request GetAttributeValues
request = Service -> GetAttributeValues -> Request GetAttributeValues
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAttributeValues
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAttributeValues)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAttributeValues))
-> Logger
-> Service
-> Proxy GetAttributeValues
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAttributeValues)))
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 [AttributeValue]
-> Maybe Text -> Int -> GetAttributeValuesResponse
GetAttributeValuesResponse'
            (Maybe [AttributeValue]
 -> Maybe Text -> Int -> GetAttributeValuesResponse)
-> Either String (Maybe [AttributeValue])
-> Either String (Maybe Text -> Int -> GetAttributeValuesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [AttributeValue]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AttributeValues"
                            Either String (Maybe (Maybe [AttributeValue]))
-> Maybe [AttributeValue] -> Either String (Maybe [AttributeValue])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AttributeValue]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> GetAttributeValuesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetAttributeValuesResponse)
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 -> GetAttributeValuesResponse)
-> Either String Int -> Either String GetAttributeValuesResponse
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 GetAttributeValues

instance Prelude.NFData GetAttributeValues

instance Core.ToHeaders GetAttributeValues where
  toHeaders :: GetAttributeValues -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAttributeValues -> 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
"AWSPriceListService.GetAttributeValues" ::
                          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 GetAttributeValues where
  toJSON :: GetAttributeValues -> Value
toJSON GetAttributeValues' {Maybe Natural
Maybe Text
Text
attributeName :: Text
serviceCode :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:attributeName:GetAttributeValues' :: GetAttributeValues -> Text
$sel:serviceCode:GetAttributeValues' :: GetAttributeValues -> Text
$sel:maxResults:GetAttributeValues' :: GetAttributeValues -> Maybe Natural
$sel:nextToken:GetAttributeValues' :: GetAttributeValues -> 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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServiceCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceCode),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AttributeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
attributeName)
          ]
      )

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

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

-- | /See:/ 'newGetAttributeValuesResponse' smart constructor.
data GetAttributeValuesResponse = GetAttributeValuesResponse'
  { -- | The list of values for an attribute. For example,
    -- @Throughput Optimized HDD@ and @Provisioned IOPS@ are two available
    -- values for the @AmazonEC2@ @volumeType@.
    GetAttributeValuesResponse -> Maybe [AttributeValue]
attributeValues :: Prelude.Maybe [AttributeValue],
    -- | The pagination token that indicates the next set of results to retrieve.
    GetAttributeValuesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetAttributeValuesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAttributeValuesResponse -> GetAttributeValuesResponse -> Bool
(GetAttributeValuesResponse -> GetAttributeValuesResponse -> Bool)
-> (GetAttributeValuesResponse
    -> GetAttributeValuesResponse -> Bool)
-> Eq GetAttributeValuesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAttributeValuesResponse -> GetAttributeValuesResponse -> Bool
$c/= :: GetAttributeValuesResponse -> GetAttributeValuesResponse -> Bool
== :: GetAttributeValuesResponse -> GetAttributeValuesResponse -> Bool
$c== :: GetAttributeValuesResponse -> GetAttributeValuesResponse -> Bool
Prelude.Eq, ReadPrec [GetAttributeValuesResponse]
ReadPrec GetAttributeValuesResponse
Int -> ReadS GetAttributeValuesResponse
ReadS [GetAttributeValuesResponse]
(Int -> ReadS GetAttributeValuesResponse)
-> ReadS [GetAttributeValuesResponse]
-> ReadPrec GetAttributeValuesResponse
-> ReadPrec [GetAttributeValuesResponse]
-> Read GetAttributeValuesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAttributeValuesResponse]
$creadListPrec :: ReadPrec [GetAttributeValuesResponse]
readPrec :: ReadPrec GetAttributeValuesResponse
$creadPrec :: ReadPrec GetAttributeValuesResponse
readList :: ReadS [GetAttributeValuesResponse]
$creadList :: ReadS [GetAttributeValuesResponse]
readsPrec :: Int -> ReadS GetAttributeValuesResponse
$creadsPrec :: Int -> ReadS GetAttributeValuesResponse
Prelude.Read, Int -> GetAttributeValuesResponse -> ShowS
[GetAttributeValuesResponse] -> ShowS
GetAttributeValuesResponse -> String
(Int -> GetAttributeValuesResponse -> ShowS)
-> (GetAttributeValuesResponse -> String)
-> ([GetAttributeValuesResponse] -> ShowS)
-> Show GetAttributeValuesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAttributeValuesResponse] -> ShowS
$cshowList :: [GetAttributeValuesResponse] -> ShowS
show :: GetAttributeValuesResponse -> String
$cshow :: GetAttributeValuesResponse -> String
showsPrec :: Int -> GetAttributeValuesResponse -> ShowS
$cshowsPrec :: Int -> GetAttributeValuesResponse -> ShowS
Prelude.Show, (forall x.
 GetAttributeValuesResponse -> Rep GetAttributeValuesResponse x)
-> (forall x.
    Rep GetAttributeValuesResponse x -> GetAttributeValuesResponse)
-> Generic GetAttributeValuesResponse
forall x.
Rep GetAttributeValuesResponse x -> GetAttributeValuesResponse
forall x.
GetAttributeValuesResponse -> Rep GetAttributeValuesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAttributeValuesResponse x -> GetAttributeValuesResponse
$cfrom :: forall x.
GetAttributeValuesResponse -> Rep GetAttributeValuesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAttributeValuesResponse' 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:
--
-- 'attributeValues', 'getAttributeValuesResponse_attributeValues' - The list of values for an attribute. For example,
-- @Throughput Optimized HDD@ and @Provisioned IOPS@ are two available
-- values for the @AmazonEC2@ @volumeType@.
--
-- 'nextToken', 'getAttributeValuesResponse_nextToken' - The pagination token that indicates the next set of results to retrieve.
--
-- 'httpStatus', 'getAttributeValuesResponse_httpStatus' - The response's http status code.
newGetAttributeValuesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAttributeValuesResponse
newGetAttributeValuesResponse :: Int -> GetAttributeValuesResponse
newGetAttributeValuesResponse Int
pHttpStatus_ =
  GetAttributeValuesResponse' :: Maybe [AttributeValue]
-> Maybe Text -> Int -> GetAttributeValuesResponse
GetAttributeValuesResponse'
    { $sel:attributeValues:GetAttributeValuesResponse' :: Maybe [AttributeValue]
attributeValues =
        Maybe [AttributeValue]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetAttributeValuesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAttributeValuesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of values for an attribute. For example,
-- @Throughput Optimized HDD@ and @Provisioned IOPS@ are two available
-- values for the @AmazonEC2@ @volumeType@.
getAttributeValuesResponse_attributeValues :: Lens.Lens' GetAttributeValuesResponse (Prelude.Maybe [AttributeValue])
getAttributeValuesResponse_attributeValues :: (Maybe [AttributeValue] -> f (Maybe [AttributeValue]))
-> GetAttributeValuesResponse -> f GetAttributeValuesResponse
getAttributeValuesResponse_attributeValues = (GetAttributeValuesResponse -> Maybe [AttributeValue])
-> (GetAttributeValuesResponse
    -> Maybe [AttributeValue] -> GetAttributeValuesResponse)
-> Lens' GetAttributeValuesResponse (Maybe [AttributeValue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttributeValuesResponse' {Maybe [AttributeValue]
attributeValues :: Maybe [AttributeValue]
$sel:attributeValues:GetAttributeValuesResponse' :: GetAttributeValuesResponse -> Maybe [AttributeValue]
attributeValues} -> Maybe [AttributeValue]
attributeValues) (\s :: GetAttributeValuesResponse
s@GetAttributeValuesResponse' {} Maybe [AttributeValue]
a -> GetAttributeValuesResponse
s {$sel:attributeValues:GetAttributeValuesResponse' :: Maybe [AttributeValue]
attributeValues = Maybe [AttributeValue]
a} :: GetAttributeValuesResponse) ((Maybe [AttributeValue] -> f (Maybe [AttributeValue]))
 -> GetAttributeValuesResponse -> f GetAttributeValuesResponse)
-> ((Maybe [AttributeValue] -> f (Maybe [AttributeValue]))
    -> Maybe [AttributeValue] -> f (Maybe [AttributeValue]))
-> (Maybe [AttributeValue] -> f (Maybe [AttributeValue]))
-> GetAttributeValuesResponse
-> f GetAttributeValuesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttributeValue] [AttributeValue] [AttributeValue] [AttributeValue]
-> Iso
     (Maybe [AttributeValue])
     (Maybe [AttributeValue])
     (Maybe [AttributeValue])
     (Maybe [AttributeValue])
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
  [AttributeValue] [AttributeValue] [AttributeValue] [AttributeValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token that indicates the next set of results to retrieve.
getAttributeValuesResponse_nextToken :: Lens.Lens' GetAttributeValuesResponse (Prelude.Maybe Prelude.Text)
getAttributeValuesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAttributeValuesResponse -> f GetAttributeValuesResponse
getAttributeValuesResponse_nextToken = (GetAttributeValuesResponse -> Maybe Text)
-> (GetAttributeValuesResponse
    -> Maybe Text -> GetAttributeValuesResponse)
-> Lens' GetAttributeValuesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttributeValuesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAttributeValuesResponse' :: GetAttributeValuesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAttributeValuesResponse
s@GetAttributeValuesResponse' {} Maybe Text
a -> GetAttributeValuesResponse
s {$sel:nextToken:GetAttributeValuesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetAttributeValuesResponse)

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

instance Prelude.NFData GetAttributeValuesResponse