{-# 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.ElasticInference.DescribeAccelerators
-- 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 information over a provided set of accelerators belonging to
-- an account.
--
-- This operation returns paginated results.
module Amazonka.ElasticInference.DescribeAccelerators
  ( -- * Creating a Request
    DescribeAccelerators (..),
    newDescribeAccelerators,

    -- * Request Lenses
    describeAccelerators_acceleratorIds,
    describeAccelerators_filters,
    describeAccelerators_maxResults,
    describeAccelerators_nextToken,

    -- * Destructuring the Response
    DescribeAcceleratorsResponse (..),
    newDescribeAcceleratorsResponse,

    -- * Response Lenses
    describeAcceleratorsResponse_acceleratorSet,
    describeAcceleratorsResponse_nextToken,
    describeAcceleratorsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeAccelerators' smart constructor.
data DescribeAccelerators = DescribeAccelerators'
  { -- | The IDs of the accelerators to describe.
    DescribeAccelerators -> Maybe [Text]
acceleratorIds :: Prelude.Maybe [Prelude.Text],
    -- | One or more filters. Filter names and values are case-sensitive. Valid
    -- filter names are: accelerator-types: can provide a list of accelerator
    -- type names to filter for. instance-id: can provide a list of EC2
    -- instance ids to filter for.
    DescribeAccelerators -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The total number of items to return in the command\'s output. If the
    -- total number of items available is more than the value specified, a
    -- NextToken is provided in the command\'s output. To resume pagination,
    -- provide the NextToken value in the starting-token argument of a
    -- subsequent command. Do not use the NextToken response element directly
    -- outside of the AWS CLI.
    DescribeAccelerators -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A token to specify where to start paginating. This is the NextToken from
    -- a previously truncated response.
    DescribeAccelerators -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeAccelerators -> DescribeAccelerators -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAccelerators -> DescribeAccelerators -> Bool
$c/= :: DescribeAccelerators -> DescribeAccelerators -> Bool
== :: DescribeAccelerators -> DescribeAccelerators -> Bool
$c== :: DescribeAccelerators -> DescribeAccelerators -> Bool
Prelude.Eq, ReadPrec [DescribeAccelerators]
ReadPrec DescribeAccelerators
Int -> ReadS DescribeAccelerators
ReadS [DescribeAccelerators]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAccelerators]
$creadListPrec :: ReadPrec [DescribeAccelerators]
readPrec :: ReadPrec DescribeAccelerators
$creadPrec :: ReadPrec DescribeAccelerators
readList :: ReadS [DescribeAccelerators]
$creadList :: ReadS [DescribeAccelerators]
readsPrec :: Int -> ReadS DescribeAccelerators
$creadsPrec :: Int -> ReadS DescribeAccelerators
Prelude.Read, Int -> DescribeAccelerators -> ShowS
[DescribeAccelerators] -> ShowS
DescribeAccelerators -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAccelerators] -> ShowS
$cshowList :: [DescribeAccelerators] -> ShowS
show :: DescribeAccelerators -> String
$cshow :: DescribeAccelerators -> String
showsPrec :: Int -> DescribeAccelerators -> ShowS
$cshowsPrec :: Int -> DescribeAccelerators -> ShowS
Prelude.Show, forall x. Rep DescribeAccelerators x -> DescribeAccelerators
forall x. DescribeAccelerators -> Rep DescribeAccelerators x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAccelerators x -> DescribeAccelerators
$cfrom :: forall x. DescribeAccelerators -> Rep DescribeAccelerators x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAccelerators' 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:
--
-- 'acceleratorIds', 'describeAccelerators_acceleratorIds' - The IDs of the accelerators to describe.
--
-- 'filters', 'describeAccelerators_filters' - One or more filters. Filter names and values are case-sensitive. Valid
-- filter names are: accelerator-types: can provide a list of accelerator
-- type names to filter for. instance-id: can provide a list of EC2
-- instance ids to filter for.
--
-- 'maxResults', 'describeAccelerators_maxResults' - The total number of items to return in the command\'s output. If the
-- total number of items available is more than the value specified, a
-- NextToken is provided in the command\'s output. To resume pagination,
-- provide the NextToken value in the starting-token argument of a
-- subsequent command. Do not use the NextToken response element directly
-- outside of the AWS CLI.
--
-- 'nextToken', 'describeAccelerators_nextToken' - A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
newDescribeAccelerators ::
  DescribeAccelerators
newDescribeAccelerators :: DescribeAccelerators
newDescribeAccelerators =
  DescribeAccelerators'
    { $sel:acceleratorIds:DescribeAccelerators' :: Maybe [Text]
acceleratorIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeAccelerators' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeAccelerators' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAccelerators' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The IDs of the accelerators to describe.
describeAccelerators_acceleratorIds :: Lens.Lens' DescribeAccelerators (Prelude.Maybe [Prelude.Text])
describeAccelerators_acceleratorIds :: Lens' DescribeAccelerators (Maybe [Text])
describeAccelerators_acceleratorIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccelerators' {Maybe [Text]
acceleratorIds :: Maybe [Text]
$sel:acceleratorIds:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Text]
acceleratorIds} -> Maybe [Text]
acceleratorIds) (\s :: DescribeAccelerators
s@DescribeAccelerators' {} Maybe [Text]
a -> DescribeAccelerators
s {$sel:acceleratorIds:DescribeAccelerators' :: Maybe [Text]
acceleratorIds = Maybe [Text]
a} :: DescribeAccelerators) 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 filters. Filter names and values are case-sensitive. Valid
-- filter names are: accelerator-types: can provide a list of accelerator
-- type names to filter for. instance-id: can provide a list of EC2
-- instance ids to filter for.
describeAccelerators_filters :: Lens.Lens' DescribeAccelerators (Prelude.Maybe [Filter])
describeAccelerators_filters :: Lens' DescribeAccelerators (Maybe [Filter])
describeAccelerators_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccelerators' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeAccelerators
s@DescribeAccelerators' {} Maybe [Filter]
a -> DescribeAccelerators
s {$sel:filters:DescribeAccelerators' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeAccelerators) 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 total number of items to return in the command\'s output. If the
-- total number of items available is more than the value specified, a
-- NextToken is provided in the command\'s output. To resume pagination,
-- provide the NextToken value in the starting-token argument of a
-- subsequent command. Do not use the NextToken response element directly
-- outside of the AWS CLI.
describeAccelerators_maxResults :: Lens.Lens' DescribeAccelerators (Prelude.Maybe Prelude.Natural)
describeAccelerators_maxResults :: Lens' DescribeAccelerators (Maybe Natural)
describeAccelerators_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccelerators' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeAccelerators' :: DescribeAccelerators -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeAccelerators
s@DescribeAccelerators' {} Maybe Natural
a -> DescribeAccelerators
s {$sel:maxResults:DescribeAccelerators' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeAccelerators)

-- | A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
describeAccelerators_nextToken :: Lens.Lens' DescribeAccelerators (Prelude.Maybe Prelude.Text)
describeAccelerators_nextToken :: Lens' DescribeAccelerators (Maybe Text)
describeAccelerators_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAccelerators' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAccelerators' :: DescribeAccelerators -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAccelerators
s@DescribeAccelerators' {} Maybe Text
a -> DescribeAccelerators
s {$sel:nextToken:DescribeAccelerators' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAccelerators)

instance Core.AWSPager DescribeAccelerators where
  page :: DescribeAccelerators
-> AWSResponse DescribeAccelerators -> Maybe DescribeAccelerators
page DescribeAccelerators
rq AWSResponse DescribeAccelerators
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAccelerators
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeAcceleratorsResponse (Maybe Text)
describeAcceleratorsResponse_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 DescribeAccelerators
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeAcceleratorsResponse (Maybe [ElasticInferenceAccelerator])
describeAcceleratorsResponse_acceleratorSet
            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.$ DescribeAccelerators
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeAccelerators (Maybe Text)
describeAccelerators_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAccelerators
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeAcceleratorsResponse (Maybe Text)
describeAcceleratorsResponse_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 DescribeAccelerators where
  type
    AWSResponse DescribeAccelerators =
      DescribeAcceleratorsResponse
  request :: (Service -> Service)
-> DescribeAccelerators -> Request DescribeAccelerators
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 DescribeAccelerators
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAccelerators)))
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 [ElasticInferenceAccelerator]
-> Maybe Text -> Int -> DescribeAcceleratorsResponse
DescribeAcceleratorsResponse'
            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
