{-# 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.APIGateway.GetSdk
(
GetSdk (..),
newGetSdk,
getSdk_parameters,
getSdk_restApiId,
getSdk_stageName,
getSdk_sdkType,
GetSdkResponse (..),
newGetSdkResponse,
getSdkResponse_body,
getSdkResponse_contentDisposition,
getSdkResponse_contentType,
getSdkResponse_httpStatus,
)
where
import Amazonka.APIGateway.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 GetSdk = GetSdk'
{
GetSdk -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
GetSdk -> Text
restApiId :: Prelude.Text,
GetSdk -> Text
stageName :: Prelude.Text,
GetSdk -> Text
sdkType :: Prelude.Text
}
deriving (GetSdk -> GetSdk -> Bool
(GetSdk -> GetSdk -> Bool)
-> (GetSdk -> GetSdk -> Bool) -> Eq GetSdk
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSdk -> GetSdk -> Bool
$c/= :: GetSdk -> GetSdk -> Bool
== :: GetSdk -> GetSdk -> Bool
$c== :: GetSdk -> GetSdk -> Bool
Prelude.Eq, ReadPrec [GetSdk]
ReadPrec GetSdk
Int -> ReadS GetSdk
ReadS [GetSdk]
(Int -> ReadS GetSdk)
-> ReadS [GetSdk]
-> ReadPrec GetSdk
-> ReadPrec [GetSdk]
-> Read GetSdk
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSdk]
$creadListPrec :: ReadPrec [GetSdk]
readPrec :: ReadPrec GetSdk
$creadPrec :: ReadPrec GetSdk
readList :: ReadS [GetSdk]
$creadList :: ReadS [GetSdk]
readsPrec :: Int -> ReadS GetSdk
$creadsPrec :: Int -> ReadS GetSdk
Prelude.Read, Int -> GetSdk -> ShowS
[GetSdk] -> ShowS
GetSdk -> String
(Int -> GetSdk -> ShowS)
-> (GetSdk -> String) -> ([GetSdk] -> ShowS) -> Show GetSdk
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSdk] -> ShowS
$cshowList :: [GetSdk] -> ShowS
show :: GetSdk -> String
$cshow :: GetSdk -> String
showsPrec :: Int -> GetSdk -> ShowS
$cshowsPrec :: Int -> GetSdk -> ShowS
Prelude.Show, (forall x. GetSdk -> Rep GetSdk x)
-> (forall x. Rep GetSdk x -> GetSdk) -> Generic GetSdk
forall x. Rep GetSdk x -> GetSdk
forall x. GetSdk -> Rep GetSdk x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSdk x -> GetSdk
$cfrom :: forall x. GetSdk -> Rep GetSdk x
Prelude.Generic)
newGetSdk ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetSdk
newGetSdk :: Text -> Text -> Text -> GetSdk
newGetSdk Text
pRestApiId_ Text
pStageName_ Text
pSdkType_ =
GetSdk' :: Maybe (HashMap Text Text) -> Text -> Text -> Text -> GetSdk
GetSdk'
{ $sel:parameters:GetSdk' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:restApiId:GetSdk' :: Text
restApiId = Text
pRestApiId_,
$sel:stageName:GetSdk' :: Text
stageName = Text
pStageName_,
$sel:sdkType:GetSdk' :: Text
sdkType = Text
pSdkType_
}
getSdk_parameters :: Lens.Lens' GetSdk (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getSdk_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetSdk -> f GetSdk
getSdk_parameters = (GetSdk -> Maybe (HashMap Text Text))
-> (GetSdk -> Maybe (HashMap Text Text) -> GetSdk)
-> Lens
GetSdk
GetSdk
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdk' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:GetSdk' :: GetSdk -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: GetSdk
s@GetSdk' {} Maybe (HashMap Text Text)
a -> GetSdk
s {$sel:parameters:GetSdk' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: GetSdk) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetSdk -> f GetSdk)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetSdk
-> f GetSdk
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getSdk_restApiId :: Lens.Lens' GetSdk Prelude.Text
getSdk_restApiId :: (Text -> f Text) -> GetSdk -> f GetSdk
getSdk_restApiId = (GetSdk -> Text)
-> (GetSdk -> Text -> GetSdk) -> Lens GetSdk GetSdk Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdk' {Text
restApiId :: Text
$sel:restApiId:GetSdk' :: GetSdk -> Text
restApiId} -> Text
restApiId) (\s :: GetSdk
s@GetSdk' {} Text
a -> GetSdk
s {$sel:restApiId:GetSdk' :: Text
restApiId = Text
a} :: GetSdk)
getSdk_stageName :: Lens.Lens' GetSdk Prelude.Text
getSdk_stageName :: (Text -> f Text) -> GetSdk -> f GetSdk
getSdk_stageName = (GetSdk -> Text)
-> (GetSdk -> Text -> GetSdk) -> Lens GetSdk GetSdk Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdk' {Text
stageName :: Text
$sel:stageName:GetSdk' :: GetSdk -> Text
stageName} -> Text
stageName) (\s :: GetSdk
s@GetSdk' {} Text
a -> GetSdk
s {$sel:stageName:GetSdk' :: Text
stageName = Text
a} :: GetSdk)
getSdk_sdkType :: Lens.Lens' GetSdk Prelude.Text
getSdk_sdkType :: (Text -> f Text) -> GetSdk -> f GetSdk
getSdk_sdkType = (GetSdk -> Text)
-> (GetSdk -> Text -> GetSdk) -> Lens GetSdk GetSdk Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdk' {Text
sdkType :: Text
$sel:sdkType:GetSdk' :: GetSdk -> Text
sdkType} -> Text
sdkType) (\s :: GetSdk
s@GetSdk' {} Text
a -> GetSdk
s {$sel:sdkType:GetSdk' :: Text
sdkType = Text
a} :: GetSdk)
instance Core.AWSRequest GetSdk where
type AWSResponse GetSdk = GetSdkResponse
request :: GetSdk -> Request GetSdk
request = Service -> GetSdk -> Request GetSdk
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetSdk
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSdk)))
response =
(Int
-> ResponseHeaders
-> ByteString
-> Either String (AWSResponse GetSdk))
-> Logger
-> Service
-> Proxy GetSdk
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSdk)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
-> ResponseHeaders -> ByteString -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBytes
( \Int
s ResponseHeaders
h ByteString
x ->
Maybe ByteString
-> Maybe Text -> Maybe Text -> Int -> GetSdkResponse
GetSdkResponse'
(Maybe ByteString
-> Maybe Text -> Maybe Text -> Int -> GetSdkResponse)
-> Either String (Maybe ByteString)
-> Either
String (Maybe Text -> Maybe Text -> Int -> GetSdkResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Maybe ByteString -> Either String (Maybe ByteString)
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (ByteString -> Maybe ByteString
forall a. a -> Maybe a
Prelude.Just (ByteString -> ByteString
Prelude.coerce ByteString
x)))
Either String (Maybe Text -> Maybe Text -> Int -> GetSdkResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetSdkResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Disposition")
Either String (Maybe Text -> Int -> GetSdkResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetSdkResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
Either String (Int -> GetSdkResponse)
-> Either String Int -> Either String GetSdkResponse
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 GetSdk
instance Prelude.NFData GetSdk
instance Core.ToHeaders GetSdk where
toHeaders :: GetSdk -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetSdk -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Core.ToPath GetSdk where
toPath :: GetSdk -> ByteString
toPath GetSdk' {Maybe (HashMap Text Text)
Text
sdkType :: Text
stageName :: Text
restApiId :: Text
parameters :: Maybe (HashMap Text Text)
$sel:sdkType:GetSdk' :: GetSdk -> Text
$sel:stageName:GetSdk' :: GetSdk -> Text
$sel:restApiId:GetSdk' :: GetSdk -> Text
$sel:parameters:GetSdk' :: GetSdk -> Maybe (HashMap Text Text)
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/restapis/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
ByteString
"/stages/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
stageName,
ByteString
"/sdks/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
sdkType
]
instance Core.ToQuery GetSdk where
toQuery :: GetSdk -> QueryString
toQuery GetSdk' {Maybe (HashMap Text Text)
Text
sdkType :: Text
stageName :: Text
restApiId :: Text
parameters :: Maybe (HashMap Text Text)
$sel:sdkType:GetSdk' :: GetSdk -> Text
$sel:stageName:GetSdk' :: GetSdk -> Text
$sel:restApiId:GetSdk' :: GetSdk -> Text
$sel:parameters:GetSdk' :: GetSdk -> Maybe (HashMap Text Text)
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"parameters"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString
-> ByteString -> ByteString -> HashMap Text Text -> QueryString
forall k v.
(ToQuery k, ToQuery v) =>
ByteString
-> ByteString -> ByteString -> HashMap k v -> QueryString
Core.toQueryMap ByteString
"entry" ByteString
"key" ByteString
"value"
(HashMap Text Text -> QueryString)
-> Maybe (HashMap Text Text) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
parameters
)
]
data GetSdkResponse = GetSdkResponse'
{
GetSdkResponse -> Maybe ByteString
body :: Prelude.Maybe Prelude.ByteString,
GetSdkResponse -> Maybe Text
contentDisposition :: Prelude.Maybe Prelude.Text,
GetSdkResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
GetSdkResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSdkResponse -> GetSdkResponse -> Bool
(GetSdkResponse -> GetSdkResponse -> Bool)
-> (GetSdkResponse -> GetSdkResponse -> Bool) -> Eq GetSdkResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSdkResponse -> GetSdkResponse -> Bool
$c/= :: GetSdkResponse -> GetSdkResponse -> Bool
== :: GetSdkResponse -> GetSdkResponse -> Bool
$c== :: GetSdkResponse -> GetSdkResponse -> Bool
Prelude.Eq, Int -> GetSdkResponse -> ShowS
[GetSdkResponse] -> ShowS
GetSdkResponse -> String
(Int -> GetSdkResponse -> ShowS)
-> (GetSdkResponse -> String)
-> ([GetSdkResponse] -> ShowS)
-> Show GetSdkResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSdkResponse] -> ShowS
$cshowList :: [GetSdkResponse] -> ShowS
show :: GetSdkResponse -> String
$cshow :: GetSdkResponse -> String
showsPrec :: Int -> GetSdkResponse -> ShowS
$cshowsPrec :: Int -> GetSdkResponse -> ShowS
Prelude.Show, (forall x. GetSdkResponse -> Rep GetSdkResponse x)
-> (forall x. Rep GetSdkResponse x -> GetSdkResponse)
-> Generic GetSdkResponse
forall x. Rep GetSdkResponse x -> GetSdkResponse
forall x. GetSdkResponse -> Rep GetSdkResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSdkResponse x -> GetSdkResponse
$cfrom :: forall x. GetSdkResponse -> Rep GetSdkResponse x
Prelude.Generic)
newGetSdkResponse ::
Prelude.Int ->
GetSdkResponse
newGetSdkResponse :: Int -> GetSdkResponse
newGetSdkResponse Int
pHttpStatus_ =
GetSdkResponse' :: Maybe ByteString
-> Maybe Text -> Maybe Text -> Int -> GetSdkResponse
GetSdkResponse'
{ $sel:body:GetSdkResponse' :: Maybe ByteString
body = Maybe ByteString
forall a. Maybe a
Prelude.Nothing,
$sel:contentDisposition:GetSdkResponse' :: Maybe Text
contentDisposition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:GetSdkResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSdkResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSdkResponse_body :: Lens.Lens' GetSdkResponse (Prelude.Maybe Prelude.ByteString)
getSdkResponse_body :: (Maybe ByteString -> f (Maybe ByteString))
-> GetSdkResponse -> f GetSdkResponse
getSdkResponse_body = (GetSdkResponse -> Maybe ByteString)
-> (GetSdkResponse -> Maybe ByteString -> GetSdkResponse)
-> Lens
GetSdkResponse GetSdkResponse (Maybe ByteString) (Maybe ByteString)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdkResponse' {Maybe ByteString
body :: Maybe ByteString
$sel:body:GetSdkResponse' :: GetSdkResponse -> Maybe ByteString
body} -> Maybe ByteString
body) (\s :: GetSdkResponse
s@GetSdkResponse' {} Maybe ByteString
a -> GetSdkResponse
s {$sel:body:GetSdkResponse' :: Maybe ByteString
body = Maybe ByteString
a} :: GetSdkResponse)
getSdkResponse_contentDisposition :: Lens.Lens' GetSdkResponse (Prelude.Maybe Prelude.Text)
getSdkResponse_contentDisposition :: (Maybe Text -> f (Maybe Text))
-> GetSdkResponse -> f GetSdkResponse
getSdkResponse_contentDisposition = (GetSdkResponse -> Maybe Text)
-> (GetSdkResponse -> Maybe Text -> GetSdkResponse)
-> Lens GetSdkResponse GetSdkResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdkResponse' {Maybe Text
contentDisposition :: Maybe Text
$sel:contentDisposition:GetSdkResponse' :: GetSdkResponse -> Maybe Text
contentDisposition} -> Maybe Text
contentDisposition) (\s :: GetSdkResponse
s@GetSdkResponse' {} Maybe Text
a -> GetSdkResponse
s {$sel:contentDisposition:GetSdkResponse' :: Maybe Text
contentDisposition = Maybe Text
a} :: GetSdkResponse)
getSdkResponse_contentType :: Lens.Lens' GetSdkResponse (Prelude.Maybe Prelude.Text)
getSdkResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> GetSdkResponse -> f GetSdkResponse
getSdkResponse_contentType = (GetSdkResponse -> Maybe Text)
-> (GetSdkResponse -> Maybe Text -> GetSdkResponse)
-> Lens GetSdkResponse GetSdkResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdkResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:GetSdkResponse' :: GetSdkResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: GetSdkResponse
s@GetSdkResponse' {} Maybe Text
a -> GetSdkResponse
s {$sel:contentType:GetSdkResponse' :: Maybe Text
contentType = Maybe Text
a} :: GetSdkResponse)
getSdkResponse_httpStatus :: Lens.Lens' GetSdkResponse Prelude.Int
getSdkResponse_httpStatus :: (Int -> f Int) -> GetSdkResponse -> f GetSdkResponse
getSdkResponse_httpStatus = (GetSdkResponse -> Int)
-> (GetSdkResponse -> Int -> GetSdkResponse)
-> Lens GetSdkResponse GetSdkResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSdkResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSdkResponse' :: GetSdkResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSdkResponse
s@GetSdkResponse' {} Int
a -> GetSdkResponse
s {$sel:httpStatus:GetSdkResponse' :: Int
httpStatus = Int
a} :: GetSdkResponse)
instance Prelude.NFData GetSdkResponse