{-# 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.AppStream.DescribeImages
-- 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)
--
-- Retrieves a list that describes one or more specified images, if the
-- image names or image ARNs are provided. Otherwise, all images in the
-- account are described.
--
-- This operation returns paginated results.
module Amazonka.AppStream.DescribeImages
  ( -- * Creating a Request
    DescribeImages (..),
    newDescribeImages,

    -- * Request Lenses
    describeImages_nextToken,
    describeImages_names,
    describeImages_type,
    describeImages_arns,
    describeImages_maxResults,

    -- * Destructuring the Response
    DescribeImagesResponse (..),
    newDescribeImagesResponse,

    -- * Response Lenses
    describeImagesResponse_images,
    describeImagesResponse_nextToken,
    describeImagesResponse_httpStatus,
  )
where

import Amazonka.AppStream.Types
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

-- | /See:/ 'newDescribeImages' smart constructor.
data DescribeImages = DescribeImages'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    DescribeImages -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The names of the public or private images to describe.
    DescribeImages -> Maybe [Text]
names :: Prelude.Maybe [Prelude.Text],
    -- | The type of image (public, private, or shared) to describe.
    DescribeImages -> Maybe VisibilityType
type' :: Prelude.Maybe VisibilityType,
    -- | The ARNs of the public, private, and shared images to describe.
    DescribeImages -> Maybe [Text]
arns :: Prelude.Maybe [Prelude.Text],
    -- | The maximum size of each page of results.
    DescribeImages -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeImages -> DescribeImages -> Bool
(DescribeImages -> DescribeImages -> Bool)
-> (DescribeImages -> DescribeImages -> Bool) -> Eq DescribeImages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeImages -> DescribeImages -> Bool
$c/= :: DescribeImages -> DescribeImages -> Bool
== :: DescribeImages -> DescribeImages -> Bool
$c== :: DescribeImages -> DescribeImages -> Bool
Prelude.Eq, ReadPrec [DescribeImages]
ReadPrec DescribeImages
Int -> ReadS DescribeImages
ReadS [DescribeImages]
(Int -> ReadS DescribeImages)
-> ReadS [DescribeImages]
-> ReadPrec DescribeImages
-> ReadPrec [DescribeImages]
-> Read DescribeImages
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeImages]
$creadListPrec :: ReadPrec [DescribeImages]
readPrec :: ReadPrec DescribeImages
$creadPrec :: ReadPrec DescribeImages
readList :: ReadS [DescribeImages]
$creadList :: ReadS [DescribeImages]
readsPrec :: Int -> ReadS DescribeImages
$creadsPrec :: Int -> ReadS DescribeImages
Prelude.Read, Int -> DescribeImages -> ShowS
[DescribeImages] -> ShowS
DescribeImages -> String
(Int -> DescribeImages -> ShowS)
-> (DescribeImages -> String)
-> ([DescribeImages] -> ShowS)
-> Show DescribeImages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeImages] -> ShowS
$cshowList :: [DescribeImages] -> ShowS
show :: DescribeImages -> String
$cshow :: DescribeImages -> String
showsPrec :: Int -> DescribeImages -> ShowS
$cshowsPrec :: Int -> DescribeImages -> ShowS
Prelude.Show, (forall x. DescribeImages -> Rep DescribeImages x)
-> (forall x. Rep DescribeImages x -> DescribeImages)
-> Generic DescribeImages
forall x. Rep DescribeImages x -> DescribeImages
forall x. DescribeImages -> Rep DescribeImages x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeImages x -> DescribeImages
$cfrom :: forall x. DescribeImages -> Rep DescribeImages x
Prelude.Generic)

-- |
-- Create a value of 'DescribeImages' 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', 'describeImages_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
--
-- 'names', 'describeImages_names' - The names of the public or private images to describe.
--
-- 'type'', 'describeImages_type' - The type of image (public, private, or shared) to describe.
--
-- 'arns', 'describeImages_arns' - The ARNs of the public, private, and shared images to describe.
--
-- 'maxResults', 'describeImages_maxResults' - The maximum size of each page of results.
newDescribeImages ::
  DescribeImages
newDescribeImages :: DescribeImages
newDescribeImages =
  DescribeImages' :: Maybe Text
-> Maybe [Text]
-> Maybe VisibilityType
-> Maybe [Text]
-> Maybe Natural
-> DescribeImages
DescribeImages'
    { $sel:nextToken:DescribeImages' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:names:DescribeImages' :: Maybe [Text]
names = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:type':DescribeImages' :: Maybe VisibilityType
type' = Maybe VisibilityType
forall a. Maybe a
Prelude.Nothing,
      $sel:arns:DescribeImages' :: Maybe [Text]
arns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeImages' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
describeImages_nextToken :: Lens.Lens' DescribeImages (Prelude.Maybe Prelude.Text)
describeImages_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeImages -> f DescribeImages
describeImages_nextToken = (DescribeImages -> Maybe Text)
-> (DescribeImages -> Maybe Text -> DescribeImages)
-> Lens DescribeImages DescribeImages (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImages' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeImages' :: DescribeImages -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeImages
s@DescribeImages' {} Maybe Text
a -> DescribeImages
s {$sel:nextToken:DescribeImages' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeImages)

-- | The names of the public or private images to describe.
describeImages_names :: Lens.Lens' DescribeImages (Prelude.Maybe [Prelude.Text])
describeImages_names :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeImages -> f DescribeImages
describeImages_names = (DescribeImages -> Maybe [Text])
-> (DescribeImages -> Maybe [Text] -> DescribeImages)
-> Lens DescribeImages DescribeImages (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImages' {Maybe [Text]
names :: Maybe [Text]
$sel:names:DescribeImages' :: DescribeImages -> Maybe [Text]
names} -> Maybe [Text]
names) (\s :: DescribeImages
s@DescribeImages' {} Maybe [Text]
a -> DescribeImages
s {$sel:names:DescribeImages' :: Maybe [Text]
names = Maybe [Text]
a} :: DescribeImages) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeImages -> f DescribeImages)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeImages
-> f DescribeImages
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of image (public, private, or shared) to describe.
describeImages_type :: Lens.Lens' DescribeImages (Prelude.Maybe VisibilityType)
describeImages_type :: (Maybe VisibilityType -> f (Maybe VisibilityType))
-> DescribeImages -> f DescribeImages
describeImages_type = (DescribeImages -> Maybe VisibilityType)
-> (DescribeImages -> Maybe VisibilityType -> DescribeImages)
-> Lens
     DescribeImages
     DescribeImages
     (Maybe VisibilityType)
     (Maybe VisibilityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImages' {Maybe VisibilityType
type' :: Maybe VisibilityType
$sel:type':DescribeImages' :: DescribeImages -> Maybe VisibilityType
type'} -> Maybe VisibilityType
type') (\s :: DescribeImages
s@DescribeImages' {} Maybe VisibilityType
a -> DescribeImages
s {$sel:type':DescribeImages' :: Maybe VisibilityType
type' = Maybe VisibilityType
a} :: DescribeImages)

-- | The ARNs of the public, private, and shared images to describe.
describeImages_arns :: Lens.Lens' DescribeImages (Prelude.Maybe [Prelude.Text])
describeImages_arns :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeImages -> f DescribeImages
describeImages_arns = (DescribeImages -> Maybe [Text])
-> (DescribeImages -> Maybe [Text] -> DescribeImages)
-> Lens DescribeImages DescribeImages (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImages' {Maybe [Text]
arns :: Maybe [Text]
$sel:arns:DescribeImages' :: DescribeImages -> Maybe [Text]
arns} -> Maybe [Text]
arns) (\s :: DescribeImages
s@DescribeImages' {} Maybe [Text]
a -> DescribeImages
s {$sel:arns:DescribeImages' :: Maybe [Text]
arns = Maybe [Text]
a} :: DescribeImages) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeImages -> f DescribeImages)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeImages
-> f DescribeImages
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum size of each page of results.
describeImages_maxResults :: Lens.Lens' DescribeImages (Prelude.Maybe Prelude.Natural)
describeImages_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeImages -> f DescribeImages
describeImages_maxResults = (DescribeImages -> Maybe Natural)
-> (DescribeImages -> Maybe Natural -> DescribeImages)
-> Lens
     DescribeImages DescribeImages (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImages' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeImages' :: DescribeImages -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeImages
s@DescribeImages' {} Maybe Natural
a -> DescribeImages
s {$sel:maxResults:DescribeImages' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeImages)

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

instance Prelude.NFData DescribeImages

instance Core.ToHeaders DescribeImages where
  toHeaders :: DescribeImages -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeImages -> 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
"PhotonAdminProxyService.DescribeImages" ::
                          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 DescribeImages where
  toJSON :: DescribeImages -> Value
toJSON DescribeImages' {Maybe Natural
Maybe [Text]
Maybe Text
Maybe VisibilityType
maxResults :: Maybe Natural
arns :: Maybe [Text]
type' :: Maybe VisibilityType
names :: Maybe [Text]
nextToken :: Maybe Text
$sel:maxResults:DescribeImages' :: DescribeImages -> Maybe Natural
$sel:arns:DescribeImages' :: DescribeImages -> Maybe [Text]
$sel:type':DescribeImages' :: DescribeImages -> Maybe VisibilityType
$sel:names:DescribeImages' :: DescribeImages -> Maybe [Text]
$sel:nextToken:DescribeImages' :: DescribeImages -> 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
"Names" 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]
names,
            (Text
"Type" Text -> VisibilityType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VisibilityType -> Pair) -> Maybe VisibilityType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VisibilityType
type',
            (Text
"Arns" 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]
arns,
            (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 DescribeImages where
  toPath :: DescribeImages -> ByteString
toPath = ByteString -> DescribeImages -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDescribeImagesResponse' smart constructor.
data DescribeImagesResponse = DescribeImagesResponse'
  { -- | Information about the images.
    DescribeImagesResponse -> Maybe [Image]
images :: Prelude.Maybe [Image],
    -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    DescribeImagesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeImagesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeImagesResponse -> DescribeImagesResponse -> Bool
(DescribeImagesResponse -> DescribeImagesResponse -> Bool)
-> (DescribeImagesResponse -> DescribeImagesResponse -> Bool)
-> Eq DescribeImagesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeImagesResponse -> DescribeImagesResponse -> Bool
$c/= :: DescribeImagesResponse -> DescribeImagesResponse -> Bool
== :: DescribeImagesResponse -> DescribeImagesResponse -> Bool
$c== :: DescribeImagesResponse -> DescribeImagesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeImagesResponse]
ReadPrec DescribeImagesResponse
Int -> ReadS DescribeImagesResponse
ReadS [DescribeImagesResponse]
(Int -> ReadS DescribeImagesResponse)
-> ReadS [DescribeImagesResponse]
-> ReadPrec DescribeImagesResponse
-> ReadPrec [DescribeImagesResponse]
-> Read DescribeImagesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeImagesResponse]
$creadListPrec :: ReadPrec [DescribeImagesResponse]
readPrec :: ReadPrec DescribeImagesResponse
$creadPrec :: ReadPrec DescribeImagesResponse
readList :: ReadS [DescribeImagesResponse]
$creadList :: ReadS [DescribeImagesResponse]
readsPrec :: Int -> ReadS DescribeImagesResponse
$creadsPrec :: Int -> ReadS DescribeImagesResponse
Prelude.Read, Int -> DescribeImagesResponse -> ShowS
[DescribeImagesResponse] -> ShowS
DescribeImagesResponse -> String
(Int -> DescribeImagesResponse -> ShowS)
-> (DescribeImagesResponse -> String)
-> ([DescribeImagesResponse] -> ShowS)
-> Show DescribeImagesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeImagesResponse] -> ShowS
$cshowList :: [DescribeImagesResponse] -> ShowS
show :: DescribeImagesResponse -> String
$cshow :: DescribeImagesResponse -> String
showsPrec :: Int -> DescribeImagesResponse -> ShowS
$cshowsPrec :: Int -> DescribeImagesResponse -> ShowS
Prelude.Show, (forall x. DescribeImagesResponse -> Rep DescribeImagesResponse x)
-> (forall x.
    Rep DescribeImagesResponse x -> DescribeImagesResponse)
-> Generic DescribeImagesResponse
forall x. Rep DescribeImagesResponse x -> DescribeImagesResponse
forall x. DescribeImagesResponse -> Rep DescribeImagesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeImagesResponse x -> DescribeImagesResponse
$cfrom :: forall x. DescribeImagesResponse -> Rep DescribeImagesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeImagesResponse' 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:
--
-- 'images', 'describeImagesResponse_images' - Information about the images.
--
-- 'nextToken', 'describeImagesResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'httpStatus', 'describeImagesResponse_httpStatus' - The response's http status code.
newDescribeImagesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeImagesResponse
newDescribeImagesResponse :: Int -> DescribeImagesResponse
newDescribeImagesResponse Int
pHttpStatus_ =
  DescribeImagesResponse' :: Maybe [Image] -> Maybe Text -> Int -> DescribeImagesResponse
DescribeImagesResponse'
    { $sel:images:DescribeImagesResponse' :: Maybe [Image]
images = Maybe [Image]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeImagesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeImagesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the images.
describeImagesResponse_images :: Lens.Lens' DescribeImagesResponse (Prelude.Maybe [Image])
describeImagesResponse_images :: (Maybe [Image] -> f (Maybe [Image]))
-> DescribeImagesResponse -> f DescribeImagesResponse
describeImagesResponse_images = (DescribeImagesResponse -> Maybe [Image])
-> (DescribeImagesResponse
    -> Maybe [Image] -> DescribeImagesResponse)
-> Lens' DescribeImagesResponse (Maybe [Image])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagesResponse' {Maybe [Image]
images :: Maybe [Image]
$sel:images:DescribeImagesResponse' :: DescribeImagesResponse -> Maybe [Image]
images} -> Maybe [Image]
images) (\s :: DescribeImagesResponse
s@DescribeImagesResponse' {} Maybe [Image]
a -> DescribeImagesResponse
s {$sel:images:DescribeImagesResponse' :: Maybe [Image]
images = Maybe [Image]
a} :: DescribeImagesResponse) ((Maybe [Image] -> f (Maybe [Image]))
 -> DescribeImagesResponse -> f DescribeImagesResponse)
-> ((Maybe [Image] -> f (Maybe [Image]))
    -> Maybe [Image] -> f (Maybe [Image]))
-> (Maybe [Image] -> f (Maybe [Image]))
-> DescribeImagesResponse
-> f DescribeImagesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Image] [Image] [Image] [Image]
-> Iso
     (Maybe [Image]) (Maybe [Image]) (Maybe [Image]) (Maybe [Image])
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 [Image] [Image] [Image] [Image]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
describeImagesResponse_nextToken :: Lens.Lens' DescribeImagesResponse (Prelude.Maybe Prelude.Text)
describeImagesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeImagesResponse -> f DescribeImagesResponse
describeImagesResponse_nextToken = (DescribeImagesResponse -> Maybe Text)
-> (DescribeImagesResponse -> Maybe Text -> DescribeImagesResponse)
-> Lens' DescribeImagesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImagesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeImagesResponse' :: DescribeImagesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeImagesResponse
s@DescribeImagesResponse' {} Maybe Text
a -> DescribeImagesResponse
s {$sel:nextToken:DescribeImagesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeImagesResponse)

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

instance Prelude.NFData DescribeImagesResponse