{-# 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.ECS.ListAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the attributes for Amazon ECS resources within a specified target
-- type and cluster. When you specify a target type and cluster,
-- @ListAttributes@ returns a list of attribute objects, one for each
-- attribute on each resource. You can filter the list of results to a
-- single attribute name to only return results that have that name. You
-- can also filter the results by attribute name and value. You can do
-- this, for example, to see which container instances in a cluster are
-- running a Linux AMI (@ecs.os-type=linux@).
--
-- This operation returns paginated results.
module Amazonka.ECS.ListAttributes
  ( -- * Creating a Request
    ListAttributes (..),
    newListAttributes,

    -- * Request Lenses
    listAttributes_attributeName,
    listAttributes_attributeValue,
    listAttributes_cluster,
    listAttributes_maxResults,
    listAttributes_nextToken,
    listAttributes_targetType,

    -- * Destructuring the Response
    ListAttributesResponse (..),
    newListAttributesResponse,

    -- * Response Lenses
    listAttributesResponse_attributes,
    listAttributesResponse_nextToken,
    listAttributesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListAttributes' smart constructor.
data ListAttributes = ListAttributes'
  { -- | The name of the attribute to filter the results with.
    ListAttributes -> Maybe Text
attributeName :: Prelude.Maybe Prelude.Text,
    -- | The value of the attribute to filter results with. You must also specify
    -- an attribute name to use this parameter.
    ListAttributes -> Maybe Text
attributeValue :: Prelude.Maybe Prelude.Text,
    -- | The short name or full Amazon Resource Name (ARN) of the cluster to list
    -- attributes. If you do not specify a cluster, the default cluster is
    -- assumed.
    ListAttributes -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of cluster results that @ListAttributes@ returned in
    -- paginated output. When this parameter is used, @ListAttributes@ only
    -- returns @maxResults@ results in a single page along with a @nextToken@
    -- response element. The remaining results of the initial request can be
    -- seen by sending another @ListAttributes@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 100. If this
    -- parameter isn\'t used, then @ListAttributes@ returns up to 100 results
    -- and a @nextToken@ value if applicable.
    ListAttributes -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The @nextToken@ value returned from a @ListAttributes@ request
    -- indicating that more results are available to fulfill the request and
    -- further calls are needed. If @maxResults@ was provided, it\'s possible
    -- the number of results to be fewer than @maxResults@.
    --
    -- This token should be treated as an opaque identifier that is only used
    -- to retrieve the next items in a list and not for other programmatic
    -- purposes.
    ListAttributes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The type of the target to list attributes with.
    ListAttributes -> TargetType
targetType :: TargetType
  }
  deriving (ListAttributes -> ListAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAttributes -> ListAttributes -> Bool
$c/= :: ListAttributes -> ListAttributes -> Bool
== :: ListAttributes -> ListAttributes -> Bool
$c== :: ListAttributes -> ListAttributes -> Bool
Prelude.Eq, ReadPrec [ListAttributes]
ReadPrec ListAttributes
Int -> ReadS ListAttributes
ReadS [ListAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAttributes]
$creadListPrec :: ReadPrec [ListAttributes]
readPrec :: ReadPrec ListAttributes
$creadPrec :: ReadPrec ListAttributes
readList :: ReadS [ListAttributes]
$creadList :: ReadS [ListAttributes]
readsPrec :: Int -> ReadS ListAttributes
$creadsPrec :: Int -> ReadS ListAttributes
Prelude.Read, Int -> ListAttributes -> ShowS
[ListAttributes] -> ShowS
ListAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAttributes] -> ShowS
$cshowList :: [ListAttributes] -> ShowS
show :: ListAttributes -> String
$cshow :: ListAttributes -> String
showsPrec :: Int -> ListAttributes -> ShowS
$cshowsPrec :: Int -> ListAttributes -> ShowS
Prelude.Show, forall x. Rep ListAttributes x -> ListAttributes
forall x. ListAttributes -> Rep ListAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAttributes x -> ListAttributes
$cfrom :: forall x. ListAttributes -> Rep ListAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ListAttributes' 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:
--
-- 'attributeName', 'listAttributes_attributeName' - The name of the attribute to filter the results with.
--
-- 'attributeValue', 'listAttributes_attributeValue' - The value of the attribute to filter results with. You must also specify
-- an attribute name to use this parameter.
--
-- 'cluster', 'listAttributes_cluster' - The short name or full Amazon Resource Name (ARN) of the cluster to list
-- attributes. If you do not specify a cluster, the default cluster is
-- assumed.
--
-- 'maxResults', 'listAttributes_maxResults' - The maximum number of cluster results that @ListAttributes@ returned in
-- paginated output. When this parameter is used, @ListAttributes@ only
-- returns @maxResults@ results in a single page along with a @nextToken@
-- response element. The remaining results of the initial request can be
-- seen by sending another @ListAttributes@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If this
-- parameter isn\'t used, then @ListAttributes@ returns up to 100 results
-- and a @nextToken@ value if applicable.
--
-- 'nextToken', 'listAttributes_nextToken' - The @nextToken@ value returned from a @ListAttributes@ request
-- indicating that more results are available to fulfill the request and
-- further calls are needed. If @maxResults@ was provided, it\'s possible
-- the number of results to be fewer than @maxResults@.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
--
-- 'targetType', 'listAttributes_targetType' - The type of the target to list attributes with.
newListAttributes ::
  -- | 'targetType'
  TargetType ->
  ListAttributes
newListAttributes :: TargetType -> ListAttributes
newListAttributes TargetType
pTargetType_ =
  ListAttributes'
    { $sel:attributeName:ListAttributes' :: Maybe Text
attributeName = forall a. Maybe a
Prelude.Nothing,
      $sel:attributeValue:ListAttributes' :: Maybe Text
attributeValue = forall a. Maybe a
Prelude.Nothing,
      $sel:cluster:ListAttributes' :: Maybe Text
cluster = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAttributes' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAttributes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:targetType:ListAttributes' :: TargetType
targetType = TargetType
pTargetType_
    }

-- | The name of the attribute to filter the results with.
listAttributes_attributeName :: Lens.Lens' ListAttributes (Prelude.Maybe Prelude.Text)
listAttributes_attributeName :: Lens' ListAttributes (Maybe Text)
listAttributes_attributeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributes' {Maybe Text
attributeName :: Maybe Text
$sel:attributeName:ListAttributes' :: ListAttributes -> Maybe Text
attributeName} -> Maybe Text
attributeName) (\s :: ListAttributes
s@ListAttributes' {} Maybe Text
a -> ListAttributes
s {$sel:attributeName:ListAttributes' :: Maybe Text
attributeName = Maybe Text
a} :: ListAttributes)

-- | The value of the attribute to filter results with. You must also specify
-- an attribute name to use this parameter.
listAttributes_attributeValue :: Lens.Lens' ListAttributes (Prelude.Maybe Prelude.Text)
listAttributes_attributeValue :: Lens' ListAttributes (Maybe Text)
listAttributes_attributeValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributes' {Maybe Text
attributeValue :: Maybe Text
$sel:attributeValue:ListAttributes' :: ListAttributes -> Maybe Text
attributeValue} -> Maybe Text
attributeValue) (\s :: ListAttributes
s@ListAttributes' {} Maybe Text
a -> ListAttributes
s {$sel:attributeValue:ListAttributes' :: Maybe Text
attributeValue = Maybe Text
a} :: ListAttributes)

-- | The short name or full Amazon Resource Name (ARN) of the cluster to list
-- attributes. If you do not specify a cluster, the default cluster is
-- assumed.
listAttributes_cluster :: Lens.Lens' ListAttributes (Prelude.Maybe Prelude.Text)
listAttributes_cluster :: Lens' ListAttributes (Maybe Text)
listAttributes_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributes' {Maybe Text
cluster :: Maybe Text
$sel:cluster:ListAttributes' :: ListAttributes -> Maybe Text
cluster} -> Maybe Text
cluster) (\s :: ListAttributes
s@ListAttributes' {} Maybe Text
a -> ListAttributes
s {$sel:cluster:ListAttributes' :: Maybe Text
cluster = Maybe Text
a} :: ListAttributes)

-- | The maximum number of cluster results that @ListAttributes@ returned in
-- paginated output. When this parameter is used, @ListAttributes@ only
-- returns @maxResults@ results in a single page along with a @nextToken@
-- response element. The remaining results of the initial request can be
-- seen by sending another @ListAttributes@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If this
-- parameter isn\'t used, then @ListAttributes@ returns up to 100 results
-- and a @nextToken@ value if applicable.
listAttributes_maxResults :: Lens.Lens' ListAttributes (Prelude.Maybe Prelude.Int)
listAttributes_maxResults :: Lens' ListAttributes (Maybe Int)
listAttributes_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributes' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListAttributes' :: ListAttributes -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListAttributes
s@ListAttributes' {} Maybe Int
a -> ListAttributes
s {$sel:maxResults:ListAttributes' :: Maybe Int
maxResults = Maybe Int
a} :: ListAttributes)

-- | The @nextToken@ value returned from a @ListAttributes@ request
-- indicating that more results are available to fulfill the request and
-- further calls are needed. If @maxResults@ was provided, it\'s possible
-- the number of results to be fewer than @maxResults@.
--
-- This token should be treated as an opaque identifier that is only used
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
listAttributes_nextToken :: Lens.Lens' ListAttributes (Prelude.Maybe Prelude.Text)
listAttributes_nextToken :: Lens' ListAttributes (Maybe Text)
listAttributes_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAttributes' :: ListAttributes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAttributes
s@ListAttributes' {} Maybe Text
a -> ListAttributes
s {$sel:nextToken:ListAttributes' :: Maybe Text
nextToken = Maybe Text
a} :: ListAttributes)

-- | The type of the target to list attributes with.
listAttributes_targetType :: Lens.Lens' ListAttributes TargetType
listAttributes_targetType :: Lens' ListAttributes TargetType
listAttributes_targetType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributes' {TargetType
targetType :: TargetType
$sel:targetType:ListAttributes' :: ListAttributes -> TargetType
targetType} -> TargetType
targetType) (\s :: ListAttributes
s@ListAttributes' {} TargetType
a -> ListAttributes
s {$sel:targetType:ListAttributes' :: TargetType
targetType = TargetType
a} :: ListAttributes)

instance Core.AWSPager ListAttributes where
  page :: ListAttributes
-> AWSResponse ListAttributes -> Maybe ListAttributes
page ListAttributes
rq AWSResponse ListAttributes
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAttributes
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAttributesResponse (Maybe Text)
listAttributesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAttributes
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAttributesResponse (Maybe [Attribute])
listAttributesResponse_attributes
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListAttributes
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAttributes (Maybe Text)
listAttributes_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAttributes
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAttributesResponse (Maybe Text)
listAttributesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListAttributes where
  type
    AWSResponse ListAttributes =
      ListAttributesResponse
  request :: (Service -> Service) -> ListAttributes -> Request ListAttributes
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAttributes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAttributes)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Attribute] -> Maybe Text -> Int -> ListAttributesResponse
ListAttributesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"attributes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            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 ListAttributes where
  hashWithSalt :: Int -> ListAttributes -> Int
hashWithSalt Int
_salt ListAttributes' {Maybe Int
Maybe Text
TargetType
targetType :: TargetType
nextToken :: Maybe Text
maxResults :: Maybe Int
cluster :: Maybe Text
attributeValue :: Maybe Text
attributeName :: Maybe Text
$sel:targetType:ListAttributes' :: ListAttributes -> TargetType
$sel:nextToken:ListAttributes' :: ListAttributes -> Maybe Text
$sel:maxResults:ListAttributes' :: ListAttributes -> Maybe Int
$sel:cluster:ListAttributes' :: ListAttributes -> Maybe Text
$sel:attributeValue:ListAttributes' :: ListAttributes -> Maybe Text
$sel:attributeName:ListAttributes' :: ListAttributes -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attributeValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cluster
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TargetType
targetType

instance Prelude.NFData ListAttributes where
  rnf :: ListAttributes -> ()
rnf ListAttributes' {Maybe Int
Maybe Text
TargetType
targetType :: TargetType
nextToken :: Maybe Text
maxResults :: Maybe Int
cluster :: Maybe Text
attributeValue :: Maybe Text
attributeName :: Maybe Text
$sel:targetType:ListAttributes' :: ListAttributes -> TargetType
$sel:nextToken:ListAttributes' :: ListAttributes -> Maybe Text
$sel:maxResults:ListAttributes' :: ListAttributes -> Maybe Int
$sel:cluster:ListAttributes' :: ListAttributes -> Maybe Text
$sel:attributeValue:ListAttributes' :: ListAttributes -> Maybe Text
$sel:attributeName:ListAttributes' :: ListAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributeName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributeValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cluster
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
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 TargetType
targetType

instance Data.ToHeaders ListAttributes where
  toHeaders :: ListAttributes -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonEC2ContainerServiceV20141113.ListAttributes" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListAttributes where
  toJSON :: ListAttributes -> Value
toJSON ListAttributes' {Maybe Int
Maybe Text
TargetType
targetType :: TargetType
nextToken :: Maybe Text
maxResults :: Maybe Int
cluster :: Maybe Text
attributeValue :: Maybe Text
attributeName :: Maybe Text
$sel:targetType:ListAttributes' :: ListAttributes -> TargetType
$sel:nextToken:ListAttributes' :: ListAttributes -> Maybe Text
$sel:maxResults:ListAttributes' :: ListAttributes -> Maybe Int
$sel:cluster:ListAttributes' :: ListAttributes -> Maybe Text
$sel:attributeValue:ListAttributes' :: ListAttributes -> Maybe Text
$sel:attributeName:ListAttributes' :: ListAttributes -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"attributeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attributeName,
            (Key
"attributeValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attributeValue,
            (Key
"cluster" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cluster,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"targetType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TargetType
targetType)
          ]
      )

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

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

-- | /See:/ 'newListAttributesResponse' smart constructor.
data ListAttributesResponse = ListAttributesResponse'
  { -- | A list of attribute objects that meet the criteria of the request.
    ListAttributesResponse -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
    -- | The @nextToken@ value to include in a future @ListAttributes@ request.
    -- When the results of a @ListAttributes@ request exceed @maxResults@, this
    -- value can be used to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    ListAttributesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAttributesResponse -> ListAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAttributesResponse -> ListAttributesResponse -> Bool
$c/= :: ListAttributesResponse -> ListAttributesResponse -> Bool
== :: ListAttributesResponse -> ListAttributesResponse -> Bool
$c== :: ListAttributesResponse -> ListAttributesResponse -> Bool
Prelude.Eq, ReadPrec [ListAttributesResponse]
ReadPrec ListAttributesResponse
Int -> ReadS ListAttributesResponse
ReadS [ListAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAttributesResponse]
$creadListPrec :: ReadPrec [ListAttributesResponse]
readPrec :: ReadPrec ListAttributesResponse
$creadPrec :: ReadPrec ListAttributesResponse
readList :: ReadS [ListAttributesResponse]
$creadList :: ReadS [ListAttributesResponse]
readsPrec :: Int -> ReadS ListAttributesResponse
$creadsPrec :: Int -> ReadS ListAttributesResponse
Prelude.Read, Int -> ListAttributesResponse -> ShowS
[ListAttributesResponse] -> ShowS
ListAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAttributesResponse] -> ShowS
$cshowList :: [ListAttributesResponse] -> ShowS
show :: ListAttributesResponse -> String
$cshow :: ListAttributesResponse -> String
showsPrec :: Int -> ListAttributesResponse -> ShowS
$cshowsPrec :: Int -> ListAttributesResponse -> ShowS
Prelude.Show, forall x. Rep ListAttributesResponse x -> ListAttributesResponse
forall x. ListAttributesResponse -> Rep ListAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAttributesResponse x -> ListAttributesResponse
$cfrom :: forall x. ListAttributesResponse -> Rep ListAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAttributesResponse' 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:
--
-- 'attributes', 'listAttributesResponse_attributes' - A list of attribute objects that meet the criteria of the request.
--
-- 'nextToken', 'listAttributesResponse_nextToken' - The @nextToken@ value to include in a future @ListAttributes@ request.
-- When the results of a @ListAttributes@ request exceed @maxResults@, this
-- value can be used to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'listAttributesResponse_httpStatus' - The response's http status code.
newListAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAttributesResponse
newListAttributesResponse :: Int -> ListAttributesResponse
newListAttributesResponse Int
pHttpStatus_ =
  ListAttributesResponse'
    { $sel:attributes:ListAttributesResponse' :: Maybe [Attribute]
attributes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAttributesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of attribute objects that meet the criteria of the request.
listAttributesResponse_attributes :: Lens.Lens' ListAttributesResponse (Prelude.Maybe [Attribute])
listAttributesResponse_attributes :: Lens' ListAttributesResponse (Maybe [Attribute])
listAttributesResponse_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributesResponse' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:ListAttributesResponse' :: ListAttributesResponse -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: ListAttributesResponse
s@ListAttributesResponse' {} Maybe [Attribute]
a -> ListAttributesResponse
s {$sel:attributes:ListAttributesResponse' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: ListAttributesResponse) 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 @nextToken@ value to include in a future @ListAttributes@ request.
-- When the results of a @ListAttributes@ request exceed @maxResults@, this
-- value can be used to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
listAttributesResponse_nextToken :: Lens.Lens' ListAttributesResponse (Prelude.Maybe Prelude.Text)
listAttributesResponse_nextToken :: Lens' ListAttributesResponse (Maybe Text)
listAttributesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttributesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAttributesResponse' :: ListAttributesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAttributesResponse
s@ListAttributesResponse' {} Maybe Text
a -> ListAttributesResponse
s {$sel:nextToken:ListAttributesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAttributesResponse)

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

instance Prelude.NFData ListAttributesResponse where
  rnf :: ListAttributesResponse -> ()
rnf ListAttributesResponse' {Int
Maybe [Attribute]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
attributes :: Maybe [Attribute]
$sel:httpStatus:ListAttributesResponse' :: ListAttributesResponse -> Int
$sel:nextToken:ListAttributesResponse' :: ListAttributesResponse -> Maybe Text
$sel:attributes:ListAttributesResponse' :: ListAttributesResponse -> Maybe [Attribute]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Attribute]
attributes
      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 Int
httpStatus