{-# 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.ECRPublic.DescribeImageTags
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the image tag details for a repository in a public registry.
--
-- This operation returns paginated results.
module Amazonka.ECRPublic.DescribeImageTags
  ( -- * Creating a Request
    DescribeImageTags (..),
    newDescribeImageTags,

    -- * Request Lenses
    describeImageTags_registryId,
    describeImageTags_nextToken,
    describeImageTags_maxResults,
    describeImageTags_repositoryName,

    -- * Destructuring the Response
    DescribeImageTagsResponse (..),
    newDescribeImageTagsResponse,

    -- * Response Lenses
    describeImageTagsResponse_nextToken,
    describeImageTagsResponse_imageTagDetails,
    describeImageTagsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ECRPublic.Types
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:/ 'newDescribeImageTags' smart constructor.
data DescribeImageTags = DescribeImageTags'
  { -- | The AWS account ID associated with the public registry that contains the
    -- repository in which to describe images. If you do not specify a
    -- registry, the default public registry is assumed.
    DescribeImageTags -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The @nextToken@ value returned from a previous paginated
    -- @DescribeImageTags@ request where @maxResults@ was used and the results
    -- exceeded the value of that parameter. Pagination continues from the end
    -- of the previous results that returned the @nextToken@ value. This value
    -- is @null@ when there are no more results to return. This option cannot
    -- be used when you specify images with @imageIds@.
    DescribeImageTags -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of repository results returned by @DescribeImageTags@
    -- in paginated output. When this parameter is used, @DescribeImageTags@
    -- 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 @DescribeImageTags@ request with
    -- the returned @nextToken@ value. This value can be between 1 and 1000. If
    -- this parameter is not used, then @DescribeImageTags@ returns up to 100
    -- results and a @nextToken@ value, if applicable. This option cannot be
    -- used when you specify images with @imageIds@.
    DescribeImageTags -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the repository that contains the image tag details to
    -- describe.
    DescribeImageTags -> Text
repositoryName :: Prelude.Text
  }
  deriving (DescribeImageTags -> DescribeImageTags -> Bool
(DescribeImageTags -> DescribeImageTags -> Bool)
-> (DescribeImageTags -> DescribeImageTags -> Bool)
-> Eq DescribeImageTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeImageTags -> DescribeImageTags -> Bool
$c/= :: DescribeImageTags -> DescribeImageTags -> Bool
== :: DescribeImageTags -> DescribeImageTags -> Bool
$c== :: DescribeImageTags -> DescribeImageTags -> Bool
Prelude.Eq, ReadPrec [DescribeImageTags]
ReadPrec DescribeImageTags
Int -> ReadS DescribeImageTags
ReadS [DescribeImageTags]
(Int -> ReadS DescribeImageTags)
-> ReadS [DescribeImageTags]
-> ReadPrec DescribeImageTags
-> ReadPrec [DescribeImageTags]
-> Read DescribeImageTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeImageTags]
$creadListPrec :: ReadPrec [DescribeImageTags]
readPrec :: ReadPrec DescribeImageTags
$creadPrec :: ReadPrec DescribeImageTags
readList :: ReadS [DescribeImageTags]
$creadList :: ReadS [DescribeImageTags]
readsPrec :: Int -> ReadS DescribeImageTags
$creadsPrec :: Int -> ReadS DescribeImageTags
Prelude.Read, Int -> DescribeImageTags -> ShowS
[DescribeImageTags] -> ShowS
DescribeImageTags -> String
(Int -> DescribeImageTags -> ShowS)
-> (DescribeImageTags -> String)
-> ([DescribeImageTags] -> ShowS)
-> Show DescribeImageTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeImageTags] -> ShowS
$cshowList :: [DescribeImageTags] -> ShowS
show :: DescribeImageTags -> String
$cshow :: DescribeImageTags -> String
showsPrec :: Int -> DescribeImageTags -> ShowS
$cshowsPrec :: Int -> DescribeImageTags -> ShowS
Prelude.Show, (forall x. DescribeImageTags -> Rep DescribeImageTags x)
-> (forall x. Rep DescribeImageTags x -> DescribeImageTags)
-> Generic DescribeImageTags
forall x. Rep DescribeImageTags x -> DescribeImageTags
forall x. DescribeImageTags -> Rep DescribeImageTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeImageTags x -> DescribeImageTags
$cfrom :: forall x. DescribeImageTags -> Rep DescribeImageTags x
Prelude.Generic)

-- |
-- Create a value of 'DescribeImageTags' 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:
--
-- 'registryId', 'describeImageTags_registryId' - The AWS account ID associated with the public registry that contains the
-- repository in which to describe images. If you do not specify a
-- registry, the default public registry is assumed.
--
-- 'nextToken', 'describeImageTags_nextToken' - The @nextToken@ value returned from a previous paginated
-- @DescribeImageTags@ request where @maxResults@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value. This value
-- is @null@ when there are no more results to return. This option cannot
-- be used when you specify images with @imageIds@.
--
-- 'maxResults', 'describeImageTags_maxResults' - The maximum number of repository results returned by @DescribeImageTags@
-- in paginated output. When this parameter is used, @DescribeImageTags@
-- 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 @DescribeImageTags@ request with
-- the returned @nextToken@ value. This value can be between 1 and 1000. If
-- this parameter is not used, then @DescribeImageTags@ returns up to 100
-- results and a @nextToken@ value, if applicable. This option cannot be
-- used when you specify images with @imageIds@.
--
-- 'repositoryName', 'describeImageTags_repositoryName' - The name of the repository that contains the image tag details to
-- describe.
newDescribeImageTags ::
  -- | 'repositoryName'
  Prelude.Text ->
  DescribeImageTags
newDescribeImageTags :: Text -> DescribeImageTags
newDescribeImageTags Text
pRepositoryName_ =
  DescribeImageTags' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> DescribeImageTags
DescribeImageTags'
    { $sel:registryId:DescribeImageTags' :: Maybe Text
registryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeImageTags' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeImageTags' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:DescribeImageTags' :: Text
repositoryName = Text
pRepositoryName_
    }

-- | The AWS account ID associated with the public registry that contains the
-- repository in which to describe images. If you do not specify a
-- registry, the default public registry is assumed.
describeImageTags_registryId :: Lens.Lens' DescribeImageTags (Prelude.Maybe Prelude.Text)
describeImageTags_registryId :: (Maybe Text -> f (Maybe Text))
-> DescribeImageTags -> f DescribeImageTags
describeImageTags_registryId = (DescribeImageTags -> Maybe Text)
-> (DescribeImageTags -> Maybe Text -> DescribeImageTags)
-> Lens
     DescribeImageTags DescribeImageTags (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImageTags' {Maybe Text
registryId :: Maybe Text
$sel:registryId:DescribeImageTags' :: DescribeImageTags -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: DescribeImageTags
s@DescribeImageTags' {} Maybe Text
a -> DescribeImageTags
s {$sel:registryId:DescribeImageTags' :: Maybe Text
registryId = Maybe Text
a} :: DescribeImageTags)

-- | The @nextToken@ value returned from a previous paginated
-- @DescribeImageTags@ request where @maxResults@ was used and the results
-- exceeded the value of that parameter. Pagination continues from the end
-- of the previous results that returned the @nextToken@ value. This value
-- is @null@ when there are no more results to return. This option cannot
-- be used when you specify images with @imageIds@.
describeImageTags_nextToken :: Lens.Lens' DescribeImageTags (Prelude.Maybe Prelude.Text)
describeImageTags_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeImageTags -> f DescribeImageTags
describeImageTags_nextToken = (DescribeImageTags -> Maybe Text)
-> (DescribeImageTags -> Maybe Text -> DescribeImageTags)
-> Lens
     DescribeImageTags DescribeImageTags (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImageTags' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeImageTags' :: DescribeImageTags -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeImageTags
s@DescribeImageTags' {} Maybe Text
a -> DescribeImageTags
s {$sel:nextToken:DescribeImageTags' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeImageTags)

-- | The maximum number of repository results returned by @DescribeImageTags@
-- in paginated output. When this parameter is used, @DescribeImageTags@
-- 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 @DescribeImageTags@ request with
-- the returned @nextToken@ value. This value can be between 1 and 1000. If
-- this parameter is not used, then @DescribeImageTags@ returns up to 100
-- results and a @nextToken@ value, if applicable. This option cannot be
-- used when you specify images with @imageIds@.
describeImageTags_maxResults :: Lens.Lens' DescribeImageTags (Prelude.Maybe Prelude.Natural)
describeImageTags_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeImageTags -> f DescribeImageTags
describeImageTags_maxResults = (DescribeImageTags -> Maybe Natural)
-> (DescribeImageTags -> Maybe Natural -> DescribeImageTags)
-> Lens
     DescribeImageTags DescribeImageTags (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImageTags' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeImageTags' :: DescribeImageTags -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeImageTags
s@DescribeImageTags' {} Maybe Natural
a -> DescribeImageTags
s {$sel:maxResults:DescribeImageTags' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeImageTags)

-- | The name of the repository that contains the image tag details to
-- describe.
describeImageTags_repositoryName :: Lens.Lens' DescribeImageTags Prelude.Text
describeImageTags_repositoryName :: (Text -> f Text) -> DescribeImageTags -> f DescribeImageTags
describeImageTags_repositoryName = (DescribeImageTags -> Text)
-> (DescribeImageTags -> Text -> DescribeImageTags)
-> Lens DescribeImageTags DescribeImageTags Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImageTags' {Text
repositoryName :: Text
$sel:repositoryName:DescribeImageTags' :: DescribeImageTags -> Text
repositoryName} -> Text
repositoryName) (\s :: DescribeImageTags
s@DescribeImageTags' {} Text
a -> DescribeImageTags
s {$sel:repositoryName:DescribeImageTags' :: Text
repositoryName = Text
a} :: DescribeImageTags)

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

instance Prelude.NFData DescribeImageTags

instance Core.ToHeaders DescribeImageTags where
  toHeaders :: DescribeImageTags -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeImageTags -> 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
"SpencerFrontendService.DescribeImageTags" ::
                          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 DescribeImageTags where
  toJSON :: DescribeImageTags -> Value
toJSON DescribeImageTags' {Maybe Natural
Maybe Text
Text
repositoryName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
registryId :: Maybe Text
$sel:repositoryName:DescribeImageTags' :: DescribeImageTags -> Text
$sel:maxResults:DescribeImageTags' :: DescribeImageTags -> Maybe Natural
$sel:nextToken:DescribeImageTags' :: DescribeImageTags -> Maybe Text
$sel:registryId:DescribeImageTags' :: DescribeImageTags -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"registryId" 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
registryId,
            (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName)
          ]
      )

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

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

-- | /See:/ 'newDescribeImageTagsResponse' smart constructor.
data DescribeImageTagsResponse = DescribeImageTagsResponse'
  { -- | The @nextToken@ value to include in a future @DescribeImageTags@
    -- request. When the results of a @DescribeImageTags@ 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.
    DescribeImageTagsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The image tag details for the images in the requested repository.
    DescribeImageTagsResponse -> Maybe [ImageTagDetail]
imageTagDetails :: Prelude.Maybe [ImageTagDetail],
    -- | The response's http status code.
    DescribeImageTagsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeImageTagsResponse -> DescribeImageTagsResponse -> Bool
(DescribeImageTagsResponse -> DescribeImageTagsResponse -> Bool)
-> (DescribeImageTagsResponse -> DescribeImageTagsResponse -> Bool)
-> Eq DescribeImageTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeImageTagsResponse -> DescribeImageTagsResponse -> Bool
$c/= :: DescribeImageTagsResponse -> DescribeImageTagsResponse -> Bool
== :: DescribeImageTagsResponse -> DescribeImageTagsResponse -> Bool
$c== :: DescribeImageTagsResponse -> DescribeImageTagsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeImageTagsResponse]
ReadPrec DescribeImageTagsResponse
Int -> ReadS DescribeImageTagsResponse
ReadS [DescribeImageTagsResponse]
(Int -> ReadS DescribeImageTagsResponse)
-> ReadS [DescribeImageTagsResponse]
-> ReadPrec DescribeImageTagsResponse
-> ReadPrec [DescribeImageTagsResponse]
-> Read DescribeImageTagsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeImageTagsResponse]
$creadListPrec :: ReadPrec [DescribeImageTagsResponse]
readPrec :: ReadPrec DescribeImageTagsResponse
$creadPrec :: ReadPrec DescribeImageTagsResponse
readList :: ReadS [DescribeImageTagsResponse]
$creadList :: ReadS [DescribeImageTagsResponse]
readsPrec :: Int -> ReadS DescribeImageTagsResponse
$creadsPrec :: Int -> ReadS DescribeImageTagsResponse
Prelude.Read, Int -> DescribeImageTagsResponse -> ShowS
[DescribeImageTagsResponse] -> ShowS
DescribeImageTagsResponse -> String
(Int -> DescribeImageTagsResponse -> ShowS)
-> (DescribeImageTagsResponse -> String)
-> ([DescribeImageTagsResponse] -> ShowS)
-> Show DescribeImageTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeImageTagsResponse] -> ShowS
$cshowList :: [DescribeImageTagsResponse] -> ShowS
show :: DescribeImageTagsResponse -> String
$cshow :: DescribeImageTagsResponse -> String
showsPrec :: Int -> DescribeImageTagsResponse -> ShowS
$cshowsPrec :: Int -> DescribeImageTagsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeImageTagsResponse -> Rep DescribeImageTagsResponse x)
-> (forall x.
    Rep DescribeImageTagsResponse x -> DescribeImageTagsResponse)
-> Generic DescribeImageTagsResponse
forall x.
Rep DescribeImageTagsResponse x -> DescribeImageTagsResponse
forall x.
DescribeImageTagsResponse -> Rep DescribeImageTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeImageTagsResponse x -> DescribeImageTagsResponse
$cfrom :: forall x.
DescribeImageTagsResponse -> Rep DescribeImageTagsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeImageTagsResponse' 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', 'describeImageTagsResponse_nextToken' - The @nextToken@ value to include in a future @DescribeImageTags@
-- request. When the results of a @DescribeImageTags@ 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.
--
-- 'imageTagDetails', 'describeImageTagsResponse_imageTagDetails' - The image tag details for the images in the requested repository.
--
-- 'httpStatus', 'describeImageTagsResponse_httpStatus' - The response's http status code.
newDescribeImageTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeImageTagsResponse
newDescribeImageTagsResponse :: Int -> DescribeImageTagsResponse
newDescribeImageTagsResponse Int
pHttpStatus_ =
  DescribeImageTagsResponse' :: Maybe Text
-> Maybe [ImageTagDetail] -> Int -> DescribeImageTagsResponse
DescribeImageTagsResponse'
    { $sel:nextToken:DescribeImageTagsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageTagDetails:DescribeImageTagsResponse' :: Maybe [ImageTagDetail]
imageTagDetails = Maybe [ImageTagDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeImageTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The @nextToken@ value to include in a future @DescribeImageTags@
-- request. When the results of a @DescribeImageTags@ 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.
describeImageTagsResponse_nextToken :: Lens.Lens' DescribeImageTagsResponse (Prelude.Maybe Prelude.Text)
describeImageTagsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeImageTagsResponse -> f DescribeImageTagsResponse
describeImageTagsResponse_nextToken = (DescribeImageTagsResponse -> Maybe Text)
-> (DescribeImageTagsResponse
    -> Maybe Text -> DescribeImageTagsResponse)
-> Lens' DescribeImageTagsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImageTagsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeImageTagsResponse' :: DescribeImageTagsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeImageTagsResponse
s@DescribeImageTagsResponse' {} Maybe Text
a -> DescribeImageTagsResponse
s {$sel:nextToken:DescribeImageTagsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeImageTagsResponse)

-- | The image tag details for the images in the requested repository.
describeImageTagsResponse_imageTagDetails :: Lens.Lens' DescribeImageTagsResponse (Prelude.Maybe [ImageTagDetail])
describeImageTagsResponse_imageTagDetails :: (Maybe [ImageTagDetail] -> f (Maybe [ImageTagDetail]))
-> DescribeImageTagsResponse -> f DescribeImageTagsResponse
describeImageTagsResponse_imageTagDetails = (DescribeImageTagsResponse -> Maybe [ImageTagDetail])
-> (DescribeImageTagsResponse
    -> Maybe [ImageTagDetail] -> DescribeImageTagsResponse)
-> Lens' DescribeImageTagsResponse (Maybe [ImageTagDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeImageTagsResponse' {Maybe [ImageTagDetail]
imageTagDetails :: Maybe [ImageTagDetail]
$sel:imageTagDetails:DescribeImageTagsResponse' :: DescribeImageTagsResponse -> Maybe [ImageTagDetail]
imageTagDetails} -> Maybe [ImageTagDetail]
imageTagDetails) (\s :: DescribeImageTagsResponse
s@DescribeImageTagsResponse' {} Maybe [ImageTagDetail]
a -> DescribeImageTagsResponse
s {$sel:imageTagDetails:DescribeImageTagsResponse' :: Maybe [ImageTagDetail]
imageTagDetails = Maybe [ImageTagDetail]
a} :: DescribeImageTagsResponse) ((Maybe [ImageTagDetail] -> f (Maybe [ImageTagDetail]))
 -> DescribeImageTagsResponse -> f DescribeImageTagsResponse)
-> ((Maybe [ImageTagDetail] -> f (Maybe [ImageTagDetail]))
    -> Maybe [ImageTagDetail] -> f (Maybe [ImageTagDetail]))
-> (Maybe [ImageTagDetail] -> f (Maybe [ImageTagDetail]))
-> DescribeImageTagsResponse
-> f DescribeImageTagsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ImageTagDetail] [ImageTagDetail] [ImageTagDetail] [ImageTagDetail]
-> Iso
     (Maybe [ImageTagDetail])
     (Maybe [ImageTagDetail])
     (Maybe [ImageTagDetail])
     (Maybe [ImageTagDetail])
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
  [ImageTagDetail] [ImageTagDetail] [ImageTagDetail] [ImageTagDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeImageTagsResponse