{-# 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.DescribeRepository
(
DescribeRepository (..),
newDescribeRepository,
describeRepository_domainOwner,
describeRepository_domain,
describeRepository_repository,
DescribeRepositoryResponse (..),
newDescribeRepositoryResponse,
describeRepositoryResponse_repository,
describeRepositoryResponse_httpStatus,
)
where
import Amazonka.CodeArtifact.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeRepository = DescribeRepository'
{
DescribeRepository -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
DescribeRepository -> Text
domain :: Prelude.Text,
DescribeRepository -> Text
repository :: Prelude.Text
}
deriving (DescribeRepository -> DescribeRepository -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRepository -> DescribeRepository -> Bool
$c/= :: DescribeRepository -> DescribeRepository -> Bool
== :: DescribeRepository -> DescribeRepository -> Bool
$c== :: DescribeRepository -> DescribeRepository -> Bool
Prelude.Eq, ReadPrec [DescribeRepository]
ReadPrec DescribeRepository
Int -> ReadS DescribeRepository
ReadS [DescribeRepository]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRepository]
$creadListPrec :: ReadPrec [DescribeRepository]
readPrec :: ReadPrec DescribeRepository
$creadPrec :: ReadPrec DescribeRepository
readList :: ReadS [DescribeRepository]
$creadList :: ReadS [DescribeRepository]
readsPrec :: Int -> ReadS DescribeRepository
$creadsPrec :: Int -> ReadS DescribeRepository
Prelude.Read, Int -> DescribeRepository -> ShowS
[DescribeRepository] -> ShowS
DescribeRepository -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRepository] -> ShowS
$cshowList :: [DescribeRepository] -> ShowS
show :: DescribeRepository -> String
$cshow :: DescribeRepository -> String
showsPrec :: Int -> DescribeRepository -> ShowS
$cshowsPrec :: Int -> DescribeRepository -> ShowS
Prelude.Show, forall x. Rep DescribeRepository x -> DescribeRepository
forall x. DescribeRepository -> Rep DescribeRepository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRepository x -> DescribeRepository
$cfrom :: forall x. DescribeRepository -> Rep DescribeRepository x
Prelude.Generic)
newDescribeRepository ::
Prelude.Text ->
Prelude.Text ->
DescribeRepository
newDescribeRepository :: Text -> Text -> DescribeRepository
newDescribeRepository Text
pDomain_ Text
pRepository_ =
DescribeRepository'
{ $sel:domainOwner:DescribeRepository' :: Maybe Text
domainOwner = forall a. Maybe a
Prelude.Nothing,
$sel:domain:DescribeRepository' :: Text
domain = Text
pDomain_,
$sel:repository:DescribeRepository' :: Text
repository = Text
pRepository_
}
describeRepository_domainOwner :: Lens.Lens' DescribeRepository (Prelude.Maybe Prelude.Text)
describeRepository_domainOwner :: Lens' DescribeRepository (Maybe Text)
describeRepository_domainOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRepository' {Maybe Text
domainOwner :: Maybe Text
$sel:domainOwner:DescribeRepository' :: DescribeRepository -> Maybe Text
domainOwner} -> Maybe Text
domainOwner) (\s :: DescribeRepository
s@DescribeRepository' {} Maybe Text
a -> DescribeRepository
s {$sel:domainOwner:DescribeRepository' :: Maybe Text
domainOwner = Maybe Text
a} :: DescribeRepository)
describeRepository_domain :: Lens.Lens' DescribeRepository Prelude.Text
describeRepository_domain :: Lens' DescribeRepository Text
describeRepository_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRepository' {Text
domain :: Text
$sel:domain:DescribeRepository' :: DescribeRepository -> Text
domain} -> Text
domain) (\s :: DescribeRepository
s@DescribeRepository' {} Text
a -> DescribeRepository
s {$sel:domain:DescribeRepository' :: Text
domain = Text
a} :: DescribeRepository)
describeRepository_repository :: Lens.Lens' DescribeRepository Prelude.Text
describeRepository_repository :: Lens' DescribeRepository Text
describeRepository_repository = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRepository' {Text
repository :: Text
$sel:repository:DescribeRepository' :: DescribeRepository -> Text
repository} -> Text
repository) (\s :: DescribeRepository
s@DescribeRepository' {} Text
a -> DescribeRepository
s {$sel:repository:DescribeRepository' :: Text
repository = Text
a} :: DescribeRepository)
instance Core.AWSRequest DescribeRepository where
type
AWSResponse DescribeRepository =
DescribeRepositoryResponse
request :: (Service -> Service)
-> DescribeRepository -> Request DescribeRepository
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeRepository
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRepository)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe RepositoryDescription -> Int -> DescribeRepositoryResponse
DescribeRepositoryResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"repository")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeRepository where
hashWithSalt :: Int -> DescribeRepository -> Int
hashWithSalt Int
_salt DescribeRepository' {Maybe Text
Text
repository :: Text
domain :: Text
domainOwner :: Maybe Text
$sel:repository:DescribeRepository' :: DescribeRepository -> Text
$sel:domain:DescribeRepository' :: DescribeRepository -> Text
$sel:domainOwner:DescribeRepository' :: DescribeRepository -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainOwner
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
repository
instance Prelude.NFData DescribeRepository where
rnf :: DescribeRepository -> ()
rnf DescribeRepository' {Maybe Text
Text
repository :: Text
domain :: Text
domainOwner :: Maybe Text
$sel:repository:DescribeRepository' :: DescribeRepository -> Text
$sel:domain:DescribeRepository' :: DescribeRepository -> Text
$sel:domainOwner:DescribeRepository' :: DescribeRepository -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainOwner
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
repository
instance Data.ToHeaders DescribeRepository where
toHeaders :: DescribeRepository -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DescribeRepository where
toPath :: DescribeRepository -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/v1/repository"
instance Data.ToQuery DescribeRepository where
toQuery :: DescribeRepository -> QueryString
toQuery DescribeRepository' {Maybe Text
Text
repository :: Text
domain :: Text
domainOwner :: Maybe Text
$sel:repository:DescribeRepository' :: DescribeRepository -> Text
$sel:domain:DescribeRepository' :: DescribeRepository -> Text
$sel:domainOwner:DescribeRepository' :: DescribeRepository -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"domain-owner" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
domainOwner,
ByteString
"domain" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
domain,
ByteString
"repository" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
repository
]
data DescribeRepositoryResponse = DescribeRepositoryResponse'
{
DescribeRepositoryResponse -> Maybe RepositoryDescription
repository :: Prelude.Maybe RepositoryDescription,
DescribeRepositoryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRepositoryResponse -> DescribeRepositoryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRepositoryResponse -> DescribeRepositoryResponse -> Bool
$c/= :: DescribeRepositoryResponse -> DescribeRepositoryResponse -> Bool
== :: DescribeRepositoryResponse -> DescribeRepositoryResponse -> Bool
$c== :: DescribeRepositoryResponse -> DescribeRepositoryResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRepositoryResponse]
ReadPrec DescribeRepositoryResponse
Int -> ReadS DescribeRepositoryResponse
ReadS [DescribeRepositoryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRepositoryResponse]
$creadListPrec :: ReadPrec [DescribeRepositoryResponse]
readPrec :: ReadPrec DescribeRepositoryResponse
$creadPrec :: ReadPrec DescribeRepositoryResponse
readList :: ReadS [DescribeRepositoryResponse]
$creadList :: ReadS [DescribeRepositoryResponse]
readsPrec :: Int -> ReadS DescribeRepositoryResponse
$creadsPrec :: Int -> ReadS DescribeRepositoryResponse
Prelude.Read, Int -> DescribeRepositoryResponse -> ShowS
[DescribeRepositoryResponse] -> ShowS
DescribeRepositoryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRepositoryResponse] -> ShowS
$cshowList :: [DescribeRepositoryResponse] -> ShowS
show :: DescribeRepositoryResponse -> String
$cshow :: DescribeRepositoryResponse -> String
showsPrec :: Int -> DescribeRepositoryResponse -> ShowS
$cshowsPrec :: Int -> DescribeRepositoryResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeRepositoryResponse x -> DescribeRepositoryResponse
forall x.
DescribeRepositoryResponse -> Rep DescribeRepositoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRepositoryResponse x -> DescribeRepositoryResponse
$cfrom :: forall x.
DescribeRepositoryResponse -> Rep DescribeRepositoryResponse x
Prelude.Generic)
newDescribeRepositoryResponse ::
Prelude.Int ->
DescribeRepositoryResponse
newDescribeRepositoryResponse :: Int -> DescribeRepositoryResponse
newDescribeRepositoryResponse Int
pHttpStatus_ =
DescribeRepositoryResponse'
{ $sel:repository:DescribeRepositoryResponse' :: Maybe RepositoryDescription
repository =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRepositoryResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRepositoryResponse_repository :: Lens.Lens' DescribeRepositoryResponse (Prelude.Maybe RepositoryDescription)
describeRepositoryResponse_repository :: Lens' DescribeRepositoryResponse (Maybe RepositoryDescription)
describeRepositoryResponse_repository = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRepositoryResponse' {Maybe RepositoryDescription
repository :: Maybe RepositoryDescription
$sel:repository:DescribeRepositoryResponse' :: DescribeRepositoryResponse -> Maybe RepositoryDescription
repository} -> Maybe RepositoryDescription
repository) (\s :: DescribeRepositoryResponse
s@DescribeRepositoryResponse' {} Maybe RepositoryDescription
a -> DescribeRepositoryResponse
s {$sel:repository:DescribeRepositoryResponse' :: Maybe RepositoryDescription
repository = Maybe RepositoryDescription
a} :: DescribeRepositoryResponse)
describeRepositoryResponse_httpStatus :: Lens.Lens' DescribeRepositoryResponse Prelude.Int
describeRepositoryResponse_httpStatus :: Lens' DescribeRepositoryResponse Int
describeRepositoryResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRepositoryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRepositoryResponse' :: DescribeRepositoryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRepositoryResponse
s@DescribeRepositoryResponse' {} Int
a -> DescribeRepositoryResponse
s {$sel:httpStatus:DescribeRepositoryResponse' :: Int
httpStatus = Int
a} :: DescribeRepositoryResponse)
instance Prelude.NFData DescribeRepositoryResponse where
rnf :: DescribeRepositoryResponse -> ()
rnf DescribeRepositoryResponse' {Int
Maybe RepositoryDescription
httpStatus :: Int
repository :: Maybe RepositoryDescription
$sel:httpStatus:DescribeRepositoryResponse' :: DescribeRepositoryResponse -> Int
$sel:repository:DescribeRepositoryResponse' :: DescribeRepositoryResponse -> Maybe RepositoryDescription
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RepositoryDescription
repository
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus