{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GreengrassV2.Types
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
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]
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
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.
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'
{ $sel:arn:GetComponentVersionArtifact' :: Text
arn = Text
pArn_,
$sel:artifactName:GetComponentVersionArtifact' :: Text
artifactName = Text
pArtifactName_
}
getComponentVersionArtifact_arn :: Lens.Lens' GetComponentVersionArtifact Prelude.Text
getComponentVersionArtifact_arn :: Lens' GetComponentVersionArtifact Text
getComponentVersionArtifact_arn = 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 :: Lens' GetComponentVersionArtifact Text
getComponentVersionArtifact_artifactName = 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 :: (Service -> Service)
-> GetComponentVersionArtifact
-> Request GetComponentVersionArtifact
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 GetComponentVersionArtifact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetComponentVersionArtifact)))
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 -> GetComponentVersionArtifactResponse
GetComponentVersionArtifactResponse'
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
"preSignedUrl")
)
instance Prelude.Hashable GetComponentVersionArtifact where
hashWithSalt :: Int -> GetComponentVersionArtifact -> Int
hashWithSalt Int
_salt GetComponentVersionArtifact' {Text
artifactName :: Text
arn :: Text
$sel:artifactName:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
$sel:arn:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
artifactName
instance Prelude.NFData GetComponentVersionArtifact where
rnf :: GetComponentVersionArtifact -> ()
rnf GetComponentVersionArtifact' {Text
artifactName :: Text
arn :: Text
$sel:artifactName:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
$sel:arn:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
artifactName
instance Data.ToHeaders GetComponentVersionArtifact where
toHeaders :: GetComponentVersionArtifact -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetComponentVersionArtifact where
toPath :: GetComponentVersionArtifact -> ByteString
toPath GetComponentVersionArtifact' {Text
artifactName :: Text
arn :: Text
$sel:artifactName:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
$sel:arn:GetComponentVersionArtifact' :: GetComponentVersionArtifact -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/v2/components/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
arn,
ByteString
"/artifacts/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
artifactName
]
instance Data.ToQuery GetComponentVersionArtifact where
toQuery :: GetComponentVersionArtifact -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetComponentVersionArtifactResponse = GetComponentVersionArtifactResponse'
{
GetComponentVersionArtifactResponse -> Int
httpStatus :: Prelude.Int,
GetComponentVersionArtifactResponse -> Text
preSignedUrl :: Prelude.Text
}
deriving (GetComponentVersionArtifactResponse
-> GetComponentVersionArtifactResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:GetComponentVersionArtifactResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:preSignedUrl:GetComponentVersionArtifactResponse' :: Text
preSignedUrl = Text
pPreSignedUrl_
}
getComponentVersionArtifactResponse_httpStatus :: Lens.Lens' GetComponentVersionArtifactResponse Prelude.Int
getComponentVersionArtifactResponse_httpStatus :: Lens' GetComponentVersionArtifactResponse Int
getComponentVersionArtifactResponse_httpStatus = 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 :: Lens' GetComponentVersionArtifactResponse Text
getComponentVersionArtifactResponse_preSignedUrl = 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
where
rnf :: GetComponentVersionArtifactResponse -> ()
rnf GetComponentVersionArtifactResponse' {Int
Text
preSignedUrl :: Text
httpStatus :: Int
$sel:preSignedUrl:GetComponentVersionArtifactResponse' :: GetComponentVersionArtifactResponse -> Text
$sel:httpStatus:GetComponentVersionArtifactResponse' :: GetComponentVersionArtifactResponse -> 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
preSignedUrl