{-# 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.DLM.CreateLifecyclePolicy
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a policy to manage the lifecycle of the specified Amazon Web
-- Services resources. You can create up to 100 lifecycle policies.
module Amazonka.DLM.CreateLifecyclePolicy
  ( -- * Creating a Request
    CreateLifecyclePolicy (..),
    newCreateLifecyclePolicy,

    -- * Request Lenses
    createLifecyclePolicy_tags,
    createLifecyclePolicy_executionRoleArn,
    createLifecyclePolicy_description,
    createLifecyclePolicy_state,
    createLifecyclePolicy_policyDetails,

    -- * Destructuring the Response
    CreateLifecyclePolicyResponse (..),
    newCreateLifecyclePolicyResponse,

    -- * Response Lenses
    createLifecyclePolicyResponse_policyId,
    createLifecyclePolicyResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DLM.Types
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateLifecyclePolicy' smart constructor.
data CreateLifecyclePolicy = CreateLifecyclePolicy'
  { -- | The tags to apply to the lifecycle policy during creation.
    CreateLifecyclePolicy -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the IAM role used to run the
    -- operations specified by the lifecycle policy.
    CreateLifecyclePolicy -> Text
executionRoleArn :: Prelude.Text,
    -- | A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$
    -- are supported.
    CreateLifecyclePolicy -> Text
description :: Prelude.Text,
    -- | The desired activation state of the lifecycle policy after creation.
    CreateLifecyclePolicy -> SettablePolicyStateValues
state :: SettablePolicyStateValues,
    -- | The configuration details of the lifecycle policy.
    CreateLifecyclePolicy -> PolicyDetails
policyDetails :: PolicyDetails
  }
  deriving (CreateLifecyclePolicy -> CreateLifecyclePolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLifecyclePolicy -> CreateLifecyclePolicy -> Bool
$c/= :: CreateLifecyclePolicy -> CreateLifecyclePolicy -> Bool
== :: CreateLifecyclePolicy -> CreateLifecyclePolicy -> Bool
$c== :: CreateLifecyclePolicy -> CreateLifecyclePolicy -> Bool
Prelude.Eq, ReadPrec [CreateLifecyclePolicy]
ReadPrec CreateLifecyclePolicy
Int -> ReadS CreateLifecyclePolicy
ReadS [CreateLifecyclePolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLifecyclePolicy]
$creadListPrec :: ReadPrec [CreateLifecyclePolicy]
readPrec :: ReadPrec CreateLifecyclePolicy
$creadPrec :: ReadPrec CreateLifecyclePolicy
readList :: ReadS [CreateLifecyclePolicy]
$creadList :: ReadS [CreateLifecyclePolicy]
readsPrec :: Int -> ReadS CreateLifecyclePolicy
$creadsPrec :: Int -> ReadS CreateLifecyclePolicy
Prelude.Read, Int -> CreateLifecyclePolicy -> ShowS
[CreateLifecyclePolicy] -> ShowS
CreateLifecyclePolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLifecyclePolicy] -> ShowS
$cshowList :: [CreateLifecyclePolicy] -> ShowS
show :: CreateLifecyclePolicy -> String
$cshow :: CreateLifecyclePolicy -> String
showsPrec :: Int -> CreateLifecyclePolicy -> ShowS
$cshowsPrec :: Int -> CreateLifecyclePolicy -> ShowS
Prelude.Show, forall x. Rep CreateLifecyclePolicy x -> CreateLifecyclePolicy
forall x. CreateLifecyclePolicy -> Rep CreateLifecyclePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLifecyclePolicy x -> CreateLifecyclePolicy
$cfrom :: forall x. CreateLifecyclePolicy -> Rep CreateLifecyclePolicy x
Prelude.Generic)

-- |
-- Create a value of 'CreateLifecyclePolicy' 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:
--
-- 'tags', 'createLifecyclePolicy_tags' - The tags to apply to the lifecycle policy during creation.
--
-- 'executionRoleArn', 'createLifecyclePolicy_executionRoleArn' - The Amazon Resource Name (ARN) of the IAM role used to run the
-- operations specified by the lifecycle policy.
--
-- 'description', 'createLifecyclePolicy_description' - A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$
-- are supported.
--
-- 'state', 'createLifecyclePolicy_state' - The desired activation state of the lifecycle policy after creation.
--
-- 'policyDetails', 'createLifecyclePolicy_policyDetails' - The configuration details of the lifecycle policy.
newCreateLifecyclePolicy ::
  -- | 'executionRoleArn'
  Prelude.Text ->
  -- | 'description'
  Prelude.Text ->
  -- | 'state'
  SettablePolicyStateValues ->
  -- | 'policyDetails'
  PolicyDetails ->
  CreateLifecyclePolicy
newCreateLifecyclePolicy :: Text
-> Text
-> SettablePolicyStateValues
-> PolicyDetails
-> CreateLifecyclePolicy
newCreateLifecyclePolicy
  Text
pExecutionRoleArn_
  Text
pDescription_
  SettablePolicyStateValues
pState_
  PolicyDetails
pPolicyDetails_ =
    CreateLifecyclePolicy'
      { $sel:tags:CreateLifecyclePolicy' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:executionRoleArn:CreateLifecyclePolicy' :: Text
executionRoleArn = Text
pExecutionRoleArn_,
        $sel:description:CreateLifecyclePolicy' :: Text
description = Text
pDescription_,
        $sel:state:CreateLifecyclePolicy' :: SettablePolicyStateValues
state = SettablePolicyStateValues
pState_,
        $sel:policyDetails:CreateLifecyclePolicy' :: PolicyDetails
policyDetails = PolicyDetails
pPolicyDetails_
      }

-- | The tags to apply to the lifecycle policy during creation.
createLifecyclePolicy_tags :: Lens.Lens' CreateLifecyclePolicy (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createLifecyclePolicy_tags :: Lens' CreateLifecyclePolicy (Maybe (HashMap Text Text))
createLifecyclePolicy_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLifecyclePolicy' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateLifecyclePolicy
s@CreateLifecyclePolicy' {} Maybe (HashMap Text Text)
a -> CreateLifecyclePolicy
s {$sel:tags:CreateLifecyclePolicy' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateLifecyclePolicy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the IAM role used to run the
-- operations specified by the lifecycle policy.
createLifecyclePolicy_executionRoleArn :: Lens.Lens' CreateLifecyclePolicy Prelude.Text
createLifecyclePolicy_executionRoleArn :: Lens' CreateLifecyclePolicy Text
createLifecyclePolicy_executionRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLifecyclePolicy' {Text
executionRoleArn :: Text
$sel:executionRoleArn:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
executionRoleArn} -> Text
executionRoleArn) (\s :: CreateLifecyclePolicy
s@CreateLifecyclePolicy' {} Text
a -> CreateLifecyclePolicy
s {$sel:executionRoleArn:CreateLifecyclePolicy' :: Text
executionRoleArn = Text
a} :: CreateLifecyclePolicy)

-- | A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$
-- are supported.
createLifecyclePolicy_description :: Lens.Lens' CreateLifecyclePolicy Prelude.Text
createLifecyclePolicy_description :: Lens' CreateLifecyclePolicy Text
createLifecyclePolicy_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLifecyclePolicy' {Text
description :: Text
$sel:description:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
description} -> Text
description) (\s :: CreateLifecyclePolicy
s@CreateLifecyclePolicy' {} Text
a -> CreateLifecyclePolicy
s {$sel:description:CreateLifecyclePolicy' :: Text
description = Text
a} :: CreateLifecyclePolicy)

-- | The desired activation state of the lifecycle policy after creation.
createLifecyclePolicy_state :: Lens.Lens' CreateLifecyclePolicy SettablePolicyStateValues
createLifecyclePolicy_state :: Lens' CreateLifecyclePolicy SettablePolicyStateValues
createLifecyclePolicy_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLifecyclePolicy' {SettablePolicyStateValues
state :: SettablePolicyStateValues
$sel:state:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> SettablePolicyStateValues
state} -> SettablePolicyStateValues
state) (\s :: CreateLifecyclePolicy
s@CreateLifecyclePolicy' {} SettablePolicyStateValues
a -> CreateLifecyclePolicy
s {$sel:state:CreateLifecyclePolicy' :: SettablePolicyStateValues
state = SettablePolicyStateValues
a} :: CreateLifecyclePolicy)

-- | The configuration details of the lifecycle policy.
createLifecyclePolicy_policyDetails :: Lens.Lens' CreateLifecyclePolicy PolicyDetails
createLifecyclePolicy_policyDetails :: Lens' CreateLifecyclePolicy PolicyDetails
createLifecyclePolicy_policyDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLifecyclePolicy' {PolicyDetails
policyDetails :: PolicyDetails
$sel:policyDetails:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> PolicyDetails
policyDetails} -> PolicyDetails
policyDetails) (\s :: CreateLifecyclePolicy
s@CreateLifecyclePolicy' {} PolicyDetails
a -> CreateLifecyclePolicy
s {$sel:policyDetails:CreateLifecyclePolicy' :: PolicyDetails
policyDetails = PolicyDetails
a} :: CreateLifecyclePolicy)

instance Core.AWSRequest CreateLifecyclePolicy where
  type
    AWSResponse CreateLifecyclePolicy =
      CreateLifecyclePolicyResponse
  request :: (Service -> Service)
-> CreateLifecyclePolicy -> Request CreateLifecyclePolicy
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateLifecyclePolicy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLifecyclePolicy)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateLifecyclePolicyResponse
CreateLifecyclePolicyResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PolicyId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateLifecyclePolicy where
  hashWithSalt :: Int -> CreateLifecyclePolicy -> Int
hashWithSalt Int
_salt CreateLifecyclePolicy' {Maybe (HashMap Text Text)
Text
SettablePolicyStateValues
PolicyDetails
policyDetails :: PolicyDetails
state :: SettablePolicyStateValues
description :: Text
executionRoleArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:policyDetails:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> PolicyDetails
$sel:state:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> SettablePolicyStateValues
$sel:description:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
$sel:executionRoleArn:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
$sel:tags:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
executionRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SettablePolicyStateValues
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PolicyDetails
policyDetails

instance Prelude.NFData CreateLifecyclePolicy where
  rnf :: CreateLifecyclePolicy -> ()
rnf CreateLifecyclePolicy' {Maybe (HashMap Text Text)
Text
SettablePolicyStateValues
PolicyDetails
policyDetails :: PolicyDetails
state :: SettablePolicyStateValues
description :: Text
executionRoleArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:policyDetails:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> PolicyDetails
$sel:state:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> SettablePolicyStateValues
$sel:description:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
$sel:executionRoleArn:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
$sel:tags:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
executionRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SettablePolicyStateValues
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PolicyDetails
policyDetails

instance Data.ToHeaders CreateLifecyclePolicy where
  toHeaders :: CreateLifecyclePolicy -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateLifecyclePolicy where
  toJSON :: CreateLifecyclePolicy -> Value
toJSON CreateLifecyclePolicy' {Maybe (HashMap Text Text)
Text
SettablePolicyStateValues
PolicyDetails
policyDetails :: PolicyDetails
state :: SettablePolicyStateValues
description :: Text
executionRoleArn :: Text
tags :: Maybe (HashMap Text Text)
$sel:policyDetails:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> PolicyDetails
$sel:state:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> SettablePolicyStateValues
$sel:description:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
$sel:executionRoleArn:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Text
$sel:tags:CreateLifecyclePolicy' :: CreateLifecyclePolicy -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ExecutionRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
executionRoleArn),
            forall a. a -> Maybe a
Prelude.Just (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
description),
            forall a. a -> Maybe a
Prelude.Just (Key
"State" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SettablePolicyStateValues
state),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"PolicyDetails" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= PolicyDetails
policyDetails)
          ]
      )

instance Data.ToPath CreateLifecyclePolicy where
  toPath :: CreateLifecyclePolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/policies"

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

-- | /See:/ 'newCreateLifecyclePolicyResponse' smart constructor.
data CreateLifecyclePolicyResponse = CreateLifecyclePolicyResponse'
  { -- | The identifier of the lifecycle policy.
    CreateLifecyclePolicyResponse -> Maybe Text
policyId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateLifecyclePolicyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLifecyclePolicyResponse
-> CreateLifecyclePolicyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLifecyclePolicyResponse
-> CreateLifecyclePolicyResponse -> Bool
$c/= :: CreateLifecyclePolicyResponse
-> CreateLifecyclePolicyResponse -> Bool
== :: CreateLifecyclePolicyResponse
-> CreateLifecyclePolicyResponse -> Bool
$c== :: CreateLifecyclePolicyResponse
-> CreateLifecyclePolicyResponse -> Bool
Prelude.Eq, ReadPrec [CreateLifecyclePolicyResponse]
ReadPrec CreateLifecyclePolicyResponse
Int -> ReadS CreateLifecyclePolicyResponse
ReadS [CreateLifecyclePolicyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLifecyclePolicyResponse]
$creadListPrec :: ReadPrec [CreateLifecyclePolicyResponse]
readPrec :: ReadPrec CreateLifecyclePolicyResponse
$creadPrec :: ReadPrec CreateLifecyclePolicyResponse
readList :: ReadS [CreateLifecyclePolicyResponse]
$creadList :: ReadS [CreateLifecyclePolicyResponse]
readsPrec :: Int -> ReadS CreateLifecyclePolicyResponse
$creadsPrec :: Int -> ReadS CreateLifecyclePolicyResponse
Prelude.Read, Int -> CreateLifecyclePolicyResponse -> ShowS
[CreateLifecyclePolicyResponse] -> ShowS
CreateLifecyclePolicyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLifecyclePolicyResponse] -> ShowS
$cshowList :: [CreateLifecyclePolicyResponse] -> ShowS
show :: CreateLifecyclePolicyResponse -> String
$cshow :: CreateLifecyclePolicyResponse -> String
showsPrec :: Int -> CreateLifecyclePolicyResponse -> ShowS
$cshowsPrec :: Int -> CreateLifecyclePolicyResponse -> ShowS
Prelude.Show, forall x.
Rep CreateLifecyclePolicyResponse x
-> CreateLifecyclePolicyResponse
forall x.
CreateLifecyclePolicyResponse
-> Rep CreateLifecyclePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLifecyclePolicyResponse x
-> CreateLifecyclePolicyResponse
$cfrom :: forall x.
CreateLifecyclePolicyResponse
-> Rep CreateLifecyclePolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLifecyclePolicyResponse' 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:
--
-- 'policyId', 'createLifecyclePolicyResponse_policyId' - The identifier of the lifecycle policy.
--
-- 'httpStatus', 'createLifecyclePolicyResponse_httpStatus' - The response's http status code.
newCreateLifecyclePolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLifecyclePolicyResponse
newCreateLifecyclePolicyResponse :: Int -> CreateLifecyclePolicyResponse
newCreateLifecyclePolicyResponse Int
pHttpStatus_ =
  CreateLifecyclePolicyResponse'
    { $sel:policyId:CreateLifecyclePolicyResponse' :: Maybe Text
policyId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLifecyclePolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier of the lifecycle policy.
createLifecyclePolicyResponse_policyId :: Lens.Lens' CreateLifecyclePolicyResponse (Prelude.Maybe Prelude.Text)
createLifecyclePolicyResponse_policyId :: Lens' CreateLifecyclePolicyResponse (Maybe Text)
createLifecyclePolicyResponse_policyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLifecyclePolicyResponse' {Maybe Text
policyId :: Maybe Text
$sel:policyId:CreateLifecyclePolicyResponse' :: CreateLifecyclePolicyResponse -> Maybe Text
policyId} -> Maybe Text
policyId) (\s :: CreateLifecyclePolicyResponse
s@CreateLifecyclePolicyResponse' {} Maybe Text
a -> CreateLifecyclePolicyResponse
s {$sel:policyId:CreateLifecyclePolicyResponse' :: Maybe Text
policyId = Maybe Text
a} :: CreateLifecyclePolicyResponse)

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

instance Prelude.NFData CreateLifecyclePolicyResponse where
  rnf :: CreateLifecyclePolicyResponse -> ()
rnf CreateLifecyclePolicyResponse' {Int
Maybe Text
httpStatus :: Int
policyId :: Maybe Text
$sel:httpStatus:CreateLifecyclePolicyResponse' :: CreateLifecyclePolicyResponse -> Int
$sel:policyId:CreateLifecyclePolicyResponse' :: CreateLifecyclePolicyResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus