{-# 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.StartLifecyclePolicyPreview
-- 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)
--
-- Starts a preview of a lifecycle policy for the specified repository.
-- This allows you to see the results before associating the lifecycle
-- policy with the repository.
module Amazonka.ECR.StartLifecyclePolicyPreview
  ( -- * Creating a Request
    StartLifecyclePolicyPreview (..),
    newStartLifecyclePolicyPreview,

    -- * Request Lenses
    startLifecyclePolicyPreview_registryId,
    startLifecyclePolicyPreview_lifecyclePolicyText,
    startLifecyclePolicyPreview_repositoryName,

    -- * Destructuring the Response
    StartLifecyclePolicyPreviewResponse (..),
    newStartLifecyclePolicyPreviewResponse,

    -- * Response Lenses
    startLifecyclePolicyPreviewResponse_status,
    startLifecyclePolicyPreviewResponse_registryId,
    startLifecyclePolicyPreviewResponse_lifecyclePolicyText,
    startLifecyclePolicyPreviewResponse_repositoryName,
    startLifecyclePolicyPreviewResponse_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:/ 'newStartLifecyclePolicyPreview' smart constructor.
data StartLifecyclePolicyPreview = StartLifecyclePolicyPreview'
  { -- | 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.
    StartLifecyclePolicyPreview -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The policy to be evaluated against. If you do not specify a policy, the
    -- current policy for the repository is used.
    StartLifecyclePolicyPreview -> Maybe Text
lifecyclePolicyText :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository to be evaluated.
    StartLifecyclePolicyPreview -> Text
repositoryName :: Prelude.Text
  }
  deriving (StartLifecyclePolicyPreview -> StartLifecyclePolicyPreview -> Bool
(StartLifecyclePolicyPreview
 -> StartLifecyclePolicyPreview -> Bool)
-> (StartLifecyclePolicyPreview
    -> StartLifecyclePolicyPreview -> Bool)
-> Eq StartLifecyclePolicyPreview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartLifecyclePolicyPreview -> StartLifecyclePolicyPreview -> Bool
$c/= :: StartLifecyclePolicyPreview -> StartLifecyclePolicyPreview -> Bool
== :: StartLifecyclePolicyPreview -> StartLifecyclePolicyPreview -> Bool
$c== :: StartLifecyclePolicyPreview -> StartLifecyclePolicyPreview -> Bool
Prelude.Eq, ReadPrec [StartLifecyclePolicyPreview]
ReadPrec StartLifecyclePolicyPreview
Int -> ReadS StartLifecyclePolicyPreview
ReadS [StartLifecyclePolicyPreview]
(Int -> ReadS StartLifecyclePolicyPreview)
-> ReadS [StartLifecyclePolicyPreview]
-> ReadPrec StartLifecyclePolicyPreview
-> ReadPrec [StartLifecyclePolicyPreview]
-> Read StartLifecyclePolicyPreview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartLifecyclePolicyPreview]
$creadListPrec :: ReadPrec [StartLifecyclePolicyPreview]
readPrec :: ReadPrec StartLifecyclePolicyPreview
$creadPrec :: ReadPrec StartLifecyclePolicyPreview
readList :: ReadS [StartLifecyclePolicyPreview]
$creadList :: ReadS [StartLifecyclePolicyPreview]
readsPrec :: Int -> ReadS StartLifecyclePolicyPreview
$creadsPrec :: Int -> ReadS StartLifecyclePolicyPreview
Prelude.Read, Int -> StartLifecyclePolicyPreview -> ShowS
[StartLifecyclePolicyPreview] -> ShowS
StartLifecyclePolicyPreview -> String
(Int -> StartLifecyclePolicyPreview -> ShowS)
-> (StartLifecyclePolicyPreview -> String)
-> ([StartLifecyclePolicyPreview] -> ShowS)
-> Show StartLifecyclePolicyPreview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartLifecyclePolicyPreview] -> ShowS
$cshowList :: [StartLifecyclePolicyPreview] -> ShowS
show :: StartLifecyclePolicyPreview -> String
$cshow :: StartLifecyclePolicyPreview -> String
showsPrec :: Int -> StartLifecyclePolicyPreview -> ShowS
$cshowsPrec :: Int -> StartLifecyclePolicyPreview -> ShowS
Prelude.Show, (forall x.
 StartLifecyclePolicyPreview -> Rep StartLifecyclePolicyPreview x)
-> (forall x.
    Rep StartLifecyclePolicyPreview x -> StartLifecyclePolicyPreview)
-> Generic StartLifecyclePolicyPreview
forall x.
Rep StartLifecyclePolicyPreview x -> StartLifecyclePolicyPreview
forall x.
StartLifecyclePolicyPreview -> Rep StartLifecyclePolicyPreview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartLifecyclePolicyPreview x -> StartLifecyclePolicyPreview
$cfrom :: forall x.
StartLifecyclePolicyPreview -> Rep StartLifecyclePolicyPreview x
Prelude.Generic)

-- |
-- Create a value of 'StartLifecyclePolicyPreview' 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', 'startLifecyclePolicyPreview_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.
--
-- 'lifecyclePolicyText', 'startLifecyclePolicyPreview_lifecyclePolicyText' - The policy to be evaluated against. If you do not specify a policy, the
-- current policy for the repository is used.
--
-- 'repositoryName', 'startLifecyclePolicyPreview_repositoryName' - The name of the repository to be evaluated.
newStartLifecyclePolicyPreview ::
  -- | 'repositoryName'
  Prelude.Text ->
  StartLifecyclePolicyPreview
newStartLifecyclePolicyPreview :: Text -> StartLifecyclePolicyPreview
newStartLifecyclePolicyPreview Text
pRepositoryName_ =
  StartLifecyclePolicyPreview' :: Maybe Text -> Maybe Text -> Text -> StartLifecyclePolicyPreview
StartLifecyclePolicyPreview'
    { $sel:registryId:StartLifecyclePolicyPreview' :: Maybe Text
registryId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lifecyclePolicyText:StartLifecyclePolicyPreview' :: Maybe Text
lifecyclePolicyText = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:StartLifecyclePolicyPreview' :: 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.
startLifecyclePolicyPreview_registryId :: Lens.Lens' StartLifecyclePolicyPreview (Prelude.Maybe Prelude.Text)
startLifecyclePolicyPreview_registryId :: (Maybe Text -> f (Maybe Text))
-> StartLifecyclePolicyPreview -> f StartLifecyclePolicyPreview
startLifecyclePolicyPreview_registryId = (StartLifecyclePolicyPreview -> Maybe Text)
-> (StartLifecyclePolicyPreview
    -> Maybe Text -> StartLifecyclePolicyPreview)
-> Lens
     StartLifecyclePolicyPreview
     StartLifecyclePolicyPreview
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartLifecyclePolicyPreview' {Maybe Text
registryId :: Maybe Text
$sel:registryId:StartLifecyclePolicyPreview' :: StartLifecyclePolicyPreview -> Maybe Text
registryId} -> Maybe Text
registryId) (\s :: StartLifecyclePolicyPreview
s@StartLifecyclePolicyPreview' {} Maybe Text
a -> StartLifecyclePolicyPreview
s {$sel:registryId:StartLifecyclePolicyPreview' :: Maybe Text
registryId = Maybe Text
a} :: StartLifecyclePolicyPreview)

-- | The policy to be evaluated against. If you do not specify a policy, the
-- current policy for the repository is used.
startLifecyclePolicyPreview_lifecyclePolicyText :: Lens.Lens' StartLifecyclePolicyPreview (Prelude.Maybe Prelude.Text)
startLifecyclePolicyPreview_lifecyclePolicyText :: (Maybe Text -> f (Maybe Text))
-> StartLifecyclePolicyPreview -> f StartLifecyclePolicyPreview
startLifecyclePolicyPreview_lifecyclePolicyText = (StartLifecyclePolicyPreview -> Maybe Text)
-> (StartLifecyclePolicyPreview
    -> Maybe Text -> StartLifecyclePolicyPreview)
-> Lens
     StartLifecyclePolicyPreview
     StartLifecyclePolicyPreview
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartLifecyclePolicyPreview' {Maybe Text
lifecyclePolicyText :: Maybe Text
$sel:lifecyclePolicyText:StartLifecyclePolicyPreview' :: StartLifecyclePolicyPreview -> Maybe Text
lifecyclePolicyText} -> Maybe Text
lifecyclePolicyText) (\s :: StartLifecyclePolicyPreview
s@StartLifecyclePolicyPreview' {} Maybe Text
a -> StartLifecyclePolicyPreview
s {$sel:lifecyclePolicyText:StartLifecyclePolicyPreview' :: Maybe Text
lifecyclePolicyText = Maybe Text
a} :: StartLifecyclePolicyPreview)

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

instance Core.AWSRequest StartLifecyclePolicyPreview where
  type
    AWSResponse StartLifecyclePolicyPreview =
      StartLifecyclePolicyPreviewResponse
  request :: StartLifecyclePolicyPreview -> Request StartLifecyclePolicyPreview
request = Service
-> StartLifecyclePolicyPreview
-> Request StartLifecyclePolicyPreview
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartLifecyclePolicyPreview
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartLifecyclePolicyPreview)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartLifecyclePolicyPreview))
-> Logger
-> Service
-> Proxy StartLifecyclePolicyPreview
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartLifecyclePolicyPreview)))
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 LifecyclePolicyPreviewStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> StartLifecyclePolicyPreviewResponse
StartLifecyclePolicyPreviewResponse'
            (Maybe LifecyclePolicyPreviewStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> StartLifecyclePolicyPreviewResponse)
-> Either String (Maybe LifecyclePolicyPreviewStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> StartLifecyclePolicyPreviewResponse)
forall (f :: * -> *) a b. Functor 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
   -> Int
   -> StartLifecyclePolicyPreviewResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> StartLifecyclePolicyPreviewResponse)
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 -> Int -> StartLifecyclePolicyPreviewResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> StartLifecyclePolicyPreviewResponse)
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 -> Int -> StartLifecyclePolicyPreviewResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartLifecyclePolicyPreviewResponse)
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 (Int -> StartLifecyclePolicyPreviewResponse)
-> Either String Int
-> Either String StartLifecyclePolicyPreviewResponse
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 StartLifecyclePolicyPreview

instance Prelude.NFData StartLifecyclePolicyPreview

instance Core.ToHeaders StartLifecyclePolicyPreview where
  toHeaders :: StartLifecyclePolicyPreview -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartLifecyclePolicyPreview -> 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.StartLifecyclePolicyPreview" ::
                          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 StartLifecyclePolicyPreview where
  toJSON :: StartLifecyclePolicyPreview -> Value
toJSON StartLifecyclePolicyPreview' {Maybe Text
Text
repositoryName :: Text
lifecyclePolicyText :: Maybe Text
registryId :: Maybe Text
$sel:repositoryName:StartLifecyclePolicyPreview' :: StartLifecyclePolicyPreview -> Text
$sel:lifecyclePolicyText:StartLifecyclePolicyPreview' :: StartLifecyclePolicyPreview -> Maybe Text
$sel:registryId:StartLifecyclePolicyPreview' :: StartLifecyclePolicyPreview -> 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
"lifecyclePolicyText" 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
lifecyclePolicyText,
            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 StartLifecyclePolicyPreview where
  toPath :: StartLifecyclePolicyPreview -> ByteString
toPath = ByteString -> StartLifecyclePolicyPreview -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newStartLifecyclePolicyPreviewResponse' smart constructor.
data StartLifecyclePolicyPreviewResponse = StartLifecyclePolicyPreviewResponse'
  { -- | The status of the lifecycle policy preview request.
    StartLifecyclePolicyPreviewResponse
-> Maybe LifecyclePolicyPreviewStatus
status :: Prelude.Maybe LifecyclePolicyPreviewStatus,
    -- | The registry ID associated with the request.
    StartLifecyclePolicyPreviewResponse -> Maybe Text
registryId :: Prelude.Maybe Prelude.Text,
    -- | The JSON repository policy text.
    StartLifecyclePolicyPreviewResponse -> Maybe Text
lifecyclePolicyText :: Prelude.Maybe Prelude.Text,
    -- | The repository name associated with the request.
    StartLifecyclePolicyPreviewResponse -> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartLifecyclePolicyPreviewResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartLifecyclePolicyPreviewResponse
-> StartLifecyclePolicyPreviewResponse -> Bool
(StartLifecyclePolicyPreviewResponse
 -> StartLifecyclePolicyPreviewResponse -> Bool)
-> (StartLifecyclePolicyPreviewResponse
    -> StartLifecyclePolicyPreviewResponse -> Bool)
-> Eq StartLifecyclePolicyPreviewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartLifecyclePolicyPreviewResponse
-> StartLifecyclePolicyPreviewResponse -> Bool
$c/= :: StartLifecyclePolicyPreviewResponse
-> StartLifecyclePolicyPreviewResponse -> Bool
== :: StartLifecyclePolicyPreviewResponse
-> StartLifecyclePolicyPreviewResponse -> Bool
$c== :: StartLifecyclePolicyPreviewResponse
-> StartLifecyclePolicyPreviewResponse -> Bool
Prelude.Eq, ReadPrec [StartLifecyclePolicyPreviewResponse]
ReadPrec StartLifecyclePolicyPreviewResponse
Int -> ReadS StartLifecyclePolicyPreviewResponse
ReadS [StartLifecyclePolicyPreviewResponse]
(Int -> ReadS StartLifecyclePolicyPreviewResponse)
-> ReadS [StartLifecyclePolicyPreviewResponse]
-> ReadPrec StartLifecyclePolicyPreviewResponse
-> ReadPrec [StartLifecyclePolicyPreviewResponse]
-> Read StartLifecyclePolicyPreviewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartLifecyclePolicyPreviewResponse]
$creadListPrec :: ReadPrec [StartLifecyclePolicyPreviewResponse]
readPrec :: ReadPrec StartLifecyclePolicyPreviewResponse
$creadPrec :: ReadPrec StartLifecyclePolicyPreviewResponse
readList :: ReadS [StartLifecyclePolicyPreviewResponse]
$creadList :: ReadS [StartLifecyclePolicyPreviewResponse]
readsPrec :: Int -> ReadS StartLifecyclePolicyPreviewResponse
$creadsPrec :: Int -> ReadS StartLifecyclePolicyPreviewResponse
Prelude.Read, Int -> StartLifecyclePolicyPreviewResponse -> ShowS
[StartLifecyclePolicyPreviewResponse] -> ShowS
StartLifecyclePolicyPreviewResponse -> String
(Int -> StartLifecyclePolicyPreviewResponse -> ShowS)
-> (StartLifecyclePolicyPreviewResponse -> String)
-> ([StartLifecyclePolicyPreviewResponse] -> ShowS)
-> Show StartLifecyclePolicyPreviewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartLifecyclePolicyPreviewResponse] -> ShowS
$cshowList :: [StartLifecyclePolicyPreviewResponse] -> ShowS
show :: StartLifecyclePolicyPreviewResponse -> String
$cshow :: StartLifecyclePolicyPreviewResponse -> String
showsPrec :: Int -> StartLifecyclePolicyPreviewResponse -> ShowS
$cshowsPrec :: Int -> StartLifecyclePolicyPreviewResponse -> ShowS
Prelude.Show, (forall x.
 StartLifecyclePolicyPreviewResponse
 -> Rep StartLifecyclePolicyPreviewResponse x)
-> (forall x.
    Rep StartLifecyclePolicyPreviewResponse x
    -> StartLifecyclePolicyPreviewResponse)
-> Generic StartLifecyclePolicyPreviewResponse
forall x.
Rep StartLifecyclePolicyPreviewResponse x
-> StartLifecyclePolicyPreviewResponse
forall x.
StartLifecyclePolicyPreviewResponse
-> Rep StartLifecyclePolicyPreviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartLifecyclePolicyPreviewResponse x
-> StartLifecyclePolicyPreviewResponse
$cfrom :: forall x.
StartLifecyclePolicyPreviewResponse
-> Rep StartLifecyclePolicyPreviewResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartLifecyclePolicyPreviewResponse' 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:
--
-- 'status', 'startLifecyclePolicyPreviewResponse_status' - The status of the lifecycle policy preview request.
--
-- 'registryId', 'startLifecyclePolicyPreviewResponse_registryId' - The registry ID associated with the request.
--
-- 'lifecyclePolicyText', 'startLifecyclePolicyPreviewResponse_lifecyclePolicyText' - The JSON repository policy text.
--
-- 'repositoryName', 'startLifecyclePolicyPreviewResponse_repositoryName' - The repository name associated with the request.
--
-- 'httpStatus', 'startLifecyclePolicyPreviewResponse_httpStatus' - The response's http status code.
newStartLifecyclePolicyPreviewResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartLifecyclePolicyPreviewResponse
newStartLifecyclePolicyPreviewResponse :: Int -> StartLifecyclePolicyPreviewResponse
newStartLifecyclePolicyPreviewResponse Int
pHttpStatus_ =
  StartLifecyclePolicyPreviewResponse' :: Maybe LifecyclePolicyPreviewStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> StartLifecyclePolicyPreviewResponse
StartLifecyclePolicyPreviewResponse'
    { $sel:status:StartLifecyclePolicyPreviewResponse' :: Maybe LifecyclePolicyPreviewStatus
status =
        Maybe LifecyclePolicyPreviewStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:registryId:StartLifecyclePolicyPreviewResponse' :: Maybe Text
registryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lifecyclePolicyText:StartLifecyclePolicyPreviewResponse' :: Maybe Text
lifecyclePolicyText = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:StartLifecyclePolicyPreviewResponse' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartLifecyclePolicyPreviewResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

instance
  Prelude.NFData
    StartLifecyclePolicyPreviewResponse