"acceleratorSet" 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 DescribeAccelerators where
  hashWithSalt :: Int -> DescribeAccelerators -> Int
hashWithSalt Int
_salt DescribeAccelerators' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
acceleratorIds :: Maybe [Text]
$sel:nextToken:DescribeAccelerators' :: DescribeAccelerators -> Maybe Text
$sel:maxResults:DescribeAccelerators' :: DescribeAccelerators -> Maybe Natural
$sel:filters:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Filter]
$sel:acceleratorIds:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
acceleratorIds
      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

instance Prelude.NFData DescribeAccelerators where
  rnf :: DescribeAccelerators -> ()
rnf DescribeAccelerators' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
acceleratorIds :: Maybe [Text]
$sel:nextToken:DescribeAccelerators' :: DescribeAccelerators -> Maybe Text
$sel:maxResults:DescribeAccelerators' :: DescribeAccelerators -> Maybe Natural
$sel:filters:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Filter]
$sel:acceleratorIds:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
acceleratorIds
      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

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

instance Data.ToJSON DescribeAccelerators where
  toJSON :: DescribeAccelerators -> Value
toJSON DescribeAccelerators' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
acceleratorIds :: Maybe [Text]
$sel:nextToken:DescribeAccelerators' :: DescribeAccelerators -> Maybe Text
$sel:maxResults:DescribeAccelerators' :: DescribeAccelerators -> Maybe Natural
$sel:filters:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Filter]
$sel:acceleratorIds:DescribeAccelerators' :: DescribeAccelerators -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"acceleratorIds" 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]
acceleratorIds,
            (Key
"filters" 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 [Filter]
filters,
            (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 Natural
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
          ]
      )

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

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

-- | /See:/ 'newDescribeAcceleratorsResponse' smart constructor.
data DescribeAcceleratorsResponse = DescribeAcceleratorsResponse'
  { -- | The details of the Elastic Inference Accelerators.
    DescribeAcceleratorsResponse -> Maybe [ElasticInferenceAccelerator]
acceleratorSet :: Prelude.Maybe [ElasticInferenceAccelerator],
    -- | A token to specify where to start paginating. This is the NextToken from
    -- a previously truncated response.
    DescribeAcceleratorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAcceleratorsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAcceleratorsResponse
-> DescribeAcceleratorsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAcceleratorsResponse
-> DescribeAcceleratorsResponse -> Bool
$c/= :: DescribeAcceleratorsResponse
-> DescribeAcceleratorsResponse -> Bool
== :: DescribeAcceleratorsResponse
-> DescribeAcceleratorsResponse -> Bool
$c== :: DescribeAcceleratorsResponse
-> DescribeAcceleratorsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAcceleratorsResponse]
ReadPrec DescribeAcceleratorsResponse
Int -> ReadS DescribeAcceleratorsResponse
ReadS [DescribeAcceleratorsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAcceleratorsResponse]
$creadListPrec :: ReadPrec [DescribeAcceleratorsResponse]
readPrec :: ReadPrec DescribeAcceleratorsResponse
$creadPrec :: ReadPrec DescribeAcceleratorsResponse
readList :: ReadS [DescribeAcceleratorsResponse]
$creadList :: ReadS [DescribeAcceleratorsResponse]
readsPrec :: Int -> ReadS DescribeAcceleratorsResponse
$creadsPrec :: Int -> ReadS DescribeAcceleratorsResponse
Prelude.Read, Int -> DescribeAcceleratorsResponse -> ShowS
[DescribeAcceleratorsResponse] -> ShowS
DescribeAcceleratorsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAcceleratorsResponse] -> ShowS
$cshowList :: [DescribeAcceleratorsResponse] -> ShowS
show :: DescribeAcceleratorsResponse -> String
$cshow :: DescribeAcceleratorsResponse -> String
showsPrec :: Int -> DescribeAcceleratorsResponse -> ShowS
$cshowsPrec :: Int -> DescribeAcceleratorsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeAcceleratorsResponse x -> DescribeAcceleratorsResponse
forall x.
DescribeAcceleratorsResponse -> Rep DescribeAcceleratorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAcceleratorsResponse x -> DescribeAcceleratorsResponse
$cfrom :: forall x.
DescribeAcceleratorsResponse -> Rep DescribeAcceleratorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAcceleratorsResponse' 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:
--
-- 'acceleratorSet', 'describeAcceleratorsResponse_acceleratorSet' - The details of the Elastic Inference Accelerators.
--
-- 'nextToken', 'describeAcceleratorsResponse_nextToken' - A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
--
-- 'httpStatus', 'describeAcceleratorsResponse_httpStatus' - The response's http status code.
newDescribeAcceleratorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAcceleratorsResponse
newDescribeAcceleratorsResponse :: Int -> DescribeAcceleratorsResponse
newDescribeAcceleratorsResponse Int
pHttpStatus_ =
  DescribeAcceleratorsResponse'
    { $sel:acceleratorSet:DescribeAcceleratorsResponse' :: Maybe [ElasticInferenceAccelerator]
acceleratorSet =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAcceleratorsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAcceleratorsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The details of the Elastic Inference Accelerators.
describeAcceleratorsResponse_acceleratorSet :: Lens.Lens' DescribeAcceleratorsResponse (Prelude.Maybe [ElasticInferenceAccelerator])
describeAcceleratorsResponse_acceleratorSet :: Lens'
  DescribeAcceleratorsResponse (Maybe [ElasticInferenceAccelerator])
describeAcceleratorsResponse_acceleratorSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAcceleratorsResponse' {Maybe [ElasticInferenceAccelerator]
acceleratorSet :: Maybe [ElasticInferenceAccelerator]
$sel:acceleratorSet:DescribeAcceleratorsResponse' :: DescribeAcceleratorsResponse -> Maybe [ElasticInferenceAccelerator]
acceleratorSet} -> Maybe [ElasticInferenceAccelerator]
acceleratorSet) (\s :: DescribeAcceleratorsResponse
s@DescribeAcceleratorsResponse' {} Maybe [ElasticInferenceAccelerator]
a -> DescribeAcceleratorsResponse
s {$sel:acceleratorSet:DescribeAcceleratorsResponse' :: Maybe [ElasticInferenceAccelerator]
acceleratorSet = Maybe [ElasticInferenceAccelerator]
a} :: DescribeAcceleratorsResponse) 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

-- | A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
describeAcceleratorsResponse_nextToken :: Lens.Lens' DescribeAcceleratorsResponse (Prelude.Maybe Prelude.Text)
describeAcceleratorsResponse_nextToken :: Lens' DescribeAcceleratorsResponse (Maybe Text)
describeAcceleratorsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAcceleratorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAcceleratorsResponse' :: DescribeAcceleratorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAcceleratorsResponse
s@DescribeAcceleratorsResponse' {} Maybe Text
a -> DescribeAcceleratorsResponse
s {$sel:nextToken:DescribeAcceleratorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAcceleratorsResponse)

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

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