{-# 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.GetLifecyclePolicies
-- 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)
--
-- Gets summary information about all or the specified data lifecycle
-- policies.
--
-- To get complete information about a policy, use GetLifecyclePolicy.
module Amazonka.DLM.GetLifecyclePolicies
  ( -- * Creating a Request
    GetLifecyclePolicies (..),
    newGetLifecyclePolicies,

    -- * Request Lenses
    getLifecyclePolicies_state,
    getLifecyclePolicies_targetTags,
    getLifecyclePolicies_tagsToAdd,
    getLifecyclePolicies_policyIds,
    getLifecyclePolicies_resourceTypes,

    -- * Destructuring the Response
    GetLifecyclePoliciesResponse (..),
    newGetLifecyclePoliciesResponse,

    -- * Response Lenses
    getLifecyclePoliciesResponse_policies,
    getLifecyclePoliciesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DLM.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:/ 'newGetLifecyclePolicies' smart constructor.
data GetLifecyclePolicies = GetLifecyclePolicies'
  { -- | The activation state.
    GetLifecyclePolicies -> Maybe GettablePolicyStateValues
state :: Prelude.Maybe GettablePolicyStateValues,
    -- | The target tag for a policy.
    --
    -- Tags are strings in the format @key=value@.
    GetLifecyclePolicies -> Maybe (NonEmpty Text)
targetTags :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The tags to add to objects created by the policy.
    --
    -- Tags are strings in the format @key=value@.
    --
    -- These user-defined tags are added in addition to the Amazon Web
    -- Services-added lifecycle tags.
    GetLifecyclePolicies -> Maybe [Text]
tagsToAdd :: Prelude.Maybe [Prelude.Text],
    -- | The identifiers of the data lifecycle policies.
    GetLifecyclePolicies -> Maybe [Text]
policyIds :: Prelude.Maybe [Prelude.Text],
    -- | The resource type.
    GetLifecyclePolicies -> Maybe (NonEmpty ResourceTypeValues)
resourceTypes :: Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues)
  }
  deriving (GetLifecyclePolicies -> GetLifecyclePolicies -> Bool
(GetLifecyclePolicies -> GetLifecyclePolicies -> Bool)
-> (GetLifecyclePolicies -> GetLifecyclePolicies -> Bool)
-> Eq GetLifecyclePolicies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLifecyclePolicies -> GetLifecyclePolicies -> Bool
$c/= :: GetLifecyclePolicies -> GetLifecyclePolicies -> Bool
== :: GetLifecyclePolicies -> GetLifecyclePolicies -> Bool
$c== :: GetLifecyclePolicies -> GetLifecyclePolicies -> Bool
Prelude.Eq, ReadPrec [GetLifecyclePolicies]
ReadPrec GetLifecyclePolicies
Int -> ReadS GetLifecyclePolicies
ReadS [GetLifecyclePolicies]
(Int -> ReadS GetLifecyclePolicies)
-> ReadS [GetLifecyclePolicies]
-> ReadPrec GetLifecyclePolicies
-> ReadPrec [GetLifecyclePolicies]
-> Read GetLifecyclePolicies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLifecyclePolicies]
$creadListPrec :: ReadPrec [GetLifecyclePolicies]
readPrec :: ReadPrec GetLifecyclePolicies
$creadPrec :: ReadPrec GetLifecyclePolicies
readList :: ReadS [GetLifecyclePolicies]
$creadList :: ReadS [GetLifecyclePolicies]
readsPrec :: Int -> ReadS GetLifecyclePolicies
$creadsPrec :: Int -> ReadS GetLifecyclePolicies
Prelude.Read, Int -> GetLifecyclePolicies -> ShowS
[GetLifecyclePolicies] -> ShowS
GetLifecyclePolicies -> String
(Int -> GetLifecyclePolicies -> ShowS)
-> (GetLifecyclePolicies -> String)
-> ([GetLifecyclePolicies] -> ShowS)
-> Show GetLifecyclePolicies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLifecyclePolicies] -> ShowS
$cshowList :: [GetLifecyclePolicies] -> ShowS
show :: GetLifecyclePolicies -> String
$cshow :: GetLifecyclePolicies -> String
showsPrec :: Int -> GetLifecyclePolicies -> ShowS
$cshowsPrec :: Int -> GetLifecyclePolicies -> ShowS
Prelude.Show, (forall x. GetLifecyclePolicies -> Rep GetLifecyclePolicies x)
-> (forall x. Rep GetLifecyclePolicies x -> GetLifecyclePolicies)
-> Generic GetLifecyclePolicies
forall x. Rep GetLifecyclePolicies x -> GetLifecyclePolicies
forall x. GetLifecyclePolicies -> Rep GetLifecyclePolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLifecyclePolicies x -> GetLifecyclePolicies
$cfrom :: forall x. GetLifecyclePolicies -> Rep GetLifecyclePolicies x
Prelude.Generic)

-- |
-- Create a value of 'GetLifecyclePolicies' 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:
--
-- 'state', 'getLifecyclePolicies_state' - The activation state.
--
-- 'targetTags', 'getLifecyclePolicies_targetTags' - The target tag for a policy.
--
-- Tags are strings in the format @key=value@.
--
-- 'tagsToAdd', 'getLifecyclePolicies_tagsToAdd' - The tags to add to objects created by the policy.
--
-- Tags are strings in the format @key=value@.
--
-- These user-defined tags are added in addition to the Amazon Web
-- Services-added lifecycle tags.
--
-- 'policyIds', 'getLifecyclePolicies_policyIds' - The identifiers of the data lifecycle policies.
--
-- 'resourceTypes', 'getLifecyclePolicies_resourceTypes' - The resource type.
newGetLifecyclePolicies ::
  GetLifecyclePolicies
newGetLifecyclePolicies :: GetLifecyclePolicies
newGetLifecyclePolicies =
  GetLifecyclePolicies' :: Maybe GettablePolicyStateValues
-> Maybe (NonEmpty Text)
-> Maybe [Text]
-> Maybe [Text]
-> Maybe (NonEmpty ResourceTypeValues)
-> GetLifecyclePolicies
GetLifecyclePolicies'
    { $sel:state:GetLifecyclePolicies' :: Maybe GettablePolicyStateValues
state = Maybe GettablePolicyStateValues
forall a. Maybe a
Prelude.Nothing,
      $sel:targetTags:GetLifecyclePolicies' :: Maybe (NonEmpty Text)
targetTags = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tagsToAdd:GetLifecyclePolicies' :: Maybe [Text]
tagsToAdd = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:policyIds:GetLifecyclePolicies' :: Maybe [Text]
policyIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceTypes:GetLifecyclePolicies' :: Maybe (NonEmpty ResourceTypeValues)
resourceTypes = Maybe (NonEmpty ResourceTypeValues)
forall a. Maybe a
Prelude.Nothing
    }

-- | The activation state.
getLifecyclePolicies_state :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe GettablePolicyStateValues)
getLifecyclePolicies_state :: (Maybe GettablePolicyStateValues
 -> f (Maybe GettablePolicyStateValues))
-> GetLifecyclePolicies -> f GetLifecyclePolicies
getLifecyclePolicies_state = (GetLifecyclePolicies -> Maybe GettablePolicyStateValues)
-> (GetLifecyclePolicies
    -> Maybe GettablePolicyStateValues -> GetLifecyclePolicies)
-> Lens
     GetLifecyclePolicies
     GetLifecyclePolicies
     (Maybe GettablePolicyStateValues)
     (Maybe GettablePolicyStateValues)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicies' {Maybe GettablePolicyStateValues
state :: Maybe GettablePolicyStateValues
$sel:state:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe GettablePolicyStateValues
state} -> Maybe GettablePolicyStateValues
state) (\s :: GetLifecyclePolicies
s@GetLifecyclePolicies' {} Maybe GettablePolicyStateValues
a -> GetLifecyclePolicies
s {$sel:state:GetLifecyclePolicies' :: Maybe GettablePolicyStateValues
state = Maybe GettablePolicyStateValues
a} :: GetLifecyclePolicies)

-- | The target tag for a policy.
--
-- Tags are strings in the format @key=value@.
getLifecyclePolicies_targetTags :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getLifecyclePolicies_targetTags :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetLifecyclePolicies -> f GetLifecyclePolicies
getLifecyclePolicies_targetTags = (GetLifecyclePolicies -> Maybe (NonEmpty Text))
-> (GetLifecyclePolicies
    -> Maybe (NonEmpty Text) -> GetLifecyclePolicies)
-> Lens
     GetLifecyclePolicies
     GetLifecyclePolicies
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicies' {Maybe (NonEmpty Text)
targetTags :: Maybe (NonEmpty Text)
$sel:targetTags:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe (NonEmpty Text)
targetTags} -> Maybe (NonEmpty Text)
targetTags) (\s :: GetLifecyclePolicies
s@GetLifecyclePolicies' {} Maybe (NonEmpty Text)
a -> GetLifecyclePolicies
s {$sel:targetTags:GetLifecyclePolicies' :: Maybe (NonEmpty Text)
targetTags = Maybe (NonEmpty Text)
a} :: GetLifecyclePolicies) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> GetLifecyclePolicies -> f GetLifecyclePolicies)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetLifecyclePolicies
-> f GetLifecyclePolicies
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tags to add to objects created by the policy.
--
-- Tags are strings in the format @key=value@.
--
-- These user-defined tags are added in addition to the Amazon Web
-- Services-added lifecycle tags.
getLifecyclePolicies_tagsToAdd :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe [Prelude.Text])
getLifecyclePolicies_tagsToAdd :: (Maybe [Text] -> f (Maybe [Text]))
-> GetLifecyclePolicies -> f GetLifecyclePolicies
getLifecyclePolicies_tagsToAdd = (GetLifecyclePolicies -> Maybe [Text])
-> (GetLifecyclePolicies -> Maybe [Text] -> GetLifecyclePolicies)
-> Lens
     GetLifecyclePolicies
     GetLifecyclePolicies
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicies' {Maybe [Text]
tagsToAdd :: Maybe [Text]
$sel:tagsToAdd:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe [Text]
tagsToAdd} -> Maybe [Text]
tagsToAdd) (\s :: GetLifecyclePolicies
s@GetLifecyclePolicies' {} Maybe [Text]
a -> GetLifecyclePolicies
s {$sel:tagsToAdd:GetLifecyclePolicies' :: Maybe [Text]
tagsToAdd = Maybe [Text]
a} :: GetLifecyclePolicies) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetLifecyclePolicies -> f GetLifecyclePolicies)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetLifecyclePolicies
-> f GetLifecyclePolicies
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifiers of the data lifecycle policies.
getLifecyclePolicies_policyIds :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe [Prelude.Text])
getLifecyclePolicies_policyIds :: (Maybe [Text] -> f (Maybe [Text]))
-> GetLifecyclePolicies -> f GetLifecyclePolicies
getLifecyclePolicies_policyIds = (GetLifecyclePolicies -> Maybe [Text])
-> (GetLifecyclePolicies -> Maybe [Text] -> GetLifecyclePolicies)
-> Lens
     GetLifecyclePolicies
     GetLifecyclePolicies
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicies' {Maybe [Text]
policyIds :: Maybe [Text]
$sel:policyIds:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe [Text]
policyIds} -> Maybe [Text]
policyIds) (\s :: GetLifecyclePolicies
s@GetLifecyclePolicies' {} Maybe [Text]
a -> GetLifecyclePolicies
s {$sel:policyIds:GetLifecyclePolicies' :: Maybe [Text]
policyIds = Maybe [Text]
a} :: GetLifecyclePolicies) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetLifecyclePolicies -> f GetLifecyclePolicies)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetLifecyclePolicies
-> f GetLifecyclePolicies
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The resource type.
getLifecyclePolicies_resourceTypes :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues))
getLifecyclePolicies_resourceTypes :: (Maybe (NonEmpty ResourceTypeValues)
 -> f (Maybe (NonEmpty ResourceTypeValues)))
-> GetLifecyclePolicies -> f GetLifecyclePolicies
getLifecyclePolicies_resourceTypes = (GetLifecyclePolicies -> Maybe (NonEmpty ResourceTypeValues))
-> (GetLifecyclePolicies
    -> Maybe (NonEmpty ResourceTypeValues) -> GetLifecyclePolicies)
-> Lens
     GetLifecyclePolicies
     GetLifecyclePolicies
     (Maybe (NonEmpty ResourceTypeValues))
     (Maybe (NonEmpty ResourceTypeValues))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePolicies' {Maybe (NonEmpty ResourceTypeValues)
resourceTypes :: Maybe (NonEmpty ResourceTypeValues)
$sel:resourceTypes:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe (NonEmpty ResourceTypeValues)
resourceTypes} -> Maybe (NonEmpty ResourceTypeValues)
resourceTypes) (\s :: GetLifecyclePolicies
s@GetLifecyclePolicies' {} Maybe (NonEmpty ResourceTypeValues)
a -> GetLifecyclePolicies
s {$sel:resourceTypes:GetLifecyclePolicies' :: Maybe (NonEmpty ResourceTypeValues)
resourceTypes = Maybe (NonEmpty ResourceTypeValues)
a} :: GetLifecyclePolicies) ((Maybe (NonEmpty ResourceTypeValues)
  -> f (Maybe (NonEmpty ResourceTypeValues)))
 -> GetLifecyclePolicies -> f GetLifecyclePolicies)
-> ((Maybe (NonEmpty ResourceTypeValues)
     -> f (Maybe (NonEmpty ResourceTypeValues)))
    -> Maybe (NonEmpty ResourceTypeValues)
    -> f (Maybe (NonEmpty ResourceTypeValues)))
-> (Maybe (NonEmpty ResourceTypeValues)
    -> f (Maybe (NonEmpty ResourceTypeValues)))
-> GetLifecyclePolicies
-> f GetLifecyclePolicies
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ResourceTypeValues)
  (NonEmpty ResourceTypeValues)
  (NonEmpty ResourceTypeValues)
  (NonEmpty ResourceTypeValues)
-> Iso
     (Maybe (NonEmpty ResourceTypeValues))
     (Maybe (NonEmpty ResourceTypeValues))
     (Maybe (NonEmpty ResourceTypeValues))
     (Maybe (NonEmpty ResourceTypeValues))
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
  (NonEmpty ResourceTypeValues)
  (NonEmpty ResourceTypeValues)
  (NonEmpty ResourceTypeValues)
  (NonEmpty ResourceTypeValues)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest GetLifecyclePolicies where
  type
    AWSResponse GetLifecyclePolicies =
      GetLifecyclePoliciesResponse
  request :: GetLifecyclePolicies -> Request GetLifecyclePolicies
request = Service -> GetLifecyclePolicies -> Request GetLifecyclePolicies
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetLifecyclePolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetLifecyclePolicies)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetLifecyclePolicies))
-> Logger
-> Service
-> Proxy GetLifecyclePolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetLifecyclePolicies)))
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 [LifecyclePolicySummary]
-> Int -> GetLifecyclePoliciesResponse
GetLifecyclePoliciesResponse'
            (Maybe [LifecyclePolicySummary]
 -> Int -> GetLifecyclePoliciesResponse)
-> Either String (Maybe [LifecyclePolicySummary])
-> Either String (Int -> GetLifecyclePoliciesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [LifecyclePolicySummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Policies" Either String (Maybe (Maybe [LifecyclePolicySummary]))
-> Maybe [LifecyclePolicySummary]
-> Either String (Maybe [LifecyclePolicySummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [LifecyclePolicySummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetLifecyclePoliciesResponse)
-> Either String Int -> Either String GetLifecyclePoliciesResponse
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 GetLifecyclePolicies

instance Prelude.NFData GetLifecyclePolicies

instance Core.ToHeaders GetLifecyclePolicies where
  toHeaders :: GetLifecyclePolicies -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetLifecyclePolicies -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath GetLifecyclePolicies where
  toPath :: GetLifecyclePolicies -> ByteString
toPath = ByteString -> GetLifecyclePolicies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/policies"

instance Core.ToQuery GetLifecyclePolicies where
  toQuery :: GetLifecyclePolicies -> QueryString
toQuery GetLifecyclePolicies' {Maybe [Text]
Maybe (NonEmpty Text)
Maybe (NonEmpty ResourceTypeValues)
Maybe GettablePolicyStateValues
resourceTypes :: Maybe (NonEmpty ResourceTypeValues)
policyIds :: Maybe [Text]
tagsToAdd :: Maybe [Text]
targetTags :: Maybe (NonEmpty Text)
state :: Maybe GettablePolicyStateValues
$sel:resourceTypes:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe (NonEmpty ResourceTypeValues)
$sel:policyIds:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe [Text]
$sel:tagsToAdd:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe [Text]
$sel:targetTags:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe (NonEmpty Text)
$sel:state:GetLifecyclePolicies' :: GetLifecyclePolicies -> Maybe GettablePolicyStateValues
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"state" ByteString -> Maybe GettablePolicyStateValues -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe GettablePolicyStateValues
state,
        ByteString
"targetTags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> NonEmpty Text -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" (NonEmpty Text -> QueryString)
-> Maybe (NonEmpty Text) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
targetTags),
        ByteString
"tagsToAdd"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagsToAdd),
        ByteString
"policyIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
policyIds),
        ByteString
"resourceTypes"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> NonEmpty ResourceTypeValues -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                (NonEmpty ResourceTypeValues -> QueryString)
-> Maybe (NonEmpty ResourceTypeValues) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ResourceTypeValues)
resourceTypes
            )
      ]

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

-- |
-- Create a value of 'GetLifecyclePoliciesResponse' 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:
--
-- 'policies', 'getLifecyclePoliciesResponse_policies' - Summary information about the lifecycle policies.
--
-- 'httpStatus', 'getLifecyclePoliciesResponse_httpStatus' - The response's http status code.
newGetLifecyclePoliciesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetLifecyclePoliciesResponse
newGetLifecyclePoliciesResponse :: Int -> GetLifecyclePoliciesResponse
newGetLifecyclePoliciesResponse Int
pHttpStatus_ =
  GetLifecyclePoliciesResponse' :: Maybe [LifecyclePolicySummary]
-> Int -> GetLifecyclePoliciesResponse
GetLifecyclePoliciesResponse'
    { $sel:policies:GetLifecyclePoliciesResponse' :: Maybe [LifecyclePolicySummary]
policies =
        Maybe [LifecyclePolicySummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetLifecyclePoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Summary information about the lifecycle policies.
getLifecyclePoliciesResponse_policies :: Lens.Lens' GetLifecyclePoliciesResponse (Prelude.Maybe [LifecyclePolicySummary])
getLifecyclePoliciesResponse_policies :: (Maybe [LifecyclePolicySummary]
 -> f (Maybe [LifecyclePolicySummary]))
-> GetLifecyclePoliciesResponse -> f GetLifecyclePoliciesResponse
getLifecyclePoliciesResponse_policies = (GetLifecyclePoliciesResponse -> Maybe [LifecyclePolicySummary])
-> (GetLifecyclePoliciesResponse
    -> Maybe [LifecyclePolicySummary] -> GetLifecyclePoliciesResponse)
-> Lens
     GetLifecyclePoliciesResponse
     GetLifecyclePoliciesResponse
     (Maybe [LifecyclePolicySummary])
     (Maybe [LifecyclePolicySummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLifecyclePoliciesResponse' {Maybe [LifecyclePolicySummary]
policies :: Maybe [LifecyclePolicySummary]
$sel:policies:GetLifecyclePoliciesResponse' :: GetLifecyclePoliciesResponse -> Maybe [LifecyclePolicySummary]
policies} -> Maybe [LifecyclePolicySummary]
policies) (\s :: GetLifecyclePoliciesResponse
s@GetLifecyclePoliciesResponse' {} Maybe [LifecyclePolicySummary]
a -> GetLifecyclePoliciesResponse
s {$sel:policies:GetLifecyclePoliciesResponse' :: Maybe [LifecyclePolicySummary]
policies = Maybe [LifecyclePolicySummary]
a} :: GetLifecyclePoliciesResponse) ((Maybe [LifecyclePolicySummary]
  -> f (Maybe [LifecyclePolicySummary]))
 -> GetLifecyclePoliciesResponse -> f GetLifecyclePoliciesResponse)
-> ((Maybe [LifecyclePolicySummary]
     -> f (Maybe [LifecyclePolicySummary]))
    -> Maybe [LifecyclePolicySummary]
    -> f (Maybe [LifecyclePolicySummary]))
-> (Maybe [LifecyclePolicySummary]
    -> f (Maybe [LifecyclePolicySummary]))
-> GetLifecyclePoliciesResponse
-> f GetLifecyclePoliciesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LifecyclePolicySummary]
  [LifecyclePolicySummary]
  [LifecyclePolicySummary]
  [LifecyclePolicySummary]
-> Iso
     (Maybe [LifecyclePolicySummary])
     (Maybe [LifecyclePolicySummary])
     (Maybe [LifecyclePolicySummary])
     (Maybe [LifecyclePolicySummary])
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
  [LifecyclePolicySummary]
  [LifecyclePolicySummary]
  [LifecyclePolicySummary]
  [LifecyclePolicySummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetLifecyclePoliciesResponse