{-# 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.CodeArtifact.DeleteRepositoryPermissionsPolicy
-- 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)
--
-- Deletes the resource policy that is set on a repository. After a
-- resource policy is deleted, the permissions allowed and denied by the
-- deleted policy are removed. The effect of deleting a resource policy
-- might not be immediate.
--
-- Use @DeleteRepositoryPermissionsPolicy@ with caution. After a policy is
-- deleted, AWS users, roles, and accounts lose permissions to perform the
-- repository actions granted by the deleted policy.
module Amazonka.CodeArtifact.DeleteRepositoryPermissionsPolicy
  ( -- * Creating a Request
    DeleteRepositoryPermissionsPolicy (..),
    newDeleteRepositoryPermissionsPolicy,

    -- * Request Lenses
    deleteRepositoryPermissionsPolicy_policyRevision,
    deleteRepositoryPermissionsPolicy_domainOwner,
    deleteRepositoryPermissionsPolicy_domain,
    deleteRepositoryPermissionsPolicy_repository,

    -- * Destructuring the Response
    DeleteRepositoryPermissionsPolicyResponse (..),
    newDeleteRepositoryPermissionsPolicyResponse,

    -- * Response Lenses
    deleteRepositoryPermissionsPolicyResponse_policy,
    deleteRepositoryPermissionsPolicyResponse_httpStatus,
  )
where

import Amazonka.CodeArtifact.Types
import qualified Amazonka.Core as Core
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:/ 'newDeleteRepositoryPermissionsPolicy' smart constructor.
data DeleteRepositoryPermissionsPolicy = DeleteRepositoryPermissionsPolicy'
  { -- | The revision of the repository\'s resource policy to be deleted. This
    -- revision is used for optimistic locking, which prevents others from
    -- accidentally overwriting your changes to the repository\'s resource
    -- policy.
    DeleteRepositoryPermissionsPolicy -> Maybe Text
policyRevision :: Prelude.Maybe Prelude.Text,
    -- | The 12-digit account number of the AWS account that owns the domain. It
    -- does not include dashes or spaces.
    DeleteRepositoryPermissionsPolicy -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the domain that contains the repository associated with the
    -- resource policy to be deleted.
    DeleteRepositoryPermissionsPolicy -> Text
domain :: Prelude.Text,
    -- | The name of the repository that is associated with the resource policy
    -- to be deleted
    DeleteRepositoryPermissionsPolicy -> Text
repository :: Prelude.Text
  }
  deriving (DeleteRepositoryPermissionsPolicy
-> DeleteRepositoryPermissionsPolicy -> Bool
(DeleteRepositoryPermissionsPolicy
 -> DeleteRepositoryPermissionsPolicy -> Bool)
-> (DeleteRepositoryPermissionsPolicy
    -> DeleteRepositoryPermissionsPolicy -> Bool)
-> Eq DeleteRepositoryPermissionsPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRepositoryPermissionsPolicy
-> DeleteRepositoryPermissionsPolicy -> Bool
$c/= :: DeleteRepositoryPermissionsPolicy
-> DeleteRepositoryPermissionsPolicy -> Bool
== :: DeleteRepositoryPermissionsPolicy
-> DeleteRepositoryPermissionsPolicy -> Bool
$c== :: DeleteRepositoryPermissionsPolicy
-> DeleteRepositoryPermissionsPolicy -> Bool
Prelude.Eq, ReadPrec [DeleteRepositoryPermissionsPolicy]
ReadPrec DeleteRepositoryPermissionsPolicy
Int -> ReadS DeleteRepositoryPermissionsPolicy
ReadS [DeleteRepositoryPermissionsPolicy]
(Int -> ReadS DeleteRepositoryPermissionsPolicy)
-> ReadS [DeleteRepositoryPermissionsPolicy]
-> ReadPrec DeleteRepositoryPermissionsPolicy
-> ReadPrec [DeleteRepositoryPermissionsPolicy]
-> Read DeleteRepositoryPermissionsPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRepositoryPermissionsPolicy]
$creadListPrec :: ReadPrec [DeleteRepositoryPermissionsPolicy]
readPrec :: ReadPrec DeleteRepositoryPermissionsPolicy
$creadPrec :: ReadPrec DeleteRepositoryPermissionsPolicy
readList :: ReadS [DeleteRepositoryPermissionsPolicy]
$creadList :: ReadS [DeleteRepositoryPermissionsPolicy]
readsPrec :: Int -> ReadS DeleteRepositoryPermissionsPolicy
$creadsPrec :: Int -> ReadS DeleteRepositoryPermissionsPolicy
Prelude.Read, Int -> DeleteRepositoryPermissionsPolicy -> ShowS
[DeleteRepositoryPermissionsPolicy] -> ShowS
DeleteRepositoryPermissionsPolicy -> String
(Int -> DeleteRepositoryPermissionsPolicy -> ShowS)
-> (DeleteRepositoryPermissionsPolicy -> String)
-> ([DeleteRepositoryPermissionsPolicy] -> ShowS)
-> Show DeleteRepositoryPermissionsPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRepositoryPermissionsPolicy] -> ShowS
$cshowList :: [DeleteRepositoryPermissionsPolicy] -> ShowS
show :: DeleteRepositoryPermissionsPolicy -> String
$cshow :: DeleteRepositoryPermissionsPolicy -> String
showsPrec :: Int -> DeleteRepositoryPermissionsPolicy -> ShowS
$cshowsPrec :: Int -> DeleteRepositoryPermissionsPolicy -> ShowS
Prelude.Show, (forall x.
 DeleteRepositoryPermissionsPolicy
 -> Rep DeleteRepositoryPermissionsPolicy x)
