{-# 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.GreengrassV2.GetComponentVersionArtifact
(
GetComponentVersionArtifact (..),
newGetComponentVersionArtifact,
getComponentVersionArtifact_arn,
getComponentVersionArtifact_artifactName,
GetComponentVersionArtifactResponse (..),
newGetComponentVersionArtifactResponse,
getComponentVersionArtifactResponse_httpStatus,
getComponentVersionArtifactResponse_preSignedUrl,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types
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 GetComponentVersionArtifact = GetComponentVersionArtifact'
{
GetComponentVersionArtifact -> Text
arn :: Prelude.Text,
GetComponentVersionArtifact -> Text
artifactName :: Prelude.Text
}
deriving (GetComponentVersionArtifact -> GetComponentVersionArtifact -> Bool
(GetComponentVersionArtifact
-> GetComponentVersionArtifact -> Bool)
-> (GetComponentVersionArtifact
-> GetComponentVersionArtifact -> Bool)
-> Eq GetComponentVersionArtifact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetComponentVersionArtifact -> GetComponentVersionArtifact -> Bool
$c/= :: GetComponentVersionArtifact -> GetComponentVersionArtifact -> Bool
== :: GetComponentVersionArtifact -> GetComponentVersionArtifact -> Bool
$c== :: GetComponentVersionArtifact -> GetComponentVersionArtifact -> Bool
Prelude.Eq, ReadPrec [GetComponentVersionArtifact]
ReadPrec GetComponentVersionArtifact
Int -> ReadS GetComponentVersionArtifact
ReadS [GetComponentVersionArtifact]
(Int -> ReadS GetComponentVersionArtifact)
-> ReadS [GetComponentVersionArtifact]
-> ReadPrec GetComponentVersionArtifact
-> ReadPrec [GetComponentVersionArtifact]
-> Read GetComponentVersionArtifact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetComponentVersionArtifact]
$creadListPrec :: ReadPrec [GetComponentVersionArtifact]
readPrec :: ReadPrec GetComponentVersionArtifact
$creadPrec :: ReadPrec GetComponentVersionArtifact
readList :: ReadS [GetComponentVersionArtifact]
$creadList :: ReadS [GetComponentVersionArtifact]
readsPrec :: Int -> ReadS GetComponentVersionArtifact
$creadsPrec :: Int -> ReadS GetComponentVersionArtifact
Prelude.Read, Int -> GetComponentVersionArtifact -> ShowS
[GetComponentVersionArtifact] -> ShowS
GetComponentVersionArtifact -> String
(Int -> GetComponentVersionArtifact -> ShowS)
-> (GetComponentVersionArtifact -> String)
-> ([GetComponentVersionArtifact] -> ShowS)
-> Show GetComponentVersionArtifact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetComponentVersionArtifact] -> ShowS
$cshowList :: [GetComponentVersionArtifact] -> ShowS
show :: GetComponentVersionArtifact -> String
$cshow :: GetComponentVersionArtifact -> String
showsPrec :: Int -> GetComponentVersionArtifact -> ShowS
$cshowsPrec :: Int -> GetComponentVersionArtifact -> ShowS
Prelude.Show, (forall x.
GetComponentVersionArtifact -> Rep GetComponentVersionArtifact x)
-> (forall x.
Rep GetComponentVersionArtifact x -> GetComponentVersionArtifact)
-> Generic GetComponentVersionArtifact
forall x.
Rep GetComponentVersionArtifact x -> GetComponentVersionArtifact
forall x.
GetComponentVersionArtifact -> Rep GetComponentVersionArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetComponentVersionArtifact x -> GetComponentVersionArtifact
$cfrom :: forall x.
GetComponentVersionArtifact -> Rep GetComponentVersionArtifact x
Prelude.Generic)
newGetComponentVersionArtifact ::
Prelude.Text ->
Prelude.Text ->
GetComponentVersionArtifact
newGetComponentVersionArtifact :: Text -> Text -> GetComponentVersionArtifact
newGetComponentVersionArtifact Text
pArn_ Text
pArtifactName_ =
GetComponentVersionArtifact' :: Text -> Text -> GetComponentVersionArtifact
GetComponentVersionArtifact'
{ $sel:arn:GetComponentVersionArtifact' :: Text
arn = Text
pArn_,
$sel:artifactName:GetComponentVersionArtifact' :: Text
artifactName = Text
pArtifactName_
}
getComponentVersionArtifact_arn :: Lens.Lens' GetComponentVersionArtifact Prelude.Text
getComponentVersionArtifact_arn :: (Text -> f Text)
-> GetComponentVersionArtifact -> f GetComponentVersionArtifact
getComponentVersionArtifact_arn = (GetComponentVersionArtifact -> Text)
-> (GetComponentVersionArtifact
-> Text -> GetComponentVersionArtifact)
-> Lens
GetComponentVersionArtifact GetComponentVersionArtifact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComponentVersionArtifact' {Text
arn :: Text
$sel:arn:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
arn} -> Text
arn) (\s :: GetComponentVersionArtifact
s@GetComponentVersionArtifact' {} Text
a -> GetComponentVersionArtifact
s {$sel:arn:GetComponentVersionArtifact' :: Text
arn = Text
a} :: GetComponentVersionArtifact)
getComponentVersionArtifact_artifactName :: Lens.Lens' GetComponentVersionArtifact Prelude.Text
getComponentVersionArtifact_artifactName :: (Text -> f Text)
-> GetComponentVersionArtifact -> f GetComponentVersionArtifact
getComponentVersionArtifact_artifactName = (GetComponentVersionArtifact -> Text)
-> (GetComponentVersionArtifact
-> Text -> GetComponentVersionArtifact)
-> Lens
GetComponentVersionArtifact GetComponentVersionArtifact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComponentVersionArtifact' {Text
artifactName :: Text
$sel:artifactName:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
artifactName} -> Text
artifactName) (\s :: GetComponentVersionArtifact
s@GetComponentVersionArtifact' {} Text
a -> GetComponentVersionArtifact
s {$sel:artifactName:GetComponentVersionArtifact' :: Text
artifactName = Text
a} :: GetComponentVersionArtifact)
instance Core.AWSRequest GetComponentVersionArtifact where
type
AWSResponse GetComponentVersionArtifact =
GetComponentVersionArtifactResponse
request :: GetComponentVersionArtifact -> Request GetComponentVersionArtifact
request = Service
-> GetComponentVersionArtifact
-> Request GetComponentVersionArtifact
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetComponentVersionArtifact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetComponentVersionArtifact)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetComponentVersionArtifact))
-> Logger
-> Service
-> Proxy GetComponentVersionArtifact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetComponentVersionArtifact)))
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 ->
Int -> Text -> GetComponentVersionArtifactResponse
GetComponentVersionArtifactResponse'
(Int -> Text -> GetComponentVersionArtifactResponse)
-> Either String Int
-> Either String (Text -> GetComponentVersionArtifactResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> GetComponentVersionArtifactResponse)
-> Either String Text
-> Either String GetComponentVersionArtifactResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"preSignedUrl")
)
instance Prelude.Hashable GetComponentVersionArtifact
instance Prelude.NFData GetComponentVersionArtifact
instance Core.ToHeaders GetComponentVersionArtifact where
toHeaders :: GetComponentVersionArtifact -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetComponentVersionArtifact -> 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 GetComponentVersionArtifact where
toPath :: GetComponentVersionArtifact -> ByteString
toPath GetComponentVersionArtifact' {Text
artifactName :: Text
arn :: Text
$sel:artifactName:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
$sel:arn:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/v2/components/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
arn,
ByteString
"/artifacts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
artifactName
]
instance Core.ToQuery GetComponentVersionArtifact where
toQuery :: GetComponentVersionArtifact -> QueryString
toQuery = QueryString -> GetComponentVersionArtifact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetComponentVersionArtifactResponse = GetComponentVersionArtifactResponse'
{
GetComponentVersionArtifactResponse -> Int
httpStatus :: Prelude.Int,
GetComponentVersionArtifactResponse -> Text
preSignedUrl :: Prelude.Text
}
deriving (GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool
(GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool)
-> (GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool)
-> Eq GetComponentVersionArtifactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool
$c/= :: GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool
== :: GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool
$c== :: GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool
Prelude.Eq, ReadPrec [GetComponentVersionArtifactResponse]
ReadPrec GetComponentVersionArtifactResponse
Int -> ReadS GetComponentVersionArtifactResponse
ReadS [GetComponentVersionArtifactResponse]
(Int -> ReadS GetComponentVersionArtifactResponse)
-> ReadS [GetComponentVersionArtifactResponse]
-> ReadPrec GetComponentVersionArtifactResponse
-> ReadPrec [GetComponentVersionArtifactResponse]
-> Read GetComponentVersionArtifactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetComponentVersionArtifactResponse]
$creadListPrec :: ReadPrec [GetComponentVersionArtifactResponse]
readPrec :: ReadPrec GetComponentVersionArtifactResponse
$creadPrec :: ReadPrec GetComponentVersionArtifactResponse
readList :: ReadS [GetComponentVersionArtifactResponse]
$creadList :: ReadS [GetComponentVersionArtifactResponse]
readsPrec :: Int -> ReadS GetComponentVersionArtifactResponse
$creadsPrec :: Int -> ReadS GetComponentVersionArtifactResponse
Prelude.Read, Int -> GetComponentVersionArtifactResponse -> ShowS
[GetComponentVersionArtifactResponse] -> ShowS
GetComponentVersionArtifactResponse -> String
(Int -> GetComponentVersionArtifactResponse -> ShowS)
-> (GetComponentVersionArtifactResponse -> String)
-> ([GetComponentVersionArtifactResponse] -> ShowS)
-> Show GetComponentVersionArtifactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetComponentVersionArtifactResponse] -> ShowS
$cshowList :: [GetComponentVersionArtifactResponse] -> ShowS
show :: GetComponentVersionArtifactResponse -> String
$cshow :: GetComponentVersionArtifactResponse -> String
showsPrec :: Int -> GetComponentVersionArtifactResponse -> ShowS
$cshowsPrec :: Int -> GetComponentVersionArtifactResponse -> ShowS
Prelude.Show, (forall x.
GetComponentVersionArtifactResponse
-> Rep GetComponentVersionArtifactResponse x)
-> (forall x.
Rep GetComponentVersionArtifactResponse x
-> GetComponentVersionArtifactResponse)
-> Generic GetComponentVersionArtifactResponse
forall x.
Rep GetComponentVersionArtifactResponse x
-> GetComponentVersionArtifactResponse
forall x.
GetComponentVersionArtifactResponse
-> Rep GetComponentVersionArtifactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetComponentVersionArtifactResponse x
-> GetComponentVersionArtifactResponse
$cfrom :: forall x.
GetComponentVersionArtifactResponse
-> Rep GetComponentVersionArtifactResponse x
Prelude.Generic)
newGetComponentVersionArtifactResponse ::
Prelude.Int ->
Prelude.Text ->
GetComponentVersionArtifactResponse
newGetComponentVersionArtifactResponse :: Int -> Text -> GetComponentVersionArtifactResponse
newGetComponentVersionArtifactResponse
Int
pHttpStatus_
Text
pPreSignedUrl_ =
GetComponentVersionArtifactResponse' :: Int -> Text -> GetComponentVersionArtifactResponse
GetComponentVersionArtifactResponse'
{ $sel:httpStatus:GetComponentVersionArtifactResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:preSignedUrl:GetComponentVersionArtifactResponse' :: Text
preSignedUrl = Text
pPreSignedUrl_
}
getComponentVersionArtifactResponse_httpStatus :: Lens.Lens' GetComponentVersionArtifactResponse Prelude.Int
getComponentVersionArtifactResponse_httpStatus :: (Int -> f Int)
-> GetComponentVersionArtifactResponse
-> f GetComponentVersionArtifactResponse
getComponentVersionArtifactResponse_httpStatus = (GetComponentVersionArtifactResponse -> Int)
-> (GetComponentVersionArtifactResponse
-> Int -> GetComponentVersionArtifactResponse)
-> Lens
GetComponentVersionArtifactResponse
GetComponentVersionArtifactResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComponentVersionArtifactResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetComponentVersionArtifactResponse' :: GetComponentVersionArtifactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetComponentVersionArtifactResponse
s@GetComponentVersionArtifactResponse' {} Int
a -> GetComponentVersionArtifactResponse
s {$sel:httpStatus:GetComponentVersionArtifactResponse' :: Int
httpStatus = Int
a} :: GetComponentVersionArtifactResponse)
getComponentVersionArtifactResponse_preSignedUrl :: Lens.Lens' GetComponentVersionArtifactResponse Prelude.Text
getComponentVersionArtifactResponse_preSignedUrl :: (Text -> f Text)
-> GetComponentVersionArtifactResponse
-> f GetComponentVersionArtifactResponse
getComponentVersionArtifactResponse_preSignedUrl = (GetComponentVersionArtifactResponse -> Text)
-> (GetComponentVersionArtifactResponse
-> Text -> GetComponentVersionArtifactResponse)
-> Lens
GetComponentVersionArtifactResponse
GetComponentVersionArtifactResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetComponentVersionArtifactResponse' {Text
preSignedUrl :: Text
$sel:preSignedUrl:GetComponentVersionArtifactResponse' :: GetComponentVersionArtifactResponse -> Text
preSignedUrl} -> Text
preSignedUrl) (\s :: GetComponentVersionArtifactResponse
s@GetComponentVersionArtifactResponse' {} Text
a -> GetComponentVersionArtifactResponse
s {$sel:preSignedUrl:GetComponentVersionArtifactResponse' :: Text
preSignedUrl = Text
a} :: GetComponentVersionArtifactResponse)
instance
Prelude.NFData
GetComponentVersionArtifactResponse