{-# 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.KMS.PutKeyPolicy
-- 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)
--
-- Attaches a key policy to the specified KMS key.
--
-- For more information about key policies, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html Key Policies>
-- in the /Key Management Service Developer Guide/. For help writing and
-- formatting a JSON policy document, see the
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html IAM JSON Policy Reference>
-- in the //Identity and Access Management User Guide// . For examples of
-- adding a key policy in multiple programming languages, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/programming-key-policies.html#put-policy Setting a key policy>
-- in the /Key Management Service Developer Guide/.
--
-- __Cross-account use__: No. You cannot perform this operation on a KMS
-- key in a different Amazon Web Services account.
--
-- __Required permissions__:
-- <https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html kms:PutKeyPolicy>
-- (key policy)
--
-- __Related operations__: GetKeyPolicy
module Amazonka.KMS.PutKeyPolicy
  ( -- * Creating a Request
    PutKeyPolicy (..),
    newPutKeyPolicy,

    -- * Request Lenses
    putKeyPolicy_bypassPolicyLockoutSafetyCheck,
    putKeyPolicy_keyId,
    putKeyPolicy_policyName,
    putKeyPolicy_policy,

    -- * Destructuring the Response
    PutKeyPolicyResponse (..),
    newPutKeyPolicyResponse,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.KMS.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:/ 'newPutKeyPolicy' smart constructor.
data PutKeyPolicy = PutKeyPolicy'
  { -- | A flag to indicate whether to bypass the key policy lockout safety
    -- check.
    --
    -- Setting this value to true increases the risk that the KMS key becomes
    -- unmanageable. Do not set this value to true indiscriminately.
    --
    -- For more information, refer to the scenario in the
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam Default Key Policy>
    -- section in the /Key Management Service Developer Guide/.
    --
    -- Use this parameter only when you intend to prevent the principal that is
    -- making the request from making a subsequent @PutKeyPolicy@ request on
    -- the KMS key.
    --
    -- The default value is false.
    PutKeyPolicy -> Maybe Bool
bypassPolicyLockoutSafetyCheck :: Prelude.Maybe Prelude.Bool,
    -- | Sets the key policy on the specified KMS key.
    --
    -- Specify the key ID or key ARN of the KMS key.
    --
    -- For example:
    --
    -- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
    --
    -- -   Key ARN:
    --     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
    --
    -- To get the key ID and key ARN for a KMS key, use ListKeys or
    -- DescribeKey.
    PutKeyPolicy -> Text
keyId :: Prelude.Text,
    -- | The name of the key policy. The only valid value is @default@.
    PutKeyPolicy -> Text
policyName :: Prelude.Text,
    -- | The key policy to attach to the KMS key.
    --
    -- The key policy must meet the following criteria:
    --
    -- -   If you don\'t set @BypassPolicyLockoutSafetyCheck@ to true, the key
    --     policy must allow the principal that is making the @PutKeyPolicy@
    --     request to make a subsequent @PutKeyPolicy@ request on the KMS key.
    --     This reduces the risk that the KMS key becomes unmanageable. For
    --     more information, refer to the scenario in the
    --     <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam Default Key Policy>
    --     section of the /Key Management Service Developer Guide/.
    --
    -- -   Each statement in the key policy must contain one or more
    --     principals. The principals in the key policy must exist and be
    --     visible to KMS. When you create a new Amazon Web Services principal
    --     (for example, an IAM user or role), you might need to enforce a
    --     delay before including the new principal in a key policy because the
    --     new principal might not be immediately visible to KMS. For more
    --     information, see
    --     <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency Changes that I make are not always immediately visible>
    --     in the /Amazon Web Services Identity and Access Management User
    --     Guide/.
    --
    -- The key policy cannot exceed 32 kilobytes (32768 bytes). For more
    -- information, see
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html Resource Quotas>
    -- in the /Key Management Service Developer Guide/.
    PutKeyPolicy -> Text
policy :: Prelude.Text
  }
  deriving (PutKeyPolicy -> PutKeyPolicy -> Bool
(PutKeyPolicy -> PutKeyPolicy -> Bool)
-> (PutKeyPolicy -> PutKeyPolicy -> Bool) -> Eq PutKeyPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutKeyPolicy -> PutKeyPolicy -> Bool
$c/= :: PutKeyPolicy -> PutKeyPolicy -> Bool
== :: PutKeyPolicy -> PutKeyPolicy -> Bool
$c== :: PutKeyPolicy -> PutKeyPolicy -> Bool
Prelude.Eq, ReadPrec [PutKeyPolicy]
ReadPrec PutKeyPolicy
Int -> ReadS PutKeyPolicy
ReadS [PutKeyPolicy]
(Int -> ReadS PutKeyPolicy)
-> ReadS [PutKeyPolicy]
-> ReadPrec PutKeyPolicy
-> ReadPrec [PutKeyPolicy]
-> Read PutKeyPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutKeyPolicy]
$creadListPrec :: ReadPrec [PutKeyPolicy]
readPrec :: ReadPrec PutKeyPolicy
$creadPrec :: ReadPrec PutKeyPolicy
readList :: ReadS [PutKeyPolicy]
$creadList :: ReadS [PutKeyPolicy]
readsPrec :: Int -> ReadS PutKeyPolicy
$creadsPrec :: Int -> ReadS PutKeyPolicy
Prelude.Read, Int -> PutKeyPolicy -> ShowS
[PutKeyPolicy] -> ShowS
PutKeyPolicy -> String
(Int -> PutKeyPolicy -> ShowS)
-> (PutKeyPolicy -> String)
-> ([PutKeyPolicy] -> ShowS)
-> Show PutKeyPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutKeyPolicy] -> ShowS
$cshowList :: [PutKeyPolicy] -> ShowS
show :: PutKeyPolicy -> String
$cshow :: PutKeyPolicy -> String
showsPrec :: Int -> PutKeyPolicy -> ShowS
$cshowsPrec :: Int -> PutKeyPolicy -> ShowS
Prelude.Show, (forall x. PutKeyPolicy -> Rep PutKeyPolicy x)
-> (forall x. Rep PutKeyPolicy x -> PutKeyPolicy)
-> Generic PutKeyPolicy
forall x. Rep PutKeyPolicy x -> PutKeyPolicy
forall x. PutKeyPolicy -> Rep PutKeyPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutKeyPolicy x -> PutKeyPolicy
$cfrom :: forall x. PutKeyPolicy -> Rep PutKeyPolicy x
Prelude.Generic)

-- |
-- Create a value of 'PutKeyPolicy' 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:
--
-- 'bypassPolicyLockoutSafetyCheck', 'putKeyPolicy_bypassPolicyLockoutSafetyCheck' - A flag to indicate whether to bypass the key policy lockout safety
-- check.
--
-- Setting this value to true increases the risk that the KMS key becomes
-- unmanageable. Do not set this value to true indiscriminately.
--
-- For more information, refer to the scenario in the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam Default Key Policy>
-- section in the /Key Management Service Developer Guide/.
--
-- Use this parameter only when you intend to prevent the principal that is
-- making the request from making a subsequent @PutKeyPolicy@ request on
-- the KMS key.
--
-- The default value is false.
--
-- 'keyId', 'putKeyPolicy_keyId' - Sets the key policy on the specified KMS key.
--
-- Specify the key ID or key ARN of the KMS key.
--
-- For example:
--
-- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- -   Key ARN:
--     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- To get the key ID and key ARN for a KMS key, use ListKeys or
-- DescribeKey.
--
-- 'policyName', 'putKeyPolicy_policyName' - The name of the key policy. The only valid value is @default@.
--
-- 'policy', 'putKeyPolicy_policy' - The key policy to attach to the KMS key.
--
-- The key policy must meet the following criteria:
--
-- -   If you don\'t set @BypassPolicyLockoutSafetyCheck@ to true, the key
--     policy must allow the principal that is making the @PutKeyPolicy@
--     request to make a subsequent @PutKeyPolicy@ request on the KMS key.
--     This reduces the risk that the KMS key becomes unmanageable. For
--     more information, refer to the scenario in the
--     <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam Default Key Policy>
--     section of the /Key Management Service Developer Guide/.
--
-- -   Each statement in the key policy must contain one or more
--     principals. The principals in the key policy must exist and be
--     visible to KMS. When you create a new Amazon Web Services principal
--     (for example, an IAM user or role), you might need to enforce a
--     delay before including the new principal in a key policy because the
--     new principal might not be immediately visible to KMS. For more
--     information, see
--     <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency Changes that I make are not always immediately visible>
--     in the /Amazon Web Services Identity and Access Management User
--     Guide/.
--
-- The key policy cannot exceed 32 kilobytes (32768 bytes). For more
-- information, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html Resource Quotas>
-- in the /Key Management Service Developer Guide/.
newPutKeyPolicy ::
  -- | 'keyId'
  Prelude.Text ->
  -- | 'policyName'
  Prelude.Text ->
  -- | 'policy'
  Prelude.Text ->
  PutKeyPolicy
newPutKeyPolicy :: Text -> Text -> Text -> PutKeyPolicy
newPutKeyPolicy Text
pKeyId_ Text
pPolicyName_ Text
pPolicy_ =
  PutKeyPolicy' :: Maybe Bool -> Text -> Text -> Text -> PutKeyPolicy
PutKeyPolicy'
    { $sel:bypassPolicyLockoutSafetyCheck:PutKeyPolicy' :: Maybe Bool
bypassPolicyLockoutSafetyCheck =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:keyId:PutKeyPolicy' :: Text
keyId = Text
pKeyId_,
      $sel:policyName:PutKeyPolicy' :: Text
policyName = Text
pPolicyName_,
      $sel:policy:PutKeyPolicy' :: Text
policy = Text
pPolicy_
    }

-- | A flag to indicate whether to bypass the key policy lockout safety
-- check.
--
-- Setting this value to true increases the risk that the KMS key becomes
-- unmanageable. Do not set this value to true indiscriminately.
--
-- For more information, refer to the scenario in the
-- <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam Default Key Policy>
-- section in the /Key Management Service Developer Guide/.
--
-- Use this parameter only when you intend to prevent the principal that is
-- making the request from making a subsequent @PutKeyPolicy@ request on
-- the KMS key.
--
-- The default value is false.
putKeyPolicy_bypassPolicyLockoutSafetyCheck :: Lens.Lens' PutKeyPolicy (Prelude.Maybe Prelude.Bool)
putKeyPolicy_bypassPolicyLockoutSafetyCheck :: (Maybe Bool -> f (Maybe Bool)) -> PutKeyPolicy -> f PutKeyPolicy
putKeyPolicy_bypassPolicyLockoutSafetyCheck = (PutKeyPolicy -> Maybe Bool)
-> (PutKeyPolicy -> Maybe Bool -> PutKeyPolicy)
-> Lens PutKeyPolicy PutKeyPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutKeyPolicy' {Maybe Bool
bypassPolicyLockoutSafetyCheck :: Maybe Bool
$sel:bypassPolicyLockoutSafetyCheck:PutKeyPolicy' :: PutKeyPolicy -> Maybe Bool
bypassPolicyLockoutSafetyCheck} -> Maybe Bool
bypassPolicyLockoutSafetyCheck) (\s :: PutKeyPolicy
s@PutKeyPolicy' {} Maybe Bool
a -> PutKeyPolicy
s {$sel:bypassPolicyLockoutSafetyCheck:PutKeyPolicy' :: Maybe Bool
bypassPolicyLockoutSafetyCheck = Maybe Bool
a} :: PutKeyPolicy)

-- | Sets the key policy on the specified KMS key.
--
-- Specify the key ID or key ARN of the KMS key.
--
-- For example:
--
-- -   Key ID: @1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- -   Key ARN:
--     @arn:aws:kms:us-east-2:111122223333:key\/1234abcd-12ab-34cd-56ef-1234567890ab@
--
-- To get the key ID and key ARN for a KMS key, use ListKeys or
-- DescribeKey.
putKeyPolicy_keyId :: Lens.Lens' PutKeyPolicy Prelude.Text
putKeyPolicy_keyId :: (Text -> f Text) -> PutKeyPolicy -> f PutKeyPolicy
putKeyPolicy_keyId = (PutKeyPolicy -> Text)
-> (PutKeyPolicy -> Text -> PutKeyPolicy)
-> Lens PutKeyPolicy PutKeyPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutKeyPolicy' {Text
keyId :: Text
$sel:keyId:PutKeyPolicy' :: PutKeyPolicy -> Text
keyId} -> Text
keyId) (\s :: PutKeyPolicy
s@PutKeyPolicy' {} Text
a -> PutKeyPolicy
s {$sel:keyId:PutKeyPolicy' :: Text
keyId = Text
a} :: PutKeyPolicy)

-- | The name of the key policy. The only valid value is @default@.
putKeyPolicy_policyName :: Lens.Lens' PutKeyPolicy Prelude.Text
putKeyPolicy_policyName :: (Text -> f Text) -> PutKeyPolicy -> f PutKeyPolicy
putKeyPolicy_policyName = (PutKeyPolicy -> Text)
-> (PutKeyPolicy -> Text -> PutKeyPolicy)
-> Lens PutKeyPolicy PutKeyPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutKeyPolicy' {Text
policyName :: Text
$sel:policyName:PutKeyPolicy' :: PutKeyPolicy -> Text
policyName} -> Text
policyName) (\s :: PutKeyPolicy
s@PutKeyPolicy' {} Text
a -> PutKeyPolicy
s {$sel:policyName:PutKeyPolicy' :: Text
policyName = Text
a} :: PutKeyPolicy)

-- | The key policy to attach to the KMS key.
--
-- The key policy must meet the following criteria:
--
-- -   If you don\'t set @BypassPolicyLockoutSafetyCheck@ to true, the key
--     policy must allow the principal that is making the @PutKeyPolicy@
--     request to make a subsequent @PutKeyPolicy@ request on the KMS key.
--     This reduces the risk that the KMS key becomes unmanageable. For
--     more information, refer to the scenario in the
--     <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam Default Key Policy>
--     section of the /Key Management Service Developer Guide/.
--
-- -   Each statement in the key policy must contain one or more
--     principals. The principals in the key policy must exist and be
--     visible to KMS. When you create a new Amazon Web Services principal
--     (for example, an IAM user or role), you might need to enforce a
--     delay before including the new principal in a key policy because the
--     new principal might not be immediately visible to KMS. For more
--     information, see
--     <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency Changes that I make are not always immediately visible>
--     in the /Amazon Web Services Identity and Access Management User
--     Guide/.
--
-- The key policy cannot exceed 32 kilobytes (32768 bytes). For more
-- information, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html Resource Quotas>
-- in the /Key Management Service Developer Guide/.
putKeyPolicy_policy :: Lens.Lens' PutKeyPolicy Prelude.Text
putKeyPolicy_policy :: (Text -> f Text) -> PutKeyPolicy -> f PutKeyPolicy
putKeyPolicy_policy = (PutKeyPolicy -> Text)
-> (PutKeyPolicy -> Text -> PutKeyPolicy)
-> Lens PutKeyPolicy PutKeyPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutKeyPolicy' {Text
policy :: Text
$sel:policy:PutKeyPolicy' :: PutKeyPolicy -> Text
policy} -> Text
policy) (\s :: PutKeyPolicy
s@PutKeyPolicy' {} Text
a -> PutKeyPolicy
s {$sel:policy:PutKeyPolicy' :: Text
policy = Text
a} :: PutKeyPolicy)

instance Core.AWSRequest PutKeyPolicy where
  type AWSResponse PutKeyPolicy = PutKeyPolicyResponse
  request :: PutKeyPolicy -> Request PutKeyPolicy
request = Service -> PutKeyPolicy -> Request PutKeyPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutKeyPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutKeyPolicy)))
response = AWSResponse PutKeyPolicy
-> Logger
-> Service
-> Proxy PutKeyPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutKeyPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutKeyPolicy
PutKeyPolicyResponse
PutKeyPolicyResponse'

instance Prelude.Hashable PutKeyPolicy

instance Prelude.NFData PutKeyPolicy

instance Core.ToHeaders PutKeyPolicy where
  toHeaders :: PutKeyPolicy -> [Header]
toHeaders =
    [Header] -> PutKeyPolicy -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# (ByteString
"TrentService.PutKeyPolicy" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PutKeyPolicy where
  toJSON :: PutKeyPolicy -> Value
toJSON PutKeyPolicy' {Maybe Bool
Text
policy :: Text
policyName :: Text
keyId :: Text
bypassPolicyLockoutSafetyCheck :: Maybe Bool
$sel:policy:PutKeyPolicy' :: PutKeyPolicy -> Text
$sel:policyName:PutKeyPolicy' :: PutKeyPolicy -> Text
$sel:keyId:PutKeyPolicy' :: PutKeyPolicy -> Text
$sel:bypassPolicyLockoutSafetyCheck:PutKeyPolicy' :: PutKeyPolicy -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"BypassPolicyLockoutSafetyCheck" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
bypassPolicyLockoutSafetyCheck,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"KeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PolicyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
policyName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Policy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
policy)
          ]
      )

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

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

-- | /See:/ 'newPutKeyPolicyResponse' smart constructor.
data PutKeyPolicyResponse = PutKeyPolicyResponse'
  {
  }
  deriving (PutKeyPolicyResponse -> PutKeyPolicyResponse -> Bool
(PutKeyPolicyResponse -> PutKeyPolicyResponse -> Bool)
-> (PutKeyPolicyResponse -> PutKeyPolicyResponse -> Bool)
-> Eq PutKeyPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutKeyPolicyResponse -> PutKeyPolicyResponse -> Bool
$c/= :: PutKeyPolicyResponse -> PutKeyPolicyResponse -> Bool
== :: PutKeyPolicyResponse -> PutKeyPolicyResponse -> Bool
$c== :: PutKeyPolicyResponse -> PutKeyPolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutKeyPolicyResponse]
ReadPrec PutKeyPolicyResponse
Int -> ReadS PutKeyPolicyResponse
ReadS [PutKeyPolicyResponse]
(Int -> ReadS PutKeyPolicyResponse)
-> ReadS [PutKeyPolicyResponse]
-> ReadPrec PutKeyPolicyResponse
-> ReadPrec [PutKeyPolicyResponse]
-> Read PutKeyPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutKeyPolicyResponse]
$creadListPrec :: ReadPrec [PutKeyPolicyResponse]
readPrec :: ReadPrec PutKeyPolicyResponse
$creadPrec :: ReadPrec PutKeyPolicyResponse
readList :: ReadS [PutKeyPolicyResponse]
$creadList :: ReadS [PutKeyPolicyResponse]
readsPrec :: Int -> ReadS PutKeyPolicyResponse
$creadsPrec :: Int -> ReadS PutKeyPolicyResponse
Prelude.Read, Int -> PutKeyPolicyResponse -> ShowS
[PutKeyPolicyResponse] -> ShowS
PutKeyPolicyResponse -> String
(Int -> PutKeyPolicyResponse -> ShowS)
-> (PutKeyPolicyResponse -> String)
-> ([PutKeyPolicyResponse] -> ShowS)
-> Show PutKeyPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutKeyPolicyResponse] -> ShowS
$cshowList :: [PutKeyPolicyResponse] -> ShowS
show :: PutKeyPolicyResponse -> String
$cshow :: PutKeyPolicyResponse -> String
showsPrec :: Int -> PutKeyPolicyResponse -> ShowS
$cshowsPrec :: Int -> PutKeyPolicyResponse -> ShowS
Prelude.Show, (forall x. PutKeyPolicyResponse -> Rep PutKeyPolicyResponse x)
-> (forall x. Rep PutKeyPolicyResponse x -> PutKeyPolicyResponse)
-> Generic PutKeyPolicyResponse
forall x. Rep PutKeyPolicyResponse x -> PutKeyPolicyResponse
forall x. PutKeyPolicyResponse -> Rep PutKeyPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutKeyPolicyResponse x -> PutKeyPolicyResponse
$cfrom :: forall x. PutKeyPolicyResponse -> Rep PutKeyPolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutKeyPolicyResponse' 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.
newPutKeyPolicyResponse ::
  PutKeyPolicyResponse
newPutKeyPolicyResponse :: PutKeyPolicyResponse
newPutKeyPolicyResponse = PutKeyPolicyResponse
PutKeyPolicyResponse'

instance Prelude.NFData PutKeyPolicyResponse