{-# 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.Snowball.ListCompatibleImages
-- 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)
--
-- This action returns a list of the different Amazon EC2 Amazon Machine
-- Images (AMIs) that are owned by your AWS account that would be supported
-- for use on a Snow device. Currently, supported AMIs are based on the
-- CentOS 7 (x86_64) - with Updates HVM, Ubuntu Server 14.04 LTS (HVM), and
-- Ubuntu 16.04 LTS - Xenial (HVM) images, available on the AWS
-- Marketplace.
--
-- This operation returns paginated results.
module Amazonka.Snowball.ListCompatibleImages
  ( -- * Creating a Request
    ListCompatibleImages (..),
    newListCompatibleImages,

    -- * Request Lenses
    listCompatibleImages_nextToken,
    listCompatibleImages_maxResults,

    -- * Destructuring the Response
    ListCompatibleImagesResponse (..),
    newListCompatibleImagesResponse,

    -- * Response Lenses
    listCompatibleImagesResponse_compatibleImages,
    listCompatibleImagesResponse_nextToken,
    listCompatibleImagesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListCompatibleImages' smart constructor.
data ListCompatibleImages = ListCompatibleImages'
  { -- | HTTP requests are stateless. To identify what object comes \"next\" in
    -- the list of compatible images, you can specify a value for @NextToken@
    -- as the starting point for your list of returned images.
    ListCompatibleImages -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results for the list of compatible images.
    -- Currently, a Snowball Edge device can store 10 AMIs.
    ListCompatibleImages -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListCompatibleImages -> ListCompatibleImages -> Bool
(ListCompatibleImages -> ListCompatibleImages -> Bool)
-> (ListCompatibleImages -> ListCompatibleImages -> Bool)
-> Eq ListCompatibleImages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCompatibleImages -> ListCompatibleImages -> Bool
$c/= :: ListCompatibleImages -> ListCompatibleImages -> Bool
== :: ListCompatibleImages -> ListCompatibleImages -> Bool
$c== :: ListCompatibleImages -> ListCompatibleImages -> Bool
Prelude.Eq, ReadPrec [ListCompatibleImages]
ReadPrec ListCompatibleImages
Int -> ReadS ListCompatibleImages
ReadS [ListCompatibleImages]
(Int -> ReadS ListCompatibleImages)
-> ReadS [ListCompatibleImages]
-> ReadPrec ListCompatibleImages
-> ReadPrec [ListCompatibleImages]
-> Read ListCompatibleImages
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCompatibleImages]
$creadListPrec :: ReadPrec [ListCompatibleImages]
readPrec :: ReadPrec ListCompatibleImages
$creadPrec :: ReadPrec ListCompatibleImages
readList :: ReadS [ListCompatibleImages]
$creadList :: ReadS [ListCompatibleImages]
readsPrec :: Int -> ReadS ListCompatibleImages
$creadsPrec :: Int -> ReadS ListCompatibleImages
Prelude.Read, Int -> ListCompatibleImages -> ShowS
[ListCompatibleImages] -> ShowS
ListCompatibleImages -> String
(Int -> ListCompatibleImages -> ShowS)
-> (ListCompatibleImages -> String)
-> ([ListCompatibleImages] -> ShowS)
-> Show ListCompatibleImages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCompatibleImages] -> ShowS
$cshowList :: [ListCompatibleImages] -> ShowS
show :: ListCompatibleImages -> String
$cshow :: ListCompatibleImages -> String
showsPrec :: Int -> ListCompatibleImages -> ShowS
$cshowsPrec :: Int -> ListCompatibleImages -> ShowS
Prelude.Show, (forall x. ListCompatibleImages -> Rep ListCompatibleImages x)
-> (forall x. Rep ListCompatibleImages x -> ListCompatibleImages)
-> Generic ListCompatibleImages
forall x. Rep ListCompatibleImages x -> ListCompatibleImages
forall x. ListCompatibleImages -> Rep ListCompatibleImages x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCompatibleImages x -> ListCompatibleImages
$cfrom :: forall x. ListCompatibleImages -> Rep ListCompatibleImages x
Prelude.Generic)

-- |
-- Create a value of 'ListCompatibleImages' 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', 'listCompatibleImages_nextToken' - HTTP requests are stateless. To identify what object comes \"next\" in
-- the list of compatible images, you can specify a value for @NextToken@
-- as the starting point for your list of returned images.
--
-- 'maxResults', 'listCompatibleImages_maxResults' - The maximum number of results for the list of compatible images.
-- Currently, a Snowball Edge device can store 10 AMIs.
newListCompatibleImages ::
  ListCompatibleImages
newListCompatibleImages :: ListCompatibleImages
newListCompatibleImages =
  ListCompatibleImages' :: Maybe Text -> Maybe Natural -> ListCompatibleImages