-> (forall x.
    Rep DeleteRepositoryPermissionsPolicy x
    -> DeleteRepositoryPermissionsPolicy)
-> Generic DeleteRepositoryPermissionsPolicy
forall x.
Rep DeleteRepositoryPermissionsPolicy x
-> DeleteRepositoryPermissionsPolicy
forall x.
DeleteRepositoryPermissionsPolicy
-> Rep DeleteRepositoryPermissionsPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRepositoryPermissionsPolicy x
-> DeleteRepositoryPermissionsPolicy
$cfrom :: forall x.
DeleteRepositoryPermissionsPolicy
-> Rep DeleteRepositoryPermissionsPolicy x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRepositoryPermissionsPolicy' 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:
--
-- 'policyRevision', 'deleteRepositoryPermissionsPolicy_policyRevision' - The revision of the repository\'s resource policy to be deleted. This
-- revision is used for optimistic locking, which prevents others from
-- accidentally overwriting your changes to the repository\'s resource
-- policy.
--
-- 'domainOwner', 'deleteRepositoryPermissionsPolicy_domainOwner' - The 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
--
-- 'domain', 'deleteRepositoryPermissionsPolicy_domain' - The name of the domain that contains the repository associated with the
-- resource policy to be deleted.
--
-- 'repository', 'deleteRepositoryPermissionsPolicy_repository' - The name of the repository that is associated with the resource policy
-- to be deleted
newDeleteRepositoryPermissionsPolicy ::
  -- | 'domain'
  Prelude.Text ->
  -- | 'repository'
  Prelude.Text ->
  DeleteRepositoryPermissionsPolicy
newDeleteRepositoryPermissionsPolicy :: Text -> Text -> DeleteRepositoryPermissionsPolicy
newDeleteRepositoryPermissionsPolicy
  Text
pDomain_
  Text
pRepository_ =
    DeleteRepositoryPermissionsPolicy' :: Maybe Text
-> Maybe Text -> Text -> Text -> DeleteRepositoryPermissionsPolicy
DeleteRepositoryPermissionsPolicy'
      { $sel:policyRevision:DeleteRepositoryPermissionsPolicy' :: Maybe Text
policyRevision =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:domainOwner:DeleteRepositoryPermissionsPolicy' :: Maybe Text
domainOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:domain:DeleteRepositoryPermissionsPolicy' :: Text
domain = Text
pDomain_,
        $sel:repository:DeleteRepositoryPermissionsPolicy' :: Text
repository = Text
pRepository_
      }

-- | The revision of the repository\'s resource policy to be deleted. This
-- revision is used for optimistic locking, which prevents others from
-- accidentally overwriting your changes to the repository\'s resource
-- policy.
deleteRepositoryPermissionsPolicy_policyRevision :: Lens.Lens' DeleteRepositoryPermissionsPolicy (Prelude.Maybe Prelude.Text)
deleteRepositoryPermissionsPolicy_policyRevision :: (Maybe Text -> f (Maybe Text))
-> DeleteRepositoryPermissionsPolicy
-> f DeleteRepositoryPermissionsPolicy
deleteRepositoryPermissionsPolicy_policyRevision = (DeleteRepositoryPermissionsPolicy -> Maybe Text)
-> (DeleteRepositoryPermissionsPolicy
    -> Maybe Text -> DeleteRepositoryPermissionsPolicy)
-> Lens
     DeleteRepositoryPermissionsPolicy
     DeleteRepositoryPermissionsPolicy
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRepositoryPermissionsPolicy' {Maybe Text
policyRevision :: Maybe Text
$sel:policyRevision:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Maybe Text
policyRevision} -> Maybe Text
policyRevision) (\s :: DeleteRepositoryPermissionsPolicy
s@DeleteRepositoryPermissionsPolicy' {} Maybe Text
a -> DeleteRepositoryPermissionsPolicy
s {$sel:policyRevision:DeleteRepositoryPermissionsPolicy' :: Maybe Text
policyRevision = Maybe Text
a} :: DeleteRepositoryPermissionsPolicy)

-- | The 12-digit account number of the AWS account that owns the domain. It
-- does not include dashes or spaces.
deleteRepositoryPermissionsPolicy_domainOwner :: Lens.Lens' DeleteRepositoryPermissionsPolicy (Prelude.Maybe Prelude.Text)
deleteRepositoryPermissionsPolicy_domainOwner :: (Maybe Text -> f (Maybe Text))
-> DeleteRepositoryPermissionsPolicy
-> f DeleteRepositoryPermissionsPolicy
deleteRepositoryPermissionsPolicy_domainOwner = (DeleteRepositoryPermissionsPolicy -> Maybe Text)
-> (DeleteRepositoryPermissionsPolicy
    -> Maybe Text -> DeleteRepositoryPermissionsPolicy)
-> Lens
     DeleteRepositoryPermissionsPolicy
     DeleteRepositoryPermissionsPolicy
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRepositoryPermissionsPolicy' {Maybe Text
domainOwner :: Maybe Text
$sel:domainOwner:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Maybe Text
domainOwner} -> Maybe Text
domainOwner) (\s :: DeleteRepositoryPermissionsPolicy
s@DeleteRepositoryPermissionsPolicy' {} Maybe Text
a -> DeleteRepositoryPermissionsPolicy
s {$sel:domainOwner:DeleteRepositoryPermissionsPolicy' :: Maybe Text
domainOwner = Maybe Text
a} :: DeleteRepositoryPermissionsPolicy)

-- | The name of the domain that contains the repository associated with the
-- resource policy to be deleted.
deleteRepositoryPermissionsPolicy_domain :: Lens.Lens' DeleteRepositoryPermissionsPolicy Prelude.Text
deleteRepositoryPermissionsPolicy_domain :: (Text -> f Text)
-> DeleteRepositoryPermissionsPolicy
-> f DeleteRepositoryPermissionsPolicy
deleteRepositoryPermissionsPolicy_domain = (DeleteRepositoryPermissionsPolicy -> Text)
-> (DeleteRepositoryPermissionsPolicy
    -> Text -> DeleteRepositoryPermissionsPolicy)
