{-# 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 #-}
module Amazonka.CodeArtifact.GetRepositoryPermissionsPolicy
(
GetRepositoryPermissionsPolicy (..),
newGetRepositoryPermissionsPolicy,
getRepositoryPermissionsPolicy_domainOwner,
getRepositoryPermissionsPolicy_domain,
getRepositoryPermissionsPolicy_repository,
GetRepositoryPermissionsPolicyResponse (..),
newGetRepositoryPermissionsPolicyResponse,
getRepositoryPermissionsPolicyResponse_policy,
getRepositoryPermissionsPolicyResponse_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
data GetRepositoryPermissionsPolicy = GetRepositoryPermissionsPolicy'
{
GetRepositoryPermissionsPolicy -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
GetRepositoryPermissionsPolicy -> Text
domain :: Prelude.Text,
GetRepositoryPermissionsPolicy -> Text
repository :: Prelude.Text
}
deriving (GetRepositoryPermissionsPolicy
-> GetRepositoryPermissionsPolicy -> Bool
(GetRepositoryPermissionsPolicy
-> GetRepositoryPermissionsPolicy -> Bool)
-> (GetRepositoryPermissionsPolicy
-> GetRepositoryPermissionsPolicy -> Bool)
-> Eq GetRepositoryPermissionsPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRepositoryPermissionsPolicy
-> GetRepositoryPermissionsPolicy -> Bool
$c/= :: GetRepositoryPermissionsPolicy
-> GetRepositoryPermissionsPolicy -> Bool
== :: GetRepositoryPermissionsPolicy
-> GetRepositoryPermissionsPolicy -> Bool
$c== :: GetRepositoryPermissionsPolicy
-> GetRepositoryPermissionsPolicy -> Bool
Prelude.Eq, ReadPrec [GetRepositoryPermissionsPolicy]
ReadPrec GetRepositoryPermissionsPolicy
Int -> ReadS GetRepositoryPermissionsPolicy
ReadS [GetRepositoryPermissionsPolicy]
(Int -> ReadS GetRepositoryPermissionsPolicy)
-> ReadS [GetRepositoryPermissionsPolicy]
-> ReadPrec GetRepositoryPermissionsPolicy
-> ReadPrec [GetRepositoryPermissionsPolicy]
-> Read GetRepositoryPermissionsPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRepositoryPermissionsPolicy]
$creadListPrec :: ReadPrec [GetRepositoryPermissionsPolicy]
readPrec :: ReadPrec GetRepositoryPermissionsPolicy
$creadPrec :: ReadPrec GetRepositoryPermissionsPolicy
readList :: ReadS [GetRepositoryPermissionsPolicy]
$creadList :: ReadS [GetRepositoryPermissionsPolicy]
readsPrec :: Int -> ReadS GetRepositoryPermissionsPolicy
$creadsPrec :: Int -> ReadS GetRepositoryPermissionsPolicy
Prelude.Read, Int -> GetRepositoryPermissionsPolicy -> ShowS
[GetRepositoryPermissionsPolicy] -> ShowS
GetRepositoryPermissionsPolicy -> String
(Int -> GetRepositoryPermissionsPolicy -> ShowS)
-> (GetRepositoryPermissionsPolicy -> String)
-> ([GetRepositoryPermissionsPolicy] -> ShowS)
-> Show GetRepositoryPermissionsPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRepositoryPermissionsPolicy] -> ShowS
$cshowList :: [GetRepositoryPermissionsPolicy] -> ShowS
show :: GetRepositoryPermissionsPolicy -> String
$cshow :: GetRepositoryPermissionsPolicy -> String
showsPrec :: Int -> GetRepositoryPermissionsPolicy -> ShowS
$cshowsPrec :: Int -> GetRepositoryPermissionsPolicy -> ShowS
Prelude.Show, (forall x.
GetRepositoryPermissionsPolicy
-> Rep GetRepositoryPermissionsPolicy x)
-> (forall x.
Rep GetRepositoryPermissionsPolicy x
-> GetRepositoryPermissionsPolicy)
-> Generic GetRepositoryPermissionsPolicy
forall x.
Rep GetRepositoryPermissionsPolicy x
-> GetRepositoryPermissionsPolicy
forall x.
GetRepositoryPermissionsPolicy
-> Rep GetRepositoryPermissionsPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRepositoryPermissionsPolicy x
-> GetRepositoryPermissionsPolicy
$cfrom :: forall x.
GetRepositoryPermissionsPolicy
-> Rep GetRepositoryPermissionsPolicy x
Prelude.Generic)
newGetRepositoryPermissionsPolicy ::
Prelude.Text ->
Prelude.Text ->
GetRepositoryPermissionsPolicy
newGetRepositoryPermissionsPolicy :: Text -> Text -> GetRepositoryPermissionsPolicy
newGetRepositoryPermissionsPolicy
Text
pDomain_
Text
pRepository_ =
GetRepositoryPermissionsPolicy' :: Maybe Text -> Text -> Text -> GetRepositoryPermissionsPolicy
GetRepositoryPermissionsPolicy'
{ $sel:domainOwner:GetRepositoryPermissionsPolicy' :: Maybe Text
domainOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domain:GetRepositoryPermissionsPolicy' :: Text
domain = Text
pDomain_,
$sel:repository:GetRepositoryPermissionsPolicy' :: Text
repository = Text
pRepository_
}
getRepositoryPermissionsPolicy_domainOwner :: Lens.Lens' GetRepositoryPermissionsPolicy (Prelude.Maybe Prelude.Text)
getRepositoryPermissionsPolicy_domainOwner :: (Maybe Text -> f (Maybe Text))
-> GetRepositoryPermissionsPolicy
-> f GetRepositoryPermissionsPolicy
getRepositoryPermissionsPolicy_domainOwner = (GetRepositoryPermissionsPolicy -> Maybe Text)
-> (GetRepositoryPermissionsPolicy
-> Maybe Text -> GetRepositoryPermissionsPolicy)
-> Lens
GetRepositoryPermissionsPolicy
GetRepositoryPermissionsPolicy
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryPermissionsPolicy' {Maybe Text
domainOwner :: Maybe Text
$sel:domainOwner:GetRepositoryPermissionsPolicy' :: GetRepositoryPermissionsPolicy -> Maybe Text
domainOwner} -> Maybe Text
domainOwner) (\s :: GetRepositoryPermissionsPolicy
s@GetRepositoryPermissionsPolicy' {} Maybe Text
a -> GetRepositoryPermissionsPolicy
s {$sel:domainOwner:GetRepositoryPermissionsPolicy' :: Maybe Text
domainOwner = Maybe Text
a} :: GetRepositoryPermissionsPolicy)
getRepositoryPermissionsPolicy_domain :: Lens.Lens' GetRepositoryPermissionsPolicy Prelude.Text
getRepositoryPermissionsPolicy_domain :: (Text -> f Text)
-> GetRepositoryPermissionsPolicy
-> f GetRepositoryPermissionsPolicy
getRepositoryPermissionsPolicy_domain = (GetRepositoryPermissionsPolicy -> Text)
-> (GetRepositoryPermissionsPolicy
-> Text -> GetRepositoryPermissionsPolicy)
-> Lens
GetRepositoryPermissionsPolicy
GetRepositoryPermissionsPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryPermissionsPolicy' {Text
domain :: Text
$sel:domain:GetRepositoryPermissionsPolicy' :: GetRepositoryPermissionsPolicy -> Text
domain} -> Text
domain) (\s :: GetRepositoryPermissionsPolicy
s@GetRepositoryPermissionsPolicy' {} Text
a -> GetRepositoryPermissionsPolicy
s {$sel:domain:GetRepositoryPermissionsPolicy' :: Text
domain = Text
a} :: GetRepositoryPermissionsPolicy)
getRepositoryPermissionsPolicy_repository :: Lens.Lens' GetRepositoryPermissionsPolicy Prelude.Text
getRepositoryPermissionsPolicy_repository :: (Text -> f Text)
-> GetRepositoryPermissionsPolicy
-> f GetRepositoryPermissionsPolicy
getRepositoryPermissionsPolicy_repository = (GetRepositoryPermissionsPolicy -> Text)
-> (GetRepositoryPermissionsPolicy
-> Text -> GetRepositoryPermissionsPolicy)
-> Lens
GetRepositoryPermissionsPolicy
GetRepositoryPermissionsPolicy
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryPermissionsPolicy' {Text
repository :: Text
$sel:repository:GetRepositoryPermissionsPolicy' :: GetRepositoryPermissionsPolicy -> Text
repository} -> Text
repository) (\s :: GetRepositoryPermissionsPolicy
s@GetRepositoryPermissionsPolicy' {} Text
a -> GetRepositoryPermissionsPolicy
s {$sel:repository:GetRepositoryPermissionsPolicy' :: Text
repository = Text
a} :: GetRepositoryPermissionsPolicy)
instance
Core.AWSRequest
GetRepositoryPermissionsPolicy
where
type
AWSResponse GetRepositoryPermissionsPolicy =
GetRepositoryPermissionsPolicyResponse
request :: GetRepositoryPermissionsPolicy
-> Request GetRepositoryPermissionsPolicy
request = Service
-> GetRepositoryPermissionsPolicy
-> Request GetRepositoryPermissionsPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetRepositoryPermissionsPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetRepositoryPermissionsPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetRepositoryPermissionsPolicy))
-> Logger
-> Service
-> Proxy GetRepositoryPermissionsPolicy
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetRepositoryPermissionsPolicy)))
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 -> GetRepositoryPermissionsPolicyResponse
GetRepositoryPermissionsPolicyResponse'
(Maybe ResourcePolicy
-> Int -> GetRepositoryPermissionsPolicyResponse)
-> Either String (Maybe ResourcePolicy)
-> Either String (Int -> GetRepositoryPermissionsPolicyResponse)
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 -> GetRepositoryPermissionsPolicyResponse)
-> Either String Int
-> Either String GetRepositoryPermissionsPolicyResponse
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
GetRepositoryPermissionsPolicy
instance
Prelude.NFData
GetRepositoryPermissionsPolicy
instance
Core.ToHeaders
GetRepositoryPermissionsPolicy
where
toHeaders :: GetRepositoryPermissionsPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetRepositoryPermissionsPolicy -> 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 GetRepositoryPermissionsPolicy where
toPath :: GetRepositoryPermissionsPolicy -> ByteString
toPath =
ByteString -> GetRepositoryPermissionsPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/repository/permissions/policy"
instance Core.ToQuery GetRepositoryPermissionsPolicy where
toQuery :: GetRepositoryPermissionsPolicy -> QueryString
toQuery GetRepositoryPermissionsPolicy' {Maybe Text
Text
repository :: Text
domain :: Text
domainOwner :: Maybe Text
$sel:repository:GetRepositoryPermissionsPolicy' :: GetRepositoryPermissionsPolicy -> Text
$sel:domain:GetRepositoryPermissionsPolicy' :: GetRepositoryPermissionsPolicy -> Text
$sel:domainOwner:GetRepositoryPermissionsPolicy' :: GetRepositoryPermissionsPolicy -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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
]
data GetRepositoryPermissionsPolicyResponse = GetRepositoryPermissionsPolicyResponse'
{
GetRepositoryPermissionsPolicyResponse -> Maybe ResourcePolicy
policy :: Prelude.Maybe ResourcePolicy,
GetRepositoryPermissionsPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetRepositoryPermissionsPolicyResponse
-> GetRepositoryPermissionsPolicyResponse -> Bool
(GetRepositoryPermissionsPolicyResponse
-> GetRepositoryPermissionsPolicyResponse -> Bool)
-> (GetRepositoryPermissionsPolicyResponse
-> GetRepositoryPermissionsPolicyResponse -> Bool)
-> Eq GetRepositoryPermissionsPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRepositoryPermissionsPolicyResponse
-> GetRepositoryPermissionsPolicyResponse -> Bool
$c/= :: GetRepositoryPermissionsPolicyResponse
-> GetRepositoryPermissionsPolicyResponse -> Bool
== :: GetRepositoryPermissionsPolicyResponse
-> GetRepositoryPermissionsPolicyResponse -> Bool
$c== :: GetRepositoryPermissionsPolicyResponse
-> GetRepositoryPermissionsPolicyResponse -> Bool
Prelude.Eq, ReadPrec [GetRepositoryPermissionsPolicyResponse]
ReadPrec GetRepositoryPermissionsPolicyResponse
Int -> ReadS GetRepositoryPermissionsPolicyResponse
ReadS [GetRepositoryPermissionsPolicyResponse]
(Int -> ReadS GetRepositoryPermissionsPolicyResponse)
-> ReadS [GetRepositoryPermissionsPolicyResponse]
-> ReadPrec GetRepositoryPermissionsPolicyResponse
-> ReadPrec [GetRepositoryPermissionsPolicyResponse]
-> Read GetRepositoryPermissionsPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRepositoryPermissionsPolicyResponse]
$creadListPrec :: ReadPrec [GetRepositoryPermissionsPolicyResponse]
readPrec :: ReadPrec GetRepositoryPermissionsPolicyResponse
$creadPrec :: ReadPrec GetRepositoryPermissionsPolicyResponse
readList :: ReadS [GetRepositoryPermissionsPolicyResponse]
$creadList :: ReadS [GetRepositoryPermissionsPolicyResponse]
readsPrec :: Int -> ReadS GetRepositoryPermissionsPolicyResponse
$creadsPrec :: Int -> ReadS GetRepositoryPermissionsPolicyResponse
Prelude.Read, Int -> GetRepositoryPermissionsPolicyResponse -> ShowS
[GetRepositoryPermissionsPolicyResponse] -> ShowS
GetRepositoryPermissionsPolicyResponse -> String
(Int -> GetRepositoryPermissionsPolicyResponse -> ShowS)
-> (GetRepositoryPermissionsPolicyResponse -> String)
-> ([GetRepositoryPermissionsPolicyResponse] -> ShowS)
-> Show GetRepositoryPermissionsPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRepositoryPermissionsPolicyResponse] -> ShowS
$cshowList :: [GetRepositoryPermissionsPolicyResponse] -> ShowS
show :: GetRepositoryPermissionsPolicyResponse -> String
$cshow :: GetRepositoryPermissionsPolicyResponse -> String
showsPrec :: Int -> GetRepositoryPermissionsPolicyResponse -> ShowS
$cshowsPrec :: Int -> GetRepositoryPermissionsPolicyResponse -> ShowS
Prelude.Show, (forall x.
GetRepositoryPermissionsPolicyResponse
-> Rep GetRepositoryPermissionsPolicyResponse x)
-> (forall x.
Rep GetRepositoryPermissionsPolicyResponse x
-> GetRepositoryPermissionsPolicyResponse)
-> Generic GetRepositoryPermissionsPolicyResponse
forall x.
Rep GetRepositoryPermissionsPolicyResponse x
-> GetRepositoryPermissionsPolicyResponse
forall x.
GetRepositoryPermissionsPolicyResponse
-> Rep GetRepositoryPermissionsPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRepositoryPermissionsPolicyResponse x
-> GetRepositoryPermissionsPolicyResponse
$cfrom :: forall x.
GetRepositoryPermissionsPolicyResponse
-> Rep GetRepositoryPermissionsPolicyResponse x
Prelude.Generic)
newGetRepositoryPermissionsPolicyResponse ::
Prelude.Int ->
GetRepositoryPermissionsPolicyResponse
newGetRepositoryPermissionsPolicyResponse :: Int -> GetRepositoryPermissionsPolicyResponse
newGetRepositoryPermissionsPolicyResponse
Int
pHttpStatus_ =
GetRepositoryPermissionsPolicyResponse' :: Maybe ResourcePolicy
-> Int -> GetRepositoryPermissionsPolicyResponse
GetRepositoryPermissionsPolicyResponse'
{ $sel:policy:GetRepositoryPermissionsPolicyResponse' :: Maybe ResourcePolicy
policy =
Maybe ResourcePolicy
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetRepositoryPermissionsPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getRepositoryPermissionsPolicyResponse_policy :: Lens.Lens' GetRepositoryPermissionsPolicyResponse (Prelude.Maybe ResourcePolicy)
getRepositoryPermissionsPolicyResponse_policy :: (Maybe ResourcePolicy -> f (Maybe ResourcePolicy))
-> GetRepositoryPermissionsPolicyResponse
-> f GetRepositoryPermissionsPolicyResponse
getRepositoryPermissionsPolicyResponse_policy = (GetRepositoryPermissionsPolicyResponse -> Maybe ResourcePolicy)
-> (GetRepositoryPermissionsPolicyResponse
-> Maybe ResourcePolicy -> GetRepositoryPermissionsPolicyResponse)
-> Lens
GetRepositoryPermissionsPolicyResponse
GetRepositoryPermissionsPolicyResponse
(Maybe ResourcePolicy)
(Maybe ResourcePolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryPermissionsPolicyResponse' {Maybe ResourcePolicy
policy :: Maybe ResourcePolicy
$sel:policy:GetRepositoryPermissionsPolicyResponse' :: GetRepositoryPermissionsPolicyResponse -> Maybe ResourcePolicy
policy} -> Maybe ResourcePolicy
policy) (\s :: GetRepositoryPermissionsPolicyResponse
s@GetRepositoryPermissionsPolicyResponse' {} Maybe ResourcePolicy
a -> GetRepositoryPermissionsPolicyResponse
s {$sel:policy:GetRepositoryPermissionsPolicyResponse' :: Maybe ResourcePolicy
policy = Maybe ResourcePolicy
a} :: GetRepositoryPermissionsPolicyResponse)
getRepositoryPermissionsPolicyResponse_httpStatus :: Lens.Lens' GetRepositoryPermissionsPolicyResponse Prelude.Int
getRepositoryPermissionsPolicyResponse_httpStatus :: (Int -> f Int)
-> GetRepositoryPermissionsPolicyResponse
-> f GetRepositoryPermissionsPolicyResponse
getRepositoryPermissionsPolicyResponse_httpStatus = (GetRepositoryPermissionsPolicyResponse -> Int)
-> (GetRepositoryPermissionsPolicyResponse
-> Int -> GetRepositoryPermissionsPolicyResponse)
-> Lens
GetRepositoryPermissionsPolicyResponse
GetRepositoryPermissionsPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryPermissionsPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRepositoryPermissionsPolicyResponse' :: GetRepositoryPermissionsPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRepositoryPermissionsPolicyResponse
s@GetRepositoryPermissionsPolicyResponse' {} Int
a -> GetRepositoryPermissionsPolicyResponse
s {$sel:httpStatus:GetRepositoryPermissionsPolicyResponse' :: Int
httpStatus = Int
a} :: GetRepositoryPermissionsPolicyResponse)
instance
Prelude.NFData
GetRepositoryPermissionsPolicyResponse