ListCompatibleImages'
    { $sel:nextToken:ListCompatibleImages' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCompatibleImages' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | HTTP requests are stateless. To identify what object comes \"next\" in
-- the list of compatible images, you can specify a value for @NextToken@
-- as the starting point for your list of returned images.
listCompatibleImages_nextToken :: Lens.Lens' ListCompatibleImages (Prelude.Maybe Prelude.Text)
listCompatibleImages_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCompatibleImages -> f ListCompatibleImages
listCompatibleImages_nextToken = (ListCompatibleImages -> Maybe Text)
-> (ListCompatibleImages -> Maybe Text -> ListCompatibleImages)
-> Lens
     ListCompatibleImages ListCompatibleImages (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImages' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCompatibleImages' :: ListCompatibleImages -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCompatibleImages
s@ListCompatibleImages' {} Maybe Text
a -> ListCompatibleImages
s {$sel:nextToken:ListCompatibleImages' :: Maybe Text
nextToken = Maybe Text
a} :: ListCompatibleImages)

-- | The maximum number of results for the list of compatible images.
-- Currently, a Snowball Edge device can store 10 AMIs.
listCompatibleImages_maxResults :: Lens.Lens' ListCompatibleImages (Prelude.Maybe Prelude.Natural)
listCompatibleImages_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListCompatibleImages -> f ListCompatibleImages
listCompatibleImages_maxResults = (ListCompatibleImages -> Maybe Natural)
-> (ListCompatibleImages -> Maybe Natural -> ListCompatibleImages)
-> Lens
     ListCompatibleImages
     ListCompatibleImages
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImages' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCompatibleImages' :: ListCompatibleImages -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCompatibleImages
s@ListCompatibleImages' {} Maybe Natural
a -> ListCompatibleImages
s {$sel:maxResults:ListCompatibleImages' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCompatibleImages)

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

instance Prelude.NFData ListCompatibleImages

instance Core.ToHeaders ListCompatibleImages where
  toHeaders :: ListCompatibleImages -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListCompatibleImages -> 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
"AWSIESnowballJobManagementService.ListCompatibleImages" ::
                          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 ListCompatibleImages where
  toJSON :: ListCompatibleImages -> Value
toJSON ListCompatibleImages' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListCompatibleImages' :: ListCompatibleImages -> Maybe Natural
$sel:nextToken:ListCompatibleImages' :: ListCompatibleImages -> 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
          ]
      )

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

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

-- | /See:/ 'newListCompatibleImagesResponse' smart constructor.
data ListCompatibleImagesResponse = ListCompatibleImagesResponse'
  { -- | A JSON-formatted object that describes a compatible AMI, including the
    -- ID and name for a Snow device AMI.
    ListCompatibleImagesResponse -> Maybe [CompatibleImage]
compatibleImages :: Prelude.Maybe [CompatibleImage],
    -- | Because HTTP requests are stateless, this is the starting point for your
    -- next list of returned images.
    ListCompatibleImagesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCompatibleImagesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
(ListCompatibleImagesResponse
 -> ListCompatibleImagesResponse -> Bool)
-> (ListCompatibleImagesResponse
    -> ListCompatibleImagesResponse -> Bool)
-> Eq ListCompatibleImagesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
$c/= :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
== :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
$c== :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
Prelude.Eq, ReadPrec [ListCompatibleImagesResponse]
ReadPrec ListCompatibleImagesResponse
Int -> ReadS ListCompatibleImagesResponse
ReadS [ListCompatibleImagesResponse]
(Int -> ReadS ListCompatibleImagesResponse)
-> ReadS [ListCompatibleImagesResponse]
-> ReadPrec ListCompatibleImagesResponse
-> ReadPrec [ListCompatibleImagesResponse]
-> Read ListCompatibleImagesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCompatibleImagesResponse]
$creadListPrec :: ReadPrec [ListCompatibleImagesResponse]
readPrec :: ReadPrec ListCompatibleImagesResponse
$creadPrec :: ReadPrec ListCompatibleImagesResponse
readList :: ReadS [ListCompatibleImagesResponse]
$creadList :: ReadS [ListCompatibleImagesResponse]
readsPrec :: Int -> ReadS ListCompatibleImagesResponse
$creadsPrec :: Int -> ReadS ListCompatibleImagesResponse
Prelude.Read, Int -> ListCompatibleImagesResponse -> ShowS
[ListCompatibleImagesResponse] -> ShowS
ListCompatibleImagesResponse -> String
(Int -> ListCompatibleImagesResponse -> ShowS)
-> (ListCompatibleImagesResponse -> String)
-> ([ListCompatibleImagesResponse] -> ShowS)
-> Show ListCompatibleImagesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCompatibleImagesResponse] -> ShowS
$cshowList :: [ListCompatibleImagesResponse] -> ShowS
show :: ListCompatibleImagesResponse -> String
$cshow :: ListCompatibleImagesResponse -> String
showsPrec :: Int -> ListCompatibleImagesResponse -> ShowS
$cshowsPrec :: Int -> ListCompatibleImagesResponse -> ShowS
Prelude.Show, (forall x.
 ListCompatibleImagesResponse -> Rep ListCompatibleImagesResponse x)
-> (forall x.
    Rep ListCompatibleImagesResponse x -> ListCompatibleImagesResponse)
-> Generic ListCompatibleImagesResponse
forall x.
Rep ListCompatibleImagesResponse x -> ListCompatibleImagesResponse
forall x.
ListCompatibleImagesResponse -> Rep ListCompatibleImagesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCompatibleImagesResponse x -> ListCompatibleImagesResponse
$cfrom :: forall x.
ListCompatibleImagesResponse -> Rep ListCompatibleImagesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCompatibleImagesResponse' 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:
--
-- 'compatibleImages', 'listCompatibleImagesResponse_compatibleImages' - A JSON-formatted object that describes a compatible AMI, including the
-- ID and name for a Snow device AMI.
--
-- 'nextToken', 'listCompatibleImagesResponse_nextToken' - Because HTTP requests are stateless, this is the starting point for your
-- next list of returned images.
--
-- 'httpStatus', 'listCompatibleImagesResponse_httpStatus' - The response's http status code.
newListCompatibleImagesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCompatibleImagesResponse
newListCompatibleImagesResponse :: Int -> ListCompatibleImagesResponse
newListCompatibleImagesResponse Int
pHttpStatus_ =
  ListCompatibleImagesResponse' :: Maybe [CompatibleImage]
-> Maybe Text -> Int -> ListCompatibleImagesResponse
ListCompatibleImagesResponse'
    { $sel:compatibleImages:ListCompatibleImagesResponse' :: Maybe [CompatibleImage]
compatibleImages =
        Maybe [CompatibleImage]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCompatibleImagesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCompatibleImagesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A JSON-formatted object that describes a compatible AMI, including the
-- ID and name for a Snow device AMI.
listCompatibleImagesResponse_compatibleImages :: Lens.Lens' ListCompatibleImagesResponse (Prelude.Maybe [CompatibleImage])
listCompatibleImagesResponse_compatibleImages :: (Maybe [CompatibleImage] -> f (Maybe [CompatibleImage]))
-> ListCompatibleImagesResponse -> f ListCompatibleImagesResponse
listCompatibleImagesResponse_compatibleImages = (ListCompatibleImagesResponse -> Maybe [CompatibleImage])
-> (ListCompatibleImagesResponse
    -> Maybe [CompatibleImage] -> ListCompatibleImagesResponse)
-> Lens' ListCompatibleImagesResponse (Maybe [CompatibleImage])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImagesResponse' {Maybe [CompatibleImage]
compatibleImages :: Maybe [CompatibleImage]
$sel:compatibleImages:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Maybe [CompatibleImage]
compatibleImages} -> Maybe [CompatibleImage]
compatibleImages) (\s :: ListCompatibleImagesResponse
s@ListCompatibleImagesResponse' {} Maybe [CompatibleImage]
a -> ListCompatibleImagesResponse
s {$sel:compatibleImages:ListCompatibleImagesResponse' :: Maybe [CompatibleImage]
compatibleImages = Maybe [CompatibleImage]
a} :: ListCompatibleImagesResponse) ((Maybe [CompatibleImage] -> f (Maybe [CompatibleImage]))
 -> ListCompatibleImagesResponse -> f ListCompatibleImagesResponse)
-> ((Maybe [CompatibleImage] -> f (Maybe [CompatibleImage]))
    -> Maybe [CompatibleImage] -> f (Maybe [CompatibleImage]))
-> (Maybe [CompatibleImage] -> f (Maybe [CompatibleImage]))
-> ListCompatibleImagesResponse
-> f ListCompatibleImagesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CompatibleImage]
  [CompatibleImage]
  [CompatibleImage]
  [CompatibleImage]
-> Iso
     (Maybe [CompatibleImage])
     (Maybe [CompatibleImage])
     (Maybe [CompatibleImage])
     (Maybe [CompatibleImage])
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
  [CompatibleImage]
  [CompatibleImage]
  [CompatibleImage]
  [CompatibleImage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Because HTTP requests are stateless, this is the starting point for your
-- next list of returned images.
listCompatibleImagesResponse_nextToken :: Lens.Lens' ListCompatibleImagesResponse (Prelude.Maybe Prelude.Text)
listCompatibleImagesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCompatibleImagesResponse -> f ListCompatibleImagesResponse
listCompatibleImagesResponse_nextToken = (ListCompatibleImagesResponse -> Maybe Text)
-> (ListCompatibleImagesResponse
    -> Maybe Text -> ListCompatibleImagesResponse)
-> Lens' ListCompatibleImagesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImagesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCompatibleImagesResponse
s@ListCompatibleImagesResponse' {} Maybe Text
a -> ListCompatibleImagesResponse
s {$sel:nextToken:ListCompatibleImagesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCompatibleImagesResponse)

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

instance Prelude.NFData ListCompatibleImagesResponse