-> Lens
     DeleteRepositoryPermissionsPolicy
     DeleteRepositoryPermissionsPolicy
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRepositoryPermissionsPolicy' {Text
domain :: Text
$sel:domain:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Text
domain} -> Text
domain) (\s :: DeleteRepositoryPermissionsPolicy
s@DeleteRepositoryPermissionsPolicy' {} Text
a -> DeleteRepositoryPermissionsPolicy
s {$sel:domain:DeleteRepositoryPermissionsPolicy' :: Text
domain = Text
a} :: DeleteRepositoryPermissionsPolicy)

-- | The name of the repository that is associated with the resource policy
-- to be deleted
deleteRepositoryPermissionsPolicy_repository :: Lens.Lens' DeleteRepositoryPermissionsPolicy Prelude.Text
deleteRepositoryPermissionsPolicy_repository :: (Text -> f Text)
-> DeleteRepositoryPermissionsPolicy
-> f DeleteRepositoryPermissionsPolicy
deleteRepositoryPermissionsPolicy_repository = (DeleteRepositoryPermissionsPolicy -> Text)
-> (DeleteRepositoryPermissionsPolicy
    -> Text -> DeleteRepositoryPermissionsPolicy)
-> Lens
     DeleteRepositoryPermissionsPolicy
     DeleteRepositoryPermissionsPolicy
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRepositoryPermissionsPolicy' {Text
repository :: Text
$sel:repository:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Text
repository} -> Text
repository) (\s :: DeleteRepositoryPermissionsPolicy
s@DeleteRepositoryPermissionsPolicy' {} Text
a -> DeleteRepositoryPermissionsPolicy
s {$sel:repository:DeleteRepositoryPermissionsPolicy' :: Text
repository = Text
a} :: DeleteRepositoryPermissionsPolicy)

instance
  Core.AWSRequest
    DeleteRepositoryPermissionsPolicy
  where
  type
    AWSResponse DeleteRepositoryPermissionsPolicy =
      DeleteRepositoryPermissionsPolicyResponse
  request :: DeleteRepositoryPermissionsPolicy
-> Request DeleteRepositoryPermissionsPolicy
request = Service
-> DeleteRepositoryPermissionsPolicy
-> Request DeleteRepositoryPermissionsPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteRepositoryPermissionsPolicy
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteRepositoryPermissionsPolicy)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DeleteRepositoryPermissionsPolicy))
-> Logger
-> Service
-> Proxy DeleteRepositoryPermissionsPolicy
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteRepositoryPermissionsPolicy)))
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 ResourcePolicy
-> Int -> DeleteRepositoryPermissionsPolicyResponse
DeleteRepositoryPermissionsPolicyResponse'
            (Maybe ResourcePolicy
 -> Int -> DeleteRepositoryPermissionsPolicyResponse)
-> Either String (Maybe ResourcePolicy)
-> Either String (Int -> DeleteRepositoryPermissionsPolicyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ResourcePolicy)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"policy")
              Either String (Int -> DeleteRepositoryPermissionsPolicyResponse)
-> Either String Int
-> Either String DeleteRepositoryPermissionsPolicyResponse
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
    DeleteRepositoryPermissionsPolicy

instance
  Prelude.NFData
    DeleteRepositoryPermissionsPolicy

instance
  Core.ToHeaders
    DeleteRepositoryPermissionsPolicy
  where
  toHeaders :: DeleteRepositoryPermissionsPolicy -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DeleteRepositoryPermissionsPolicy -> 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
    DeleteRepositoryPermissionsPolicy
  where
  toPath :: DeleteRepositoryPermissionsPolicy -> ByteString
toPath =
    ByteString -> DeleteRepositoryPermissionsPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/repository/permissions/policies"

instance
  Core.ToQuery
    DeleteRepositoryPermissionsPolicy
  where
  toQuery :: DeleteRepositoryPermissionsPolicy -> QueryString
toQuery DeleteRepositoryPermissionsPolicy' {Maybe Text
Text
repository :: Text
domain :: Text
domainOwner :: Maybe Text
policyRevision :: Maybe Text
$sel:repository:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Text
$sel:domain:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Text
$sel:domainOwner:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Maybe Text
$sel:policyRevision:DeleteRepositoryPermissionsPolicy' :: DeleteRepositoryPermissionsPolicy -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"policy-revision" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
policyRevision,
        ByteString
"domain-owner" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
domainOwner,
        ByteString
"domain" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domain,
        ByteString
"repository" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
repository
      ]

-- | /See:/ 'newDeleteRepositoryPermissionsPolicyResponse' smart constructor.
data DeleteRepositoryPermissionsPolicyResponse = DeleteRepositoryPermissionsPolicyResponse'
  { -- | Information about the deleted policy after processing the request.
    DeleteRepositoryPermissionsPolicyResponse -> Maybe ResourcePolicy
policy :: Prelude.Maybe ResourcePolicy,
    -- | The response's http status code.
    DeleteRepositoryPermissionsPolicyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteRepositoryPermissionsPolicyResponse
-> DeleteRepositoryPermissionsPolicyResponse -> Bool
(DeleteRepositoryPermissionsPolicyResponse
 -> DeleteRepositoryPermissionsPolicyResponse -> Bool)
-> (DeleteRepositoryPermissionsPolicyResponse
    -> DeleteRepositoryPermissionsPolicyResponse -> Bool)
-> Eq DeleteRepositoryPermissionsPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRepositoryPermissionsPolicyResponse
-> DeleteRepositoryPermissionsPolicyResponse -> Bool
$c/= :: DeleteRepositoryPermissionsPolicyResponse
-> DeleteRepositoryPermissionsPolicyResponse -> Bool
== :: DeleteRepositoryPermissionsPolicyResponse
-> DeleteRepositoryPermissionsPolicyResponse -> Bool
$c== :: DeleteRepositoryPermissionsPolicyResponse
-> DeleteRepositoryPermissionsPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRepositoryPermissionsPolicyResponse]
ReadPrec DeleteRepositoryPermissionsPolicyResponse
Int -> ReadS DeleteRepositoryPermissionsPolicyResponse
ReadS [DeleteRepositoryPermissionsPolicyResponse]
(Int -> ReadS DeleteRepositoryPermissionsPolicyResponse)
-> ReadS [DeleteRepositoryPermissionsPolicyResponse]
-> ReadPrec DeleteRepositoryPermissionsPolicyResponse
-> ReadPrec [DeleteRepositoryPermissionsPolicyResponse]
-> Read DeleteRepositoryPermissionsPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRepositoryPermissionsPolicyResponse]
$creadListPrec :: ReadPrec [DeleteRepositoryPermissionsPolicyResponse]
readPrec :: ReadPrec DeleteRepositoryPermissionsPolicyResponse
$creadPrec :: ReadPrec DeleteRepositoryPermissionsPolicyResponse
readList :: ReadS [DeleteRepositoryPermissionsPolicyResponse]
$creadList :: ReadS [DeleteRepositoryPermissionsPolicyResponse]
readsPrec :: Int -> ReadS DeleteRepositoryPermissionsPolicyResponse
$creadsPrec :: Int -> ReadS DeleteRepositoryPermissionsPolicyResponse
Prelude.Read, Int -> DeleteRepositoryPermissionsPolicyResponse -> ShowS
[DeleteRepositoryPermissionsPolicyResponse] -> ShowS
DeleteRepositoryPermissionsPolicyResponse -> String
(Int -> DeleteRepositoryPermissionsPolicyResponse -> ShowS)
-> (DeleteRepositoryPermissionsPolicyResponse -> String)
-> ([DeleteRepositoryPermissionsPolicyResponse] -> ShowS)
-> Show DeleteRepositoryPermissionsPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRepositoryPermissionsPolicyResponse] -> ShowS
$cshowList :: [DeleteRepositoryPermissionsPolicyResponse] -> ShowS
show :: DeleteRepositoryPermissionsPolicyResponse -> String
$cshow :: DeleteRepositoryPermissionsPolicyResponse -> String
showsPrec :: Int -> DeleteRepositoryPermissionsPolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteRepositoryPermissionsPolicyResponse -> ShowS
Prelude.Show, (forall x.
 DeleteRepositoryPermissionsPolicyResponse
 -> Rep DeleteRepositoryPermissionsPolicyResponse x)
-> (forall x.
    Rep DeleteRepositoryPermissionsPolicyResponse x
    -> DeleteRepositoryPermissionsPolicyResponse)
-> Generic DeleteRepositoryPermissionsPolicyResponse
forall x.
Rep DeleteRepositoryPermissionsPolicyResponse x
-> DeleteRepositoryPermissionsPolicyResponse
forall x.
DeleteRepositoryPermissionsPolicyResponse
-> Rep DeleteRepositoryPermissionsPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRepositoryPermissionsPolicyResponse x
-> DeleteRepositoryPermissionsPolicyResponse
$cfrom :: forall x.
DeleteRepositoryPermissionsPolicyResponse
-> Rep DeleteRepositoryPermissionsPolicyResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRepositoryPermissionsPolicyResponse' 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:
--
-- 'policy', 'deleteRepositoryPermissionsPolicyResponse_policy' - Information about the deleted policy after processing the request.
--
-- 'httpStatus', 'deleteRepositoryPermissionsPolicyResponse_httpStatus' - The response's http status code.
newDeleteRepositoryPermissionsPolicyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteRepositoryPermissionsPolicyResponse
newDeleteRepositoryPermissionsPolicyResponse :: Int -> DeleteRepositoryPermissionsPolicyResponse
newDeleteRepositoryPermissionsPolicyResponse
  Int
pHttpStatus_ =
    DeleteRepositoryPermissionsPolicyResponse' :: Maybe ResourcePolicy
-> Int -> DeleteRepositoryPermissionsPolicyResponse
DeleteRepositoryPermissionsPolicyResponse'
      { $sel:policy:DeleteRepositoryPermissionsPolicyResponse' :: Maybe ResourcePolicy
policy =
          Maybe ResourcePolicy
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DeleteRepositoryPermissionsPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the deleted policy after processing the request.
deleteRepositoryPermissionsPolicyResponse_policy :: Lens.Lens' DeleteRepositoryPermissionsPolicyResponse (Prelude.Maybe ResourcePolicy)
deleteRepositoryPermissionsPolicyResponse_policy :: (Maybe ResourcePolicy -> f (Maybe ResourcePolicy))
-> DeleteRepositoryPermissionsPolicyResponse
-> f DeleteRepositoryPermissionsPolicyResponse
deleteRepositoryPermissionsPolicyResponse_policy = (DeleteRepositoryPermissionsPolicyResponse -> Maybe ResourcePolicy)
-> (DeleteRepositoryPermissionsPolicyResponse
    -> Maybe ResourcePolicy
    -> DeleteRepositoryPermissionsPolicyResponse)
-> Lens
     DeleteRepositoryPermissionsPolicyResponse
     DeleteRepositoryPermissionsPolicyResponse
     (Maybe ResourcePolicy)
     (Maybe ResourcePolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRepositoryPermissionsPolicyResponse' {Maybe ResourcePolicy
policy :: Maybe ResourcePolicy
$sel:policy:DeleteRepositoryPermissionsPolicyResponse' :: DeleteRepositoryPermissionsPolicyResponse -> Maybe ResourcePolicy
policy} -> Maybe ResourcePolicy
policy) (\s :: DeleteRepositoryPermissionsPolicyResponse
s@DeleteRepositoryPermissionsPolicyResponse' {} Maybe ResourcePolicy
a -> DeleteRepositoryPermissionsPolicyResponse
s {$sel:policy:DeleteRepositoryPermissionsPolicyResponse' :: Maybe ResourcePolicy
policy = Maybe ResourcePolicy
a} :: DeleteRepositoryPermissionsPolicyResponse)

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

instance
  Prelude.NFData
    DeleteRepositoryPermissionsPolicyResponse