{-# 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.Amplify.GetArtifactUrl
(
GetArtifactUrl (..),
newGetArtifactUrl,
getArtifactUrl_artifactId,
GetArtifactUrlResponse (..),
newGetArtifactUrlResponse,
getArtifactUrlResponse_httpStatus,
getArtifactUrlResponse_artifactId,
getArtifactUrlResponse_artifactUrl,
)
where
import Amazonka.Amplify.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 GetArtifactUrl = GetArtifactUrl'
{
GetArtifactUrl -> Text
artifactId :: Prelude.Text
}
deriving (GetArtifactUrl -> GetArtifactUrl -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetArtifactUrl -> GetArtifactUrl -> Bool
$c/= :: GetArtifactUrl -> GetArtifactUrl -> Bool
== :: GetArtifactUrl -> GetArtifactUrl -> Bool
$c== :: GetArtifactUrl -> GetArtifactUrl -> Bool
Prelude.Eq, ReadPrec [GetArtifactUrl]
ReadPrec GetArtifactUrl
Int -> ReadS GetArtifactUrl
ReadS [GetArtifactUrl]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetArtifactUrl]
$creadListPrec :: ReadPrec [GetArtifactUrl]
readPrec :: ReadPrec GetArtifactUrl
$creadPrec :: ReadPrec GetArtifactUrl
readList :: ReadS [GetArtifactUrl]
$creadList :: ReadS [GetArtifactUrl]
readsPrec :: Int -> ReadS GetArtifactUrl
$creadsPrec :: Int -> ReadS GetArtifactUrl
Prelude.Read, Int -> GetArtifactUrl -> ShowS
[GetArtifactUrl] -> ShowS
GetArtifactUrl -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetArtifactUrl] -> ShowS
$cshowList :: [GetArtifactUrl] -> ShowS
show :: GetArtifactUrl -> String
$cshow :: GetArtifactUrl -> String
showsPrec :: Int -> GetArtifactUrl -> ShowS
$cshowsPrec :: Int -> GetArtifactUrl -> ShowS
Prelude.Show, forall x. Rep GetArtifactUrl x -> GetArtifactUrl
forall x. GetArtifactUrl -> Rep GetArtifactUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetArtifactUrl x -> GetArtifactUrl
$cfrom :: forall x. GetArtifactUrl -> Rep GetArtifactUrl x
Prelude.Generic)
newGetArtifactUrl ::
Prelude.Text ->
GetArtifactUrl
newGetArtifactUrl :: Text -> GetArtifactUrl
newGetArtifactUrl Text
pArtifactId_ =
GetArtifactUrl' {$sel:artifactId:GetArtifactUrl' :: Text
artifactId = Text
pArtifactId_}
getArtifactUrl_artifactId :: Lens.Lens' GetArtifactUrl Prelude.Text
getArtifactUrl_artifactId :: Lens' GetArtifactUrl Text
getArtifactUrl_artifactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetArtifactUrl' {Text
artifactId :: Text
$sel:artifactId:GetArtifactUrl' :: GetArtifactUrl -> Text
artifactId} -> Text
artifactId) (\s :: GetArtifactUrl
s@GetArtifactUrl' {} Text
a -> GetArtifactUrl
s {$sel:artifactId:GetArtifactUrl' :: Text
artifactId = Text
a} :: GetArtifactUrl)
instance Core.AWSRequest GetArtifactUrl where
type
AWSResponse GetArtifactUrl =
GetArtifactUrlResponse
request :: (Service -> Service) -> GetArtifactUrl -> Request GetArtifactUrl
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 GetArtifactUrl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetArtifactUrl)))
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 ->
Int -> Text -> Text -> GetArtifactUrlResponse
GetArtifactUrlResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"artifactId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"artifactUrl")
)
instance Prelude.Hashable GetArtifactUrl where
hashWithSalt :: Int -> GetArtifactUrl -> Int
hashWithSalt Int
_salt GetArtifactUrl' {Text
artifactId :: Text
$sel:artifactId:GetArtifactUrl' :: GetArtifactUrl -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
artifactId
instance Prelude.NFData GetArtifactUrl where
rnf :: GetArtifactUrl -> ()
rnf GetArtifactUrl' {Text
artifactId :: Text
$sel:artifactId:GetArtifactUrl' :: GetArtifactUrl -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
artifactId
instance Data.ToHeaders GetArtifactUrl where
toHeaders :: GetArtifactUrl -> 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 GetArtifactUrl where
toPath :: GetArtifactUrl -> ByteString
toPath GetArtifactUrl' {Text
artifactId :: Text
$sel:artifactId:GetArtifactUrl' :: GetArtifactUrl -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/artifacts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
artifactId]
instance Data.ToQuery GetArtifactUrl where
toQuery :: GetArtifactUrl -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetArtifactUrlResponse = GetArtifactUrlResponse'
{
GetArtifactUrlResponse -> Int
httpStatus :: Prelude.Int,
GetArtifactUrlResponse -> Text
artifactId :: Prelude.Text,
GetArtifactUrlResponse -> Text
artifactUrl :: Prelude.Text
}
deriving (GetArtifactUrlResponse -> GetArtifactUrlResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetArtifactUrlResponse -> GetArtifactUrlResponse -> Bool
$c/= :: GetArtifactUrlResponse -> GetArtifactUrlResponse -> Bool
== :: GetArtifactUrlResponse -> GetArtifactUrlResponse -> Bool
$c== :: GetArtifactUrlResponse -> GetArtifactUrlResponse -> Bool
Prelude.Eq, ReadPrec [GetArtifactUrlResponse]
ReadPrec GetArtifactUrlResponse
Int -> ReadS GetArtifactUrlResponse
ReadS [GetArtifactUrlResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetArtifactUrlResponse]
$creadListPrec :: ReadPrec [GetArtifactUrlResponse]
readPrec :: ReadPrec GetArtifactUrlResponse
$creadPrec :: ReadPrec GetArtifactUrlResponse
readList :: ReadS [GetArtifactUrlResponse]
$creadList :: ReadS [GetArtifactUrlResponse]
readsPrec :: Int -> ReadS GetArtifactUrlResponse
$creadsPrec :: Int -> ReadS GetArtifactUrlResponse
Prelude.Read, Int -> GetArtifactUrlResponse -> ShowS
[GetArtifactUrlResponse] -> ShowS
GetArtifactUrlResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetArtifactUrlResponse] -> ShowS
$cshowList :: [GetArtifactUrlResponse] -> ShowS
show :: GetArtifactUrlResponse -> String
$cshow :: GetArtifactUrlResponse -> String
showsPrec :: Int -> GetArtifactUrlResponse -> ShowS
$cshowsPrec :: Int -> GetArtifactUrlResponse -> ShowS
Prelude.Show, forall x. Rep GetArtifactUrlResponse x -> GetArtifactUrlResponse
forall x. GetArtifactUrlResponse -> Rep GetArtifactUrlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetArtifactUrlResponse x -> GetArtifactUrlResponse
$cfrom :: forall x. GetArtifactUrlResponse -> Rep GetArtifactUrlResponse x
Prelude.Generic)
newGetArtifactUrlResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
GetArtifactUrlResponse
newGetArtifactUrlResponse :: Int -> Text -> Text -> GetArtifactUrlResponse
newGetArtifactUrlResponse
Int
pHttpStatus_
Text
pArtifactId_
Text
pArtifactUrl_ =
GetArtifactUrlResponse'
{ $sel:httpStatus:GetArtifactUrlResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:artifactId:GetArtifactUrlResponse' :: Text
artifactId = Text
pArtifactId_,
$sel:artifactUrl:GetArtifactUrlResponse' :: Text
artifactUrl = Text
pArtifactUrl_
}
getArtifactUrlResponse_httpStatus :: Lens.Lens' GetArtifactUrlResponse Prelude.Int
getArtifactUrlResponse_httpStatus :: Lens' GetArtifactUrlResponse Int
getArtifactUrlResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetArtifactUrlResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetArtifactUrlResponse' :: GetArtifactUrlResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetArtifactUrlResponse
s@GetArtifactUrlResponse' {} Int
a -> GetArtifactUrlResponse
s {$sel:httpStatus:GetArtifactUrlResponse' :: Int
httpStatus = Int
a} :: GetArtifactUrlResponse)
getArtifactUrlResponse_artifactId :: Lens.Lens' GetArtifactUrlResponse Prelude.Text
getArtifactUrlResponse_artifactId :: Lens' GetArtifactUrlResponse Text
getArtifactUrlResponse_artifactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetArtifactUrlResponse' {Text
artifactId :: Text
$sel:artifactId:GetArtifactUrlResponse' :: GetArtifactUrlResponse -> Text
artifactId} -> Text
artifactId) (\s :: GetArtifactUrlResponse
s@GetArtifactUrlResponse' {} Text
a -> GetArtifactUrlResponse
s {$sel:artifactId:GetArtifactUrlResponse' :: Text
artifactId = Text
a} :: GetArtifactUrlResponse)
getArtifactUrlResponse_artifactUrl :: Lens.Lens' GetArtifactUrlResponse Prelude.Text
getArtifactUrlResponse_artifactUrl :: Lens' GetArtifactUrlResponse Text
getArtifactUrlResponse_artifactUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetArtifactUrlResponse' {Text
artifactUrl :: Text
$sel:artifactUrl:GetArtifactUrlResponse' :: GetArtifactUrlResponse -> Text
artifactUrl} -> Text
artifactUrl) (\s :: GetArtifactUrlResponse
s@GetArtifactUrlResponse' {} Text
a -> GetArtifactUrlResponse
s {$sel:artifactUrl:GetArtifactUrlResponse' :: Text
artifactUrl = Text
a} :: GetArtifactUrlResponse)
instance Prelude.NFData GetArtifactUrlResponse where
rnf :: GetArtifactUrlResponse -> ()
rnf GetArtifactUrlResponse' {Int
Text
artifactUrl :: Text
artifactId :: Text
httpStatus :: Int
$sel:artifactUrl:GetArtifactUrlResponse' :: GetArtifactUrlResponse -> Text
$sel:artifactId:GetArtifactUrlResponse' :: GetArtifactUrlResponse -> Text
$sel:httpStatus:GetArtifactUrlResponse' :: GetArtifactUrlResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
artifactId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
artifactUrl