{-# 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.GetRepositoryEndpoint
(
GetRepositoryEndpoint (..),
newGetRepositoryEndpoint,
getRepositoryEndpoint_domainOwner,
getRepositoryEndpoint_domain,
getRepositoryEndpoint_repository,
getRepositoryEndpoint_format,
GetRepositoryEndpointResponse (..),
newGetRepositoryEndpointResponse,
getRepositoryEndpointResponse_repositoryEndpoint,
getRepositoryEndpointResponse_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 GetRepositoryEndpoint = GetRepositoryEndpoint'
{
GetRepositoryEndpoint -> Maybe Text
domainOwner :: Prelude.Maybe Prelude.Text,
GetRepositoryEndpoint -> Text
domain :: Prelude.Text,
GetRepositoryEndpoint -> Text
repository :: Prelude.Text,
GetRepositoryEndpoint -> PackageFormat
format :: PackageFormat
}
deriving (GetRepositoryEndpoint -> GetRepositoryEndpoint -> Bool
(GetRepositoryEndpoint -> GetRepositoryEndpoint -> Bool)
-> (GetRepositoryEndpoint -> GetRepositoryEndpoint -> Bool)
-> Eq GetRepositoryEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRepositoryEndpoint -> GetRepositoryEndpoint -> Bool
$c/= :: GetRepositoryEndpoint -> GetRepositoryEndpoint -> Bool
== :: GetRepositoryEndpoint -> GetRepositoryEndpoint -> Bool
$c== :: GetRepositoryEndpoint -> GetRepositoryEndpoint -> Bool
Prelude.Eq, ReadPrec [GetRepositoryEndpoint]
ReadPrec GetRepositoryEndpoint
Int -> ReadS GetRepositoryEndpoint
ReadS [GetRepositoryEndpoint]
(Int -> ReadS GetRepositoryEndpoint)
-> ReadS [GetRepositoryEndpoint]
-> ReadPrec GetRepositoryEndpoint
-> ReadPrec [GetRepositoryEndpoint]
-> Read GetRepositoryEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRepositoryEndpoint]
$creadListPrec :: ReadPrec [GetRepositoryEndpoint]
readPrec :: ReadPrec GetRepositoryEndpoint
$creadPrec :: ReadPrec GetRepositoryEndpoint
readList :: ReadS [GetRepositoryEndpoint]
$creadList :: ReadS [GetRepositoryEndpoint]
readsPrec :: Int -> ReadS GetRepositoryEndpoint
$creadsPrec :: Int -> ReadS GetRepositoryEndpoint
Prelude.Read, Int -> GetRepositoryEndpoint -> ShowS
[GetRepositoryEndpoint] -> ShowS
GetRepositoryEndpoint -> String
(Int -> GetRepositoryEndpoint -> ShowS)
-> (GetRepositoryEndpoint -> String)
-> ([GetRepositoryEndpoint] -> ShowS)
-> Show GetRepositoryEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRepositoryEndpoint] -> ShowS
$cshowList :: [GetRepositoryEndpoint] -> ShowS
show :: GetRepositoryEndpoint -> String
$cshow :: GetRepositoryEndpoint -> String
showsPrec :: Int -> GetRepositoryEndpoint -> ShowS
$cshowsPrec :: Int -> GetRepositoryEndpoint -> ShowS
Prelude.Show, (forall x. GetRepositoryEndpoint -> Rep GetRepositoryEndpoint x)
-> (forall x. Rep GetRepositoryEndpoint x -> GetRepositoryEndpoint)
-> Generic GetRepositoryEndpoint
forall x. Rep GetRepositoryEndpoint x -> GetRepositoryEndpoint
forall x. GetRepositoryEndpoint -> Rep GetRepositoryEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRepositoryEndpoint x -> GetRepositoryEndpoint
$cfrom :: forall x. GetRepositoryEndpoint -> Rep GetRepositoryEndpoint x
Prelude.Generic)
newGetRepositoryEndpoint ::
Prelude.Text ->
Prelude.Text ->
PackageFormat ->
GetRepositoryEndpoint
newGetRepositoryEndpoint :: Text -> Text -> PackageFormat -> GetRepositoryEndpoint
newGetRepositoryEndpoint
Text
pDomain_
Text
pRepository_
PackageFormat
pFormat_ =
GetRepositoryEndpoint' :: Maybe Text
-> Text -> Text -> PackageFormat -> GetRepositoryEndpoint
GetRepositoryEndpoint'
{ $sel:domainOwner:GetRepositoryEndpoint' :: Maybe Text
domainOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domain:GetRepositoryEndpoint' :: Text
domain = Text
pDomain_,
$sel:repository:GetRepositoryEndpoint' :: Text
repository = Text
pRepository_,
$sel:format:GetRepositoryEndpoint' :: PackageFormat
format = PackageFormat
pFormat_
}
getRepositoryEndpoint_domainOwner :: Lens.Lens' GetRepositoryEndpoint (Prelude.Maybe Prelude.Text)
getRepositoryEndpoint_domainOwner :: (Maybe Text -> f (Maybe Text))
-> GetRepositoryEndpoint -> f GetRepositoryEndpoint
getRepositoryEndpoint_domainOwner = (GetRepositoryEndpoint -> Maybe Text)
-> (GetRepositoryEndpoint -> Maybe Text -> GetRepositoryEndpoint)
-> Lens
GetRepositoryEndpoint
GetRepositoryEndpoint
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryEndpoint' {Maybe Text
domainOwner :: Maybe Text
$sel:domainOwner:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> Maybe Text
domainOwner} -> Maybe Text
domainOwner) (\s :: GetRepositoryEndpoint
s@GetRepositoryEndpoint' {} Maybe Text
a -> GetRepositoryEndpoint
s {$sel:domainOwner:GetRepositoryEndpoint' :: Maybe Text
domainOwner = Maybe Text
a} :: GetRepositoryEndpoint)
getRepositoryEndpoint_domain :: Lens.Lens' GetRepositoryEndpoint Prelude.Text
getRepositoryEndpoint_domain :: (Text -> f Text)
-> GetRepositoryEndpoint -> f GetRepositoryEndpoint
getRepositoryEndpoint_domain = (GetRepositoryEndpoint -> Text)
-> (GetRepositoryEndpoint -> Text -> GetRepositoryEndpoint)
-> Lens GetRepositoryEndpoint GetRepositoryEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryEndpoint' {Text
domain :: Text
$sel:domain:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> Text
domain} -> Text
domain) (\s :: GetRepositoryEndpoint
s@GetRepositoryEndpoint' {} Text
a -> GetRepositoryEndpoint
s {$sel:domain:GetRepositoryEndpoint' :: Text
domain = Text
a} :: GetRepositoryEndpoint)
getRepositoryEndpoint_repository :: Lens.Lens' GetRepositoryEndpoint Prelude.Text
getRepositoryEndpoint_repository :: (Text -> f Text)
-> GetRepositoryEndpoint -> f GetRepositoryEndpoint
getRepositoryEndpoint_repository = (GetRepositoryEndpoint -> Text)
-> (GetRepositoryEndpoint -> Text -> GetRepositoryEndpoint)
-> Lens GetRepositoryEndpoint GetRepositoryEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryEndpoint' {Text
repository :: Text
$sel:repository:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> Text
repository} -> Text
repository) (\s :: GetRepositoryEndpoint
s@GetRepositoryEndpoint' {} Text
a -> GetRepositoryEndpoint
s {$sel:repository:GetRepositoryEndpoint' :: Text
repository = Text
a} :: GetRepositoryEndpoint)
getRepositoryEndpoint_format :: Lens.Lens' GetRepositoryEndpoint PackageFormat
getRepositoryEndpoint_format :: (PackageFormat -> f PackageFormat)
-> GetRepositoryEndpoint -> f GetRepositoryEndpoint
getRepositoryEndpoint_format = (GetRepositoryEndpoint -> PackageFormat)
-> (GetRepositoryEndpoint
-> PackageFormat -> GetRepositoryEndpoint)
-> Lens
GetRepositoryEndpoint
GetRepositoryEndpoint
PackageFormat
PackageFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryEndpoint' {PackageFormat
format :: PackageFormat
$sel:format:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> PackageFormat
format} -> PackageFormat
format) (\s :: GetRepositoryEndpoint
s@GetRepositoryEndpoint' {} PackageFormat
a -> GetRepositoryEndpoint
s {$sel:format:GetRepositoryEndpoint' :: PackageFormat
format = PackageFormat
a} :: GetRepositoryEndpoint)
instance Core.AWSRequest GetRepositoryEndpoint where
type
AWSResponse GetRepositoryEndpoint =
GetRepositoryEndpointResponse
request :: GetRepositoryEndpoint -> Request GetRepositoryEndpoint
request = Service -> GetRepositoryEndpoint -> Request GetRepositoryEndpoint
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetRepositoryEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetRepositoryEndpoint)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetRepositoryEndpoint))
-> Logger
-> Service
-> Proxy GetRepositoryEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetRepositoryEndpoint)))
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 Text -> Int -> GetRepositoryEndpointResponse
GetRepositoryEndpointResponse'
(Maybe Text -> Int -> GetRepositoryEndpointResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetRepositoryEndpointResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"repositoryEndpoint")
Either String (Int -> GetRepositoryEndpointResponse)
-> Either String Int -> Either String GetRepositoryEndpointResponse
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 GetRepositoryEndpoint
instance Prelude.NFData GetRepositoryEndpoint
instance Core.ToHeaders GetRepositoryEndpoint where
toHeaders :: GetRepositoryEndpoint -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetRepositoryEndpoint -> 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 GetRepositoryEndpoint where
toPath :: GetRepositoryEndpoint -> ByteString
toPath = ByteString -> GetRepositoryEndpoint -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/repository/endpoint"
instance Core.ToQuery GetRepositoryEndpoint where
toQuery :: GetRepositoryEndpoint -> QueryString
toQuery GetRepositoryEndpoint' {Maybe Text
Text
PackageFormat
format :: PackageFormat
repository :: Text
domain :: Text
domainOwner :: Maybe Text
$sel:format:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> PackageFormat
$sel:repository:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> Text
$sel:domain:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> Text
$sel:domainOwner:GetRepositoryEndpoint' :: GetRepositoryEndpoint -> 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,
ByteString
"format" ByteString -> PackageFormat -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: PackageFormat
format
]
data GetRepositoryEndpointResponse = GetRepositoryEndpointResponse'
{
GetRepositoryEndpointResponse -> Maybe Text
repositoryEndpoint :: Prelude.Maybe Prelude.Text,
GetRepositoryEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetRepositoryEndpointResponse
-> GetRepositoryEndpointResponse -> Bool
(GetRepositoryEndpointResponse
-> GetRepositoryEndpointResponse -> Bool)
-> (GetRepositoryEndpointResponse
-> GetRepositoryEndpointResponse -> Bool)
-> Eq GetRepositoryEndpointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRepositoryEndpointResponse
-> GetRepositoryEndpointResponse -> Bool
$c/= :: GetRepositoryEndpointResponse
-> GetRepositoryEndpointResponse -> Bool
== :: GetRepositoryEndpointResponse
-> GetRepositoryEndpointResponse -> Bool
$c== :: GetRepositoryEndpointResponse
-> GetRepositoryEndpointResponse -> Bool
Prelude.Eq, ReadPrec [GetRepositoryEndpointResponse]
ReadPrec GetRepositoryEndpointResponse
Int -> ReadS GetRepositoryEndpointResponse
ReadS [GetRepositoryEndpointResponse]
(Int -> ReadS GetRepositoryEndpointResponse)
-> ReadS [GetRepositoryEndpointResponse]
-> ReadPrec GetRepositoryEndpointResponse
-> ReadPrec [GetRepositoryEndpointResponse]
-> Read GetRepositoryEndpointResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRepositoryEndpointResponse]
$creadListPrec :: ReadPrec [GetRepositoryEndpointResponse]
readPrec :: ReadPrec GetRepositoryEndpointResponse
$creadPrec :: ReadPrec GetRepositoryEndpointResponse
readList :: ReadS [GetRepositoryEndpointResponse]
$creadList :: ReadS [GetRepositoryEndpointResponse]
readsPrec :: Int -> ReadS GetRepositoryEndpointResponse
$creadsPrec :: Int -> ReadS GetRepositoryEndpointResponse
Prelude.Read, Int -> GetRepositoryEndpointResponse -> ShowS
[GetRepositoryEndpointResponse] -> ShowS
GetRepositoryEndpointResponse -> String
(Int -> GetRepositoryEndpointResponse -> ShowS)
-> (GetRepositoryEndpointResponse -> String)
-> ([GetRepositoryEndpointResponse] -> ShowS)
-> Show GetRepositoryEndpointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRepositoryEndpointResponse] -> ShowS
$cshowList :: [GetRepositoryEndpointResponse] -> ShowS
show :: GetRepositoryEndpointResponse -> String
$cshow :: GetRepositoryEndpointResponse -> String
showsPrec :: Int -> GetRepositoryEndpointResponse -> ShowS
$cshowsPrec :: Int -> GetRepositoryEndpointResponse -> ShowS
Prelude.Show, (forall x.
GetRepositoryEndpointResponse
-> Rep GetRepositoryEndpointResponse x)
-> (forall x.
Rep GetRepositoryEndpointResponse x
-> GetRepositoryEndpointResponse)
-> Generic GetRepositoryEndpointResponse
forall x.
Rep GetRepositoryEndpointResponse x
-> GetRepositoryEndpointResponse
forall x.
GetRepositoryEndpointResponse
-> Rep GetRepositoryEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRepositoryEndpointResponse x
-> GetRepositoryEndpointResponse
$cfrom :: forall x.
GetRepositoryEndpointResponse
-> Rep GetRepositoryEndpointResponse x
Prelude.Generic)
newGetRepositoryEndpointResponse ::
Prelude.Int ->
GetRepositoryEndpointResponse
newGetRepositoryEndpointResponse :: Int -> GetRepositoryEndpointResponse
newGetRepositoryEndpointResponse Int
pHttpStatus_ =
GetRepositoryEndpointResponse' :: Maybe Text -> Int -> GetRepositoryEndpointResponse
GetRepositoryEndpointResponse'
{ $sel:repositoryEndpoint:GetRepositoryEndpointResponse' :: Maybe Text
repositoryEndpoint =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetRepositoryEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getRepositoryEndpointResponse_repositoryEndpoint :: Lens.Lens' GetRepositoryEndpointResponse (Prelude.Maybe Prelude.Text)
getRepositoryEndpointResponse_repositoryEndpoint :: (Maybe Text -> f (Maybe Text))
-> GetRepositoryEndpointResponse -> f GetRepositoryEndpointResponse
getRepositoryEndpointResponse_repositoryEndpoint = (GetRepositoryEndpointResponse -> Maybe Text)
-> (GetRepositoryEndpointResponse
-> Maybe Text -> GetRepositoryEndpointResponse)
-> Lens
GetRepositoryEndpointResponse
GetRepositoryEndpointResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryEndpointResponse' {Maybe Text
repositoryEndpoint :: Maybe Text
$sel:repositoryEndpoint:GetRepositoryEndpointResponse' :: GetRepositoryEndpointResponse -> Maybe Text
repositoryEndpoint} -> Maybe Text
repositoryEndpoint) (\s :: GetRepositoryEndpointResponse
s@GetRepositoryEndpointResponse' {} Maybe Text
a -> GetRepositoryEndpointResponse
s {$sel:repositoryEndpoint:GetRepositoryEndpointResponse' :: Maybe Text
repositoryEndpoint = Maybe Text
a} :: GetRepositoryEndpointResponse)
getRepositoryEndpointResponse_httpStatus :: Lens.Lens' GetRepositoryEndpointResponse Prelude.Int
getRepositoryEndpointResponse_httpStatus :: (Int -> f Int)
-> GetRepositoryEndpointResponse -> f GetRepositoryEndpointResponse
getRepositoryEndpointResponse_httpStatus = (GetRepositoryEndpointResponse -> Int)
-> (GetRepositoryEndpointResponse
-> Int -> GetRepositoryEndpointResponse)
-> Lens
GetRepositoryEndpointResponse GetRepositoryEndpointResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRepositoryEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRepositoryEndpointResponse' :: GetRepositoryEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRepositoryEndpointResponse
s@GetRepositoryEndpointResponse' {} Int
a -> GetRepositoryEndpointResponse
s {$sel:httpStatus:GetRepositoryEndpointResponse' :: Int
httpStatus = Int
a} :: GetRepositoryEndpointResponse)
instance Prelude.NFData GetRepositoryEndpointResponse