{-# 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.ECR.GetLifecyclePolicyPreview
-- 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 the results of the lifecycle policy preview request for the
-- specified repository.
--
-- This operation returns paginated results.
module Amazonka.ECR.GetLifecyclePolicyPreview
  ( -- * Creating a Request
    GetLifecyclePolicyPreview (..),
    newGetLifecyclePolicyPreview,

    -- * Request Lenses
    getLifecyclePolicyPreview_registryId,
    getLifecyclePolicyPreview_imageIds,
    getLifecyclePolicyPreview_nextToken,
    getLifecyclePolicyPreview_filter,
    getLifecyclePolicyPreview_maxResults,
    getLifecyclePolicyPreview_repositoryName,

    -- * Destructuring the Response
    GetLifecyclePolicyPreviewResponse (..),
    newGetLifecyclePolicyPreviewResponse,

    -- * Response Lenses
    getLifecyclePolicyPreviewResponse_summary,
    getLifecyclePolicyPreviewResponse_status,
    getLifecyclePolicyPreviewResponse_registryId,
    getLifecyclePolicyPreviewResponse_lifecyclePolicyText,
    getLifecyclePolicyPreviewResponse_nextToken,
    getLifecyclePolicyPreviewResponse_repositoryName,
    getLifecyclePolicyPreviewResponse_previewResults,
    getLifecyclePolicyPreviewResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ECR.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:/ 'newGetLifecyclePolicyPreview' smart constructor.
data GetLifecyclePolicyPreview = GetLifecyclePolicyPreview'
  { -- | The Amazon Web Services account ID associated with the registry that
    -- contains the repository. If you do not specify a registry, the default
    -- registry is assumed.
    GetLifecyclePolicyPreview -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The list of imageIDs to be included.
    GetLifecyclePolicyPreview -> Maybe [ImageIdentifier]
imageIds :: Prelude.Maybe [ImageIdentifier],
    -- | The @nextToken@ value returned from a previous paginated

    -- @GetLifecyclePolicyPreviewRequest@ 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@.
    GetLifecyclePolicyPreview -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An optional parameter that filters results based on image tag status and
    -- all tags, if tagged.
    GetLifecyclePolicyPreview -> Maybe LifecyclePolicyPreviewFilter
filter' :: Prelude.Maybe LifecyclePolicyPreviewFilter,
    -- | The maximum number of repository results returned by
    -- @GetLifecyclePolicyPreviewRequest@ in
 paginated output. When this
    -- parameter is used, @GetLifecyclePolicyPreviewRequest@ 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 @GetLifecyclePolicyPreviewRequest@ request with the
    -- returned @nextToken@
 value. This value can be between 1 and 1000. If
    -- this
 parameter is not used, then @GetLifecyclePolicyPreviewRequest@
    -- returns up to
 100 results and a @nextToken@ value, if
 applicable. This
    -- option cannot be used when you specify images with @imageIds@.
    GetLifecyclePolicyPreview -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the repository.
    GetLifecyclePolicyPreview -> Text
repositoryName :: Prelude.Text
  }
  deriving (GetLifecyclePolicyPreview -> GetLifecyclePolicyPreview -> Bool
(GetLifecyclePolicyPreview -> GetLifecyclePolicyPreview -> Bool)
-> (GetLifecyclePolicyPreview -> GetLifecyclePolicyPreview -> Bool)
-> Eq GetLifecyclePolicyPreview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLifecyclePolicyPreview -> GetLifecyclePolicyPreview -> Bool
$c/= :: GetLifecyclePolicyPreview -> GetLifecyclePolicyPreview -> Bool
== :: GetLifecyclePolicyPreview -> GetLifecyclePolicyPreview -> Bool
$c== :: GetLifecyclePolicyPreview -> GetLifecyclePolicyPreview -> Bool
Prelude.Eq, ReadPrec [GetLifecyclePolicyPreview]
ReadPrec GetLifecyclePolicyPreview
Int -> ReadS GetLifecyclePolicyPreview
ReadS [GetLifecyclePolicyPreview]
(Int -> ReadS GetLifecyclePolicyPreview)
-> ReadS [GetLifecyclePolicyPreview]
-> ReadPrec GetLifecyclePolicyPreview
-> ReadPrec [GetLifecyclePolicyPreview]
-> Read GetLifecyclePolicyPreview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLifecyclePolicyPreview]
$creadListPrec :: ReadPrec [GetLifecyclePolicyPreview]
readPrec :: ReadPrec GetLifecyclePolicyPreview
$creadPrec :: ReadPrec GetLifecyclePolicyPreview
readList :: ReadS [GetLifecyclePolicyPreview]
$creadList :: ReadS [GetLifecyclePolicyPreview]
readsPrec :: Int -> ReadS GetLifecyclePolicyPreview
$creadsPrec :: Int -> ReadS GetLifecyclePolicyPreview
Prelude.Read, Int -> GetLifecyclePolicyPreview -> ShowS
[GetLifecyclePolicyPreview] -> ShowS
GetLifecyclePolicyPreview -> String
(Int -> GetLifecyclePolicyPreview -> ShowS)
-> (GetLifecyclePolicyPreview -> String)
-> ([GetLifecyclePolicyPreview] -> ShowS)
-> Show GetLifecyclePolicyPreview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLifecyclePolicyPreview] -> ShowS
$cshowList :: [GetLifecyclePolicyPreview] -> ShowS
show :: GetLifecyclePolicyPreview -> String
$cshow :: GetLifecyclePolicyPreview -> String
showsPrec :: Int -> GetLifecyclePolicyPreview -> ShowS
$cshowsPrec :: Int -> GetLifecyclePolicyPreview -> ShowS
Prelude.Show, (forall x.
 GetLifecyclePolicyPreview -> Rep GetLifecyclePolicyPreview x)
-> (forall x.
    Rep GetLifecyclePolicyPreview x -> GetLifecyclePolicyPreview)
-> Generic GetLifecyclePolicyPreview
forall x.
Rep GetLifecyclePolicyPreview x -> GetLifecyclePolicyPreview
forall x.
GetLifecyclePolicyPreview -> Rep GetLifecyclePolicyPreview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLifecyclePolicyPreview x -> GetLifecyclePolicyPreview
$cfrom :: forall x.
GetLifecyclePolicyPreview -> Rep GetLifecyclePolicyPreview x
Prelude.Generic)

-- |
-- Create a value of 'GetLifecyclePolicyPreview' 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', 'getLifecyclePolicyPreview_registryId' - The Amazon Web Services account ID associated with the registry that
-- contains the repository. If you do not specify a registry, the default
-- registry is assumed.
--
-- 'imageIds', 'getLifecyclePolicyPreview_imageIds' - The list of imageIDs to be included.
--
-- 'nextToken', 'getLifecyclePolicyPreview_nextToken' - The @nextToken@ value returned from a previous paginated

-- @GetLifecyclePolicyPreviewRequest@ 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@.
--
-- 'filter'', 'getLifecyclePolicyPreview_filter' - An optional parameter that filters results based on image tag status and
-- all tags, if tagged.
--
-- 'maxResults', 'getLifecyclePolicyPreview_maxResults' - The maximum number of repository results returned by
-- @GetLifecyclePolicyPreviewRequest@ in
 paginated output. When this
-- parameter is used, @GetLifecyclePolicyPreviewRequest@ 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 @GetLifecyclePolicyPreviewRequest@ request with the
-- returned @nextToken@
 value. This value can be between 1 and 1000. If
-- this
 parameter is not used, then @GetLifecyclePolicyPreviewRequest@
-- returns up to
 100 results and a @nextToken@ value, if
 applicable. This
-- option cannot be used when you specify images with @imageIds@.
--
-- 'repositoryName', 'getLifecyclePolicyPreview_repositoryName' - The name of the repository.
newGetLifecyclePolicyPreview ::
  -- | 'repositoryName'
  Prelude.Text ->
  GetLifecyclePolicyPreview
newGetLifecyclePolicyPreview :: Text -> GetLifecyclePolicyPreview
newGetLifecyclePolicyPreview Text
pRepositoryName_ =
  GetLifecyclePolicyPreview' :: Maybe Text
-> Maybe [ImageIdentifier]
-> Maybe Text
-> Maybe LifecyclePolicyPreviewFilter
-> Maybe Natural
-> Text
-> GetLifecyclePolicyPreview
GetLifecyclePolicyPreview'
    { $sel:registryId:GetLifecyclePolicyPreview' :: Maybe Text
registryId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageIds:GetLifecyclePolicyPreview' :: Maybe [ImageIdentifier]
imageIds = Maybe [ImageIdentifier]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetLifecyclePolicyPreview' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':GetLifecyclePolicyPreview' :: Maybe LifecyclePolicyPreviewFilter
filter' = Maybe LifecyclePolicyPreviewFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetLifecyclePolicyPreview' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:GetLifecyclePolicyPreview' :: Text
repositoryName = Text
pRepositoryName_
    }

-- | The Amazon Web Services account ID associated with the registry that
-- contains the repository. If you do not specify a registry, the default
-- registry is assumed.
getLifecyclePolicyPreview_registryId :: Lens.Lens' GetLifecyclePolicyPreview (Prelude.Maybe Prelude.Text)
getLifecyclePolicyPreview_registryId :: (Maybe Text -> f (Maybe Text))
-> GetLifecyclePolicyPreview -> f GetLifecyclePolicyPreview
getLifecyclePolicyPreview_registryId = (GetLifecyclePolicyPreview -> Maybe Text)
-> (GetLifecyclePolicyPreview
    -> Maybe Text -> GetLifecyclePolicyPreview)
-> Lens
     GetLifecyclePolicyPreview
     GetLifecyclePolicyPreview
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreview' {Maybe Text
registryId :: Maybe Text
$sel:registryId:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: GetLifecyclePolicyPreview
s@GetLifecyclePolicyPreview' {} Maybe Text
a -> GetLifecyclePolicyPreview
s {$sel:registryId:GetLifecyclePolicyPreview' :: Maybe Text
registryId = Maybe Text
a} :: GetLifecyclePolicyPreview)

-- | The list of imageIDs to be included.
getLifecyclePolicyPreview_imageIds :: Lens.Lens' GetLifecyclePolicyPreview (Prelude.Maybe [ImageIdentifier])
getLifecyclePolicyPreview_imageIds :: (Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
-> GetLifecyclePolicyPreview -> f GetLifecyclePolicyPreview
getLifecyclePolicyPreview_imageIds = (GetLifecyclePolicyPreview -> Maybe [ImageIdentifier])
-> (GetLifecyclePolicyPreview
    -> Maybe [ImageIdentifier] -> GetLifecyclePolicyPreview)
-> Lens
     GetLifecyclePolicyPreview
     GetLifecyclePolicyPreview
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreview' {Maybe [ImageIdentifier]
imageIds :: Maybe [ImageIdentifier]
$sel:imageIds:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe [ImageIdentifier]
imageIds} -> Maybe [ImageIdentifier]
imageIds) (\s :: GetLifecyclePolicyPreview
s@GetLifecyclePolicyPreview' {} Maybe [ImageIdentifier]
a -> GetLifecyclePolicyPreview
s {$sel:imageIds:GetLifecyclePolicyPreview' :: Maybe [ImageIdentifier]
imageIds = Maybe [ImageIdentifier]
a} :: GetLifecyclePolicyPreview) ((Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
 -> GetLifecyclePolicyPreview -> f GetLifecyclePolicyPreview)
-> ((Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
    -> Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
-> (Maybe [ImageIdentifier] -> f (Maybe [ImageIdentifier]))
-> GetLifecyclePolicyPreview
-> f GetLifecyclePolicyPreview
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
-> Iso
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
     (Maybe [ImageIdentifier])
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
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
  [ImageIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @nextToken@ value returned from a previous paginated

-- @GetLifecyclePolicyPreviewRequest@ 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@.
getLifecyclePolicyPreview_nextToken :: Lens.Lens' GetLifecyclePolicyPreview (Prelude.Maybe Prelude.Text)
getLifecyclePolicyPreview_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetLifecyclePolicyPreview -> f GetLifecyclePolicyPreview
getLifecyclePolicyPreview_nextToken = (GetLifecyclePolicyPreview -> Maybe Text)
-> (GetLifecyclePolicyPreview
    -> Maybe Text -> GetLifecyclePolicyPreview)
-> Lens
     GetLifecyclePolicyPreview
     GetLifecyclePolicyPreview
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreview' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetLifecyclePolicyPreview
s@GetLifecyclePolicyPreview' {} Maybe Text
a -> GetLifecyclePolicyPreview
s {$sel:nextToken:GetLifecyclePolicyPreview' :: Maybe Text
nextToken = Maybe Text
a} :: GetLifecyclePolicyPreview)

-- | An optional parameter that filters results based on image tag status and
-- all tags, if tagged.
getLifecyclePolicyPreview_filter :: Lens.Lens' GetLifecyclePolicyPreview (Prelude.Maybe LifecyclePolicyPreviewFilter)
getLifecyclePolicyPreview_filter :: (Maybe LifecyclePolicyPreviewFilter
 -> f (Maybe LifecyclePolicyPreviewFilter))
-> GetLifecyclePolicyPreview -> f GetLifecyclePolicyPreview
getLifecyclePolicyPreview_filter = (GetLifecyclePolicyPreview -> Maybe LifecyclePolicyPreviewFilter)
-> (GetLifecyclePolicyPreview
    -> Maybe LifecyclePolicyPreviewFilter -> GetLifecyclePolicyPreview)
-> Lens
     GetLifecyclePolicyPreview
     GetLifecyclePolicyPreview
     (Maybe LifecyclePolicyPreviewFilter)
     (Maybe LifecyclePolicyPreviewFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreview' {Maybe LifecyclePolicyPreviewFilter
filter' :: Maybe LifecyclePolicyPreviewFilter
$sel:filter':GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe LifecyclePolicyPreviewFilter
filter'} -> Maybe LifecyclePolicyPreviewFilter
filter') (\s :: GetLifecyclePolicyPreview
s@GetLifecyclePolicyPreview' {} Maybe LifecyclePolicyPreviewFilter
a -> GetLifecyclePolicyPreview
s {$sel:filter':GetLifecyclePolicyPreview' :: Maybe LifecyclePolicyPreviewFilter
filter' = Maybe LifecyclePolicyPreviewFilter
a} :: GetLifecyclePolicyPreview)

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

-- | The name of the repository.
getLifecyclePolicyPreview_repositoryName :: Lens.Lens' GetLifecyclePolicyPreview Prelude.Text
getLifecyclePolicyPreview_repositoryName :: (Text -> f Text)
-> GetLifecyclePolicyPreview -> f GetLifecyclePolicyPreview
getLifecyclePolicyPreview_repositoryName = (GetLifecyclePolicyPreview -> Text)
-> (GetLifecyclePolicyPreview -> Text -> GetLifecyclePolicyPreview)
-> Lens
     GetLifecyclePolicyPreview GetLifecyclePolicyPreview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreview' {Text
repositoryName :: Text
$sel:repositoryName:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Text
repositoryName} -> Text
repositoryName) (\s :: GetLifecyclePolicyPreview
s@GetLifecyclePolicyPreview' {} Text
a -> GetLifecyclePolicyPreview
s {$sel:repositoryName:GetLifecyclePolicyPreview' :: Text
repositoryName = Text
a} :: GetLifecyclePolicyPreview)

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

instance Prelude.NFData GetLifecyclePolicyPreview

instance Core.ToHeaders GetLifecyclePolicyPreview where
  toHeaders :: GetLifecyclePolicyPreview -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetLifecyclePolicyPreview -> 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
"AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview" ::
                          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 GetLifecyclePolicyPreview where
  toJSON :: GetLifecyclePolicyPreview -> Value
toJSON GetLifecyclePolicyPreview' {Maybe Natural
Maybe [ImageIdentifier]
Maybe Text
Maybe LifecyclePolicyPreviewFilter
Text
repositoryName :: Text
maxResults :: Maybe Natural
filter' :: Maybe LifecyclePolicyPreviewFilter
nextToken :: Maybe Text
imageIds :: Maybe [ImageIdentifier]
registryId :: Maybe Text
$sel:repositoryName:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Text
$sel:maxResults:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe Natural
$sel:filter':GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe LifecyclePolicyPreviewFilter
$sel:nextToken:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe Text
$sel:imageIds:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> Maybe [ImageIdentifier]
$sel:registryId:GetLifecyclePolicyPreview' :: GetLifecyclePolicyPreview -> 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
"imageIds" Text -> [ImageIdentifier] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ImageIdentifier] -> Pair)
-> Maybe [ImageIdentifier] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ImageIdentifier]
imageIds,
            (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
"filter" Text -> LifecyclePolicyPreviewFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LifecyclePolicyPreviewFilter -> Pair)
-> Maybe LifecyclePolicyPreviewFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LifecyclePolicyPreviewFilter
filter',
            (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 GetLifecyclePolicyPreview where
  toPath :: GetLifecyclePolicyPreview -> ByteString
toPath = ByteString -> GetLifecyclePolicyPreview -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetLifecyclePolicyPreviewResponse' smart constructor.
data GetLifecyclePolicyPreviewResponse = GetLifecyclePolicyPreviewResponse'
  { -- | The list of images that is returned as a result of the action.
    GetLifecyclePolicyPreviewResponse
-> Maybe LifecyclePolicyPreviewSummary
summary :: Prelude.Maybe LifecyclePolicyPreviewSummary,
    -- | The status of the lifecycle policy preview request.
    GetLifecyclePolicyPreviewResponse
-> Maybe LifecyclePolicyPreviewStatus
status :: Prelude.Maybe LifecyclePolicyPreviewStatus,
    -- | The registry ID associated with the request.
    GetLifecyclePolicyPreviewResponse -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The JSON lifecycle policy text.
    GetLifecyclePolicyPreviewResponse -> Maybe Text
lifecyclePolicyText :: Prelude.Maybe Prelude.Text,
    -- | The @nextToken@ value to include in a future @GetLifecyclePolicyPreview@
    -- request. When the results of a @GetLifecyclePolicyPreview@ 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.
    GetLifecyclePolicyPreviewResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The repository name associated with the request.
    GetLifecyclePolicyPreviewResponse -> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
    -- | The results of the lifecycle policy preview request.
    GetLifecyclePolicyPreviewResponse
-> Maybe [LifecyclePolicyPreviewResult]
previewResults :: Prelude.Maybe [LifecyclePolicyPreviewResult],
    -- | The response's http status code.
    GetLifecyclePolicyPreviewResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetLifecyclePolicyPreviewResponse
-> GetLifecyclePolicyPreviewResponse -> Bool
(GetLifecyclePolicyPreviewResponse
 -> GetLifecyclePolicyPreviewResponse -> Bool)
-> (GetLifecyclePolicyPreviewResponse
    -> GetLifecyclePolicyPreviewResponse -> Bool)
-> Eq GetLifecyclePolicyPreviewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLifecyclePolicyPreviewResponse
-> GetLifecyclePolicyPreviewResponse -> Bool
$c/= :: GetLifecyclePolicyPreviewResponse
-> GetLifecyclePolicyPreviewResponse -> Bool
== :: GetLifecyclePolicyPreviewResponse
-> GetLifecyclePolicyPreviewResponse -> Bool
$c== :: GetLifecyclePolicyPreviewResponse
-> GetLifecyclePolicyPreviewResponse -> Bool
Prelude.Eq, ReadPrec [GetLifecyclePolicyPreviewResponse]
ReadPrec GetLifecyclePolicyPreviewResponse
Int -> ReadS GetLifecyclePolicyPreviewResponse
ReadS [GetLifecyclePolicyPreviewResponse]
(Int -> ReadS GetLifecyclePolicyPreviewResponse)
-> ReadS [GetLifecyclePolicyPreviewResponse]
-> ReadPrec GetLifecyclePolicyPreviewResponse
-> ReadPrec [GetLifecyclePolicyPreviewResponse]
-> Read GetLifecyclePolicyPreviewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLifecyclePolicyPreviewResponse]
$creadListPrec :: ReadPrec [GetLifecyclePolicyPreviewResponse]
readPrec :: ReadPrec GetLifecyclePolicyPreviewResponse
$creadPrec :: ReadPrec GetLifecyclePolicyPreviewResponse
readList :: ReadS [GetLifecyclePolicyPreviewResponse]
$creadList :: ReadS [GetLifecyclePolicyPreviewResponse]
readsPrec :: Int -> ReadS GetLifecyclePolicyPreviewResponse
$creadsPrec :: Int -> ReadS GetLifecyclePolicyPreviewResponse
Prelude.Read, Int -> GetLifecyclePolicyPreviewResponse -> ShowS
[GetLifecyclePolicyPreviewResponse] -> ShowS
GetLifecyclePolicyPreviewResponse -> String
(Int -> GetLifecyclePolicyPreviewResponse -> ShowS)
-> (GetLifecyclePolicyPreviewResponse -> String)
-> ([GetLifecyclePolicyPreviewResponse] -> ShowS)
-> Show GetLifecyclePolicyPreviewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLifecyclePolicyPreviewResponse] -> ShowS
$cshowList :: [GetLifecyclePolicyPreviewResponse] -> ShowS
show :: GetLifecyclePolicyPreviewResponse -> String
$cshow :: GetLifecyclePolicyPreviewResponse -> String
showsPrec :: Int -> GetLifecyclePolicyPreviewResponse -> ShowS
$cshowsPrec :: Int -> GetLifecyclePolicyPreviewResponse -> ShowS
Prelude.Show, (forall x.
 GetLifecyclePolicyPreviewResponse
 -> Rep GetLifecyclePolicyPreviewResponse x)
-> (forall x.
    Rep GetLifecyclePolicyPreviewResponse x
    -> GetLifecyclePolicyPreviewResponse)
-> Generic GetLifecyclePolicyPreviewResponse
forall x.
Rep GetLifecyclePolicyPreviewResponse x
-> GetLifecyclePolicyPreviewResponse
forall x.
GetLifecyclePolicyPreviewResponse
-> Rep GetLifecyclePolicyPreviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLifecyclePolicyPreviewResponse x
-> GetLifecyclePolicyPreviewResponse
$cfrom :: forall x.
GetLifecyclePolicyPreviewResponse
-> Rep GetLifecyclePolicyPreviewResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetLifecyclePolicyPreviewResponse' 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:
--
-- 'summary', 'getLifecyclePolicyPreviewResponse_summary' - The list of images that is returned as a result of the action.
--
-- 'status', 'getLifecyclePolicyPreviewResponse_status' - The status of the lifecycle policy preview request.
--
-- 'registryId', 'getLifecyclePolicyPreviewResponse_registryId' - The registry ID associated with the request.
--
-- 'lifecyclePolicyText', 'getLifecyclePolicyPreviewResponse_lifecyclePolicyText' - The JSON lifecycle policy text.
--
-- 'nextToken', 'getLifecyclePolicyPreviewResponse_nextToken' - The @nextToken@ value to include in a future @GetLifecyclePolicyPreview@
-- request. When the results of a @GetLifecyclePolicyPreview@ 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.
--
-- 'repositoryName', 'getLifecyclePolicyPreviewResponse_repositoryName' - The repository name associated with the request.
--
-- 'previewResults', 'getLifecyclePolicyPreviewResponse_previewResults' - The results of the lifecycle policy preview request.
--
-- 'httpStatus', 'getLifecyclePolicyPreviewResponse_httpStatus' - The response's http status code.
newGetLifecyclePolicyPreviewResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetLifecyclePolicyPreviewResponse
newGetLifecyclePolicyPreviewResponse :: Int -> GetLifecyclePolicyPreviewResponse
newGetLifecyclePolicyPreviewResponse Int
pHttpStatus_ =
  GetLifecyclePolicyPreviewResponse' :: Maybe LifecyclePolicyPreviewSummary
-> Maybe LifecyclePolicyPreviewStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [LifecyclePolicyPreviewResult]
-> Int
-> GetLifecyclePolicyPreviewResponse
GetLifecyclePolicyPreviewResponse'
    { $sel:summary:GetLifecyclePolicyPreviewResponse' :: Maybe LifecyclePolicyPreviewSummary
summary =
        Maybe LifecyclePolicyPreviewSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:status:GetLifecyclePolicyPreviewResponse' :: Maybe LifecyclePolicyPreviewStatus
status = Maybe LifecyclePolicyPreviewStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:registryId:GetLifecyclePolicyPreviewResponse' :: Maybe Text
registryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lifecyclePolicyText:GetLifecyclePolicyPreviewResponse' :: Maybe Text
lifecyclePolicyText = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetLifecyclePolicyPreviewResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:GetLifecyclePolicyPreviewResponse' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:previewResults:GetLifecyclePolicyPreviewResponse' :: Maybe [LifecyclePolicyPreviewResult]
previewResults = Maybe [LifecyclePolicyPreviewResult]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetLifecyclePolicyPreviewResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of images that is returned as a result of the action.
getLifecyclePolicyPreviewResponse_summary :: Lens.Lens' GetLifecyclePolicyPreviewResponse (Prelude.Maybe LifecyclePolicyPreviewSummary)
getLifecyclePolicyPreviewResponse_summary :: (Maybe LifecyclePolicyPreviewSummary
 -> f (Maybe LifecyclePolicyPreviewSummary))
-> GetLifecyclePolicyPreviewResponse
-> f GetLifecyclePolicyPreviewResponse
getLifecyclePolicyPreviewResponse_summary = (GetLifecyclePolicyPreviewResponse
 -> Maybe LifecyclePolicyPreviewSummary)
-> (GetLifecyclePolicyPreviewResponse
    -> Maybe LifecyclePolicyPreviewSummary
    -> GetLifecyclePolicyPreviewResponse)
-> Lens
     GetLifecyclePolicyPreviewResponse
     GetLifecyclePolicyPreviewResponse
     (Maybe LifecyclePolicyPreviewSummary)
     (Maybe LifecyclePolicyPreviewSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreviewResponse' {Maybe LifecyclePolicyPreviewSummary
summary :: Maybe LifecyclePolicyPreviewSummary
$sel:summary:GetLifecyclePolicyPreviewResponse' :: GetLifecyclePolicyPreviewResponse
-> Maybe LifecyclePolicyPreviewSummary
summary} -> Maybe LifecyclePolicyPreviewSummary
summary) (\s :: GetLifecyclePolicyPreviewResponse
s@GetLifecyclePolicyPreviewResponse' {} Maybe LifecyclePolicyPreviewSummary
a -> GetLifecyclePolicyPreviewResponse
s {$sel:summary:GetLifecyclePolicyPreviewResponse' :: Maybe LifecyclePolicyPreviewSummary
summary = Maybe LifecyclePolicyPreviewSummary
a} :: GetLifecyclePolicyPreviewResponse)

-- | The status of the lifecycle policy preview request.
getLifecyclePolicyPreviewResponse_status :: Lens.Lens' GetLifecyclePolicyPreviewResponse (Prelude.Maybe LifecyclePolicyPreviewStatus)
getLifecyclePolicyPreviewResponse_status :: (Maybe LifecyclePolicyPreviewStatus
 -> f (Maybe LifecyclePolicyPreviewStatus))
-> GetLifecyclePolicyPreviewResponse
-> f GetLifecyclePolicyPreviewResponse
getLifecyclePolicyPreviewResponse_status = (GetLifecyclePolicyPreviewResponse
 -> Maybe LifecyclePolicyPreviewStatus)
-> (GetLifecyclePolicyPreviewResponse
    -> Maybe LifecyclePolicyPreviewStatus
    -> GetLifecyclePolicyPreviewResponse)
-> Lens
     GetLifecyclePolicyPreviewResponse
     GetLifecyclePolicyPreviewResponse
     (Maybe LifecyclePolicyPreviewStatus)
     (Maybe LifecyclePolicyPreviewStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreviewResponse' {Maybe LifecyclePolicyPreviewStatus
status :: Maybe LifecyclePolicyPreviewStatus
$sel:status:GetLifecyclePolicyPreviewResponse' :: GetLifecyclePolicyPreviewResponse
-> Maybe LifecyclePolicyPreviewStatus
status} -> Maybe LifecyclePolicyPreviewStatus
status) (\s :: GetLifecyclePolicyPreviewResponse
s@GetLifecyclePolicyPreviewResponse' {} Maybe LifecyclePolicyPreviewStatus
a -> GetLifecyclePolicyPreviewResponse
s {$sel:status:GetLifecyclePolicyPreviewResponse' :: Maybe LifecyclePolicyPreviewStatus
status = Maybe LifecyclePolicyPreviewStatus
a} :: GetLifecyclePolicyPreviewResponse)

-- | The registry ID associated with the request.
getLifecyclePolicyPreviewResponse_registryId :: Lens.Lens' GetLifecyclePolicyPreviewResponse (Prelude.Maybe Prelude.Text)
getLifecyclePolicyPreviewResponse_registryId :: (Maybe Text -> f (Maybe Text))
-> GetLifecyclePolicyPreviewResponse
-> f GetLifecyclePolicyPreviewResponse
getLifecyclePolicyPreviewResponse_registryId = (GetLifecyclePolicyPreviewResponse -> Maybe Text)
-> (GetLifecyclePolicyPreviewResponse
    -> Maybe Text -> GetLifecyclePolicyPreviewResponse)
-> Lens' GetLifecyclePolicyPreviewResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreviewResponse' {Maybe Text
registryId :: Maybe Text
$sel:registryId:GetLifecyclePolicyPreviewResponse' :: GetLifecyclePolicyPreviewResponse -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: GetLifecyclePolicyPreviewResponse
s@GetLifecyclePolicyPreviewResponse' {} Maybe Text
a -> GetLifecyclePolicyPreviewResponse
s {$sel:registryId:GetLifecyclePolicyPreviewResponse' :: Maybe Text
registryId = Maybe Text
a} :: GetLifecyclePolicyPreviewResponse)

-- | The JSON lifecycle policy text.
getLifecyclePolicyPreviewResponse_lifecyclePolicyText :: Lens.Lens' GetLifecyclePolicyPreviewResponse (Prelude.Maybe Prelude.Text)
getLifecyclePolicyPreviewResponse_lifecyclePolicyText :: (Maybe Text -> f (Maybe Text))
-> GetLifecyclePolicyPreviewResponse
-> f GetLifecyclePolicyPreviewResponse
getLifecyclePolicyPreviewResponse_lifecyclePolicyText = (GetLifecyclePolicyPreviewResponse -> Maybe Text)
-> (GetLifecyclePolicyPreviewResponse
    -> Maybe Text -> GetLifecyclePolicyPreviewResponse)
-> Lens' GetLifecyclePolicyPreviewResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreviewResponse' {Maybe Text
lifecyclePolicyText :: Maybe Text
$sel:lifecyclePolicyText:GetLifecyclePolicyPreviewResponse' :: GetLifecyclePolicyPreviewResponse -> Maybe Text
lifecyclePolicyText} -> Maybe Text
lifecyclePolicyText) (\s :: GetLifecyclePolicyPreviewResponse
s@GetLifecyclePolicyPreviewResponse' {} Maybe Text
a -> GetLifecyclePolicyPreviewResponse
s {$sel:lifecyclePolicyText:GetLifecyclePolicyPreviewResponse' :: Maybe Text
lifecyclePolicyText = Maybe Text
a} :: GetLifecyclePolicyPreviewResponse)

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

-- | The repository name associated with the request.
getLifecyclePolicyPreviewResponse_repositoryName :: Lens.Lens' GetLifecyclePolicyPreviewResponse (Prelude.Maybe Prelude.Text)
getLifecyclePolicyPreviewResponse_repositoryName :: (Maybe Text -> f (Maybe Text))
-> GetLifecyclePolicyPreviewResponse
-> f GetLifecyclePolicyPreviewResponse
getLifecyclePolicyPreviewResponse_repositoryName = (GetLifecyclePolicyPreviewResponse -> Maybe Text)
-> (GetLifecyclePolicyPreviewResponse
    -> Maybe Text -> GetLifecyclePolicyPreviewResponse)
-> Lens' GetLifecyclePolicyPreviewResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreviewResponse' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:GetLifecyclePolicyPreviewResponse' :: GetLifecyclePolicyPreviewResponse -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: GetLifecyclePolicyPreviewResponse
s@GetLifecyclePolicyPreviewResponse' {} Maybe Text
a -> GetLifecyclePolicyPreviewResponse
s {$sel:repositoryName:GetLifecyclePolicyPreviewResponse' :: Maybe Text
repositoryName = Maybe Text
a} :: GetLifecyclePolicyPreviewResponse)

-- | The results of the lifecycle policy preview request.
getLifecyclePolicyPreviewResponse_previewResults :: Lens.Lens' GetLifecyclePolicyPreviewResponse (Prelude.Maybe [LifecyclePolicyPreviewResult])
getLifecyclePolicyPreviewResponse_previewResults :: (Maybe [LifecyclePolicyPreviewResult]
 -> f (Maybe [LifecyclePolicyPreviewResult]))
-> GetLifecyclePolicyPreviewResponse
-> f GetLifecyclePolicyPreviewResponse
getLifecyclePolicyPreviewResponse_previewResults = (GetLifecyclePolicyPreviewResponse
 -> Maybe [LifecyclePolicyPreviewResult])
-> (GetLifecyclePolicyPreviewResponse
    -> Maybe [LifecyclePolicyPreviewResult]
    -> GetLifecyclePolicyPreviewResponse)
-> Lens'
     GetLifecyclePolicyPreviewResponse
     (Maybe [LifecyclePolicyPreviewResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicyPreviewResponse' {Maybe [LifecyclePolicyPreviewResult]
previewResults :: Maybe [LifecyclePolicyPreviewResult]
$sel:previewResults:GetLifecyclePolicyPreviewResponse' :: GetLifecyclePolicyPreviewResponse
-> Maybe [LifecyclePolicyPreviewResult]
previewResults} -> Maybe [LifecyclePolicyPreviewResult]
previewResults) (\s :: GetLifecyclePolicyPreviewResponse
s@GetLifecyclePolicyPreviewResponse' {} Maybe [LifecyclePolicyPreviewResult]
a -> GetLifecyclePolicyPreviewResponse
s {$sel:previewResults:GetLifecyclePolicyPreviewResponse' :: Maybe [LifecyclePolicyPreviewResult]
previewResults = Maybe [LifecyclePolicyPreviewResult]
a} :: GetLifecyclePolicyPreviewResponse) ((Maybe [LifecyclePolicyPreviewResult]
  -> f (Maybe [LifecyclePolicyPreviewResult]))
 -> GetLifecyclePolicyPreviewResponse
 -> f GetLifecyclePolicyPreviewResponse)
-> ((Maybe [LifecyclePolicyPreviewResult]
     -> f (Maybe [LifecyclePolicyPreviewResult]))
    -> Maybe [LifecyclePolicyPreviewResult]
    -> f (Maybe [LifecyclePolicyPreviewResult]))
-> (Maybe [LifecyclePolicyPreviewResult]
    -> f (Maybe [LifecyclePolicyPreviewResult]))
-> GetLifecyclePolicyPreviewResponse
-> f GetLifecyclePolicyPreviewResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LifecyclePolicyPreviewResult]
  [LifecyclePolicyPreviewResult]
  [LifecyclePolicyPreviewResult]
  [LifecyclePolicyPreviewResult]
-> Iso
     (Maybe [LifecyclePolicyPreviewResult])
     (Maybe [LifecyclePolicyPreviewResult])
     (Maybe [LifecyclePolicyPreviewResult])
     (Maybe [LifecyclePolicyPreviewResult])
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
  [LifecyclePolicyPreviewResult]
  [LifecyclePolicyPreviewResult]
  [LifecyclePolicyPreviewResult]
  [LifecyclePolicyPreviewResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetLifecyclePolicyPreviewResponse