{-# 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.Schemas.GetCodeBindingSource
(
GetCodeBindingSource (..),
newGetCodeBindingSource,
getCodeBindingSource_schemaVersion,
getCodeBindingSource_registryName,
getCodeBindingSource_schemaName,
getCodeBindingSource_language,
GetCodeBindingSourceResponse (..),
newGetCodeBindingSourceResponse,
getCodeBindingSourceResponse_body,
getCodeBindingSourceResponse_httpStatus,
)
where
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
import Amazonka.Schemas.Types
data GetCodeBindingSource = GetCodeBindingSource'
{
GetCodeBindingSource -> Maybe Text
schemaVersion :: Prelude.Maybe Prelude.Text,
GetCodeBindingSource -> Text
registryName :: Prelude.Text,
GetCodeBindingSource -> Text
schemaName :: Prelude.Text,
GetCodeBindingSource -> Text
language :: Prelude.Text
}
deriving (GetCodeBindingSource -> GetCodeBindingSource -> Bool
(GetCodeBindingSource -> GetCodeBindingSource -> Bool)
-> (GetCodeBindingSource -> GetCodeBindingSource -> Bool)
-> Eq GetCodeBindingSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCodeBindingSource -> GetCodeBindingSource -> Bool
$c/= :: GetCodeBindingSource -> GetCodeBindingSource -> Bool
== :: GetCodeBindingSource -> GetCodeBindingSource -> Bool
$c== :: GetCodeBindingSource -> GetCodeBindingSource -> Bool
Prelude.Eq, ReadPrec [GetCodeBindingSource]
ReadPrec GetCodeBindingSource
Int -> ReadS GetCodeBindingSource
ReadS [GetCodeBindingSource]
(Int -> ReadS GetCodeBindingSource)
-> ReadS [GetCodeBindingSource]
-> ReadPrec GetCodeBindingSource
-> ReadPrec [GetCodeBindingSource]
-> Read GetCodeBindingSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCodeBindingSource]
$creadListPrec :: ReadPrec [GetCodeBindingSource]
readPrec :: ReadPrec GetCodeBindingSource
$creadPrec :: ReadPrec GetCodeBindingSource
readList :: ReadS [GetCodeBindingSource]
$creadList :: ReadS [GetCodeBindingSource]
readsPrec :: Int -> ReadS GetCodeBindingSource
$creadsPrec :: Int -> ReadS GetCodeBindingSource
Prelude.Read, Int -> GetCodeBindingSource -> ShowS
[GetCodeBindingSource] -> ShowS
GetCodeBindingSource -> String
(Int -> GetCodeBindingSource -> ShowS)
-> (GetCodeBindingSource -> String)
-> ([GetCodeBindingSource] -> ShowS)
-> Show GetCodeBindingSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCodeBindingSource] -> ShowS
$cshowList :: [GetCodeBindingSource] -> ShowS
show :: GetCodeBindingSource -> String
$cshow :: GetCodeBindingSource -> String
showsPrec :: Int -> GetCodeBindingSource -> ShowS
$cshowsPrec :: Int -> GetCodeBindingSource -> ShowS
Prelude.Show, (forall x. GetCodeBindingSource -> Rep GetCodeBindingSource x)
-> (forall x. Rep GetCodeBindingSource x -> GetCodeBindingSource)
-> Generic GetCodeBindingSource
forall x. Rep GetCodeBindingSource x -> GetCodeBindingSource
forall x. GetCodeBindingSource -> Rep GetCodeBindingSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCodeBindingSource x -> GetCodeBindingSource
$cfrom :: forall x. GetCodeBindingSource -> Rep GetCodeBindingSource x
Prelude.Generic)
newGetCodeBindingSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetCodeBindingSource
newGetCodeBindingSource :: Text -> Text -> Text -> GetCodeBindingSource
newGetCodeBindingSource
Text
pRegistryName_
Text
pSchemaName_
Text
pLanguage_ =
GetCodeBindingSource' :: Maybe Text -> Text -> Text -> Text -> GetCodeBindingSource
GetCodeBindingSource'
{ $sel:schemaVersion:GetCodeBindingSource' :: Maybe Text
schemaVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:registryName:GetCodeBindingSource' :: Text
registryName = Text
pRegistryName_,
$sel:schemaName:GetCodeBindingSource' :: Text
schemaName = Text
pSchemaName_,
$sel:language:GetCodeBindingSource' :: Text
language = Text
pLanguage_
}
getCodeBindingSource_schemaVersion :: Lens.Lens' GetCodeBindingSource (Prelude.Maybe Prelude.Text)
getCodeBindingSource_schemaVersion :: (Maybe Text -> f (Maybe Text))
-> GetCodeBindingSource -> f GetCodeBindingSource
getCodeBindingSource_schemaVersion = (GetCodeBindingSource -> Maybe Text)
-> (GetCodeBindingSource -> Maybe Text -> GetCodeBindingSource)
-> Lens
GetCodeBindingSource GetCodeBindingSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCodeBindingSource' {Maybe Text
schemaVersion :: Maybe Text
$sel:schemaVersion:GetCodeBindingSource' :: GetCodeBindingSource -> Maybe Text
schemaVersion} -> Maybe Text
schemaVersion) (\s :: GetCodeBindingSource
s@GetCodeBindingSource' {} Maybe Text
a -> GetCodeBindingSource
s {$sel:schemaVersion:GetCodeBindingSource' :: Maybe Text
schemaVersion = Maybe Text
a} :: GetCodeBindingSource)
getCodeBindingSource_registryName :: Lens.Lens' GetCodeBindingSource Prelude.Text
getCodeBindingSource_registryName :: (Text -> f Text) -> GetCodeBindingSource -> f GetCodeBindingSource
getCodeBindingSource_registryName = (GetCodeBindingSource -> Text)
-> (GetCodeBindingSource -> Text -> GetCodeBindingSource)
-> Lens GetCodeBindingSource GetCodeBindingSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCodeBindingSource' {Text
registryName :: Text
$sel:registryName:GetCodeBindingSource' :: GetCodeBindingSource -> Text
registryName} -> Text
registryName) (\s :: GetCodeBindingSource
s@GetCodeBindingSource' {} Text
a -> GetCodeBindingSource
s {$sel:registryName:GetCodeBindingSource' :: Text
registryName = Text
a} :: GetCodeBindingSource)
getCodeBindingSource_schemaName :: Lens.Lens' GetCodeBindingSource Prelude.Text
getCodeBindingSource_schemaName :: (Text -> f Text) -> GetCodeBindingSource -> f GetCodeBindingSource
getCodeBindingSource_schemaName = (GetCodeBindingSource -> Text)
-> (GetCodeBindingSource -> Text -> GetCodeBindingSource)
-> Lens GetCodeBindingSource GetCodeBindingSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCodeBindingSource' {Text
schemaName :: Text
$sel:schemaName:GetCodeBindingSource' :: GetCodeBindingSource -> Text
schemaName} -> Text
schemaName) (\s :: GetCodeBindingSource
s@GetCodeBindingSource' {} Text
a -> GetCodeBindingSource
s {$sel:schemaName:GetCodeBindingSource' :: Text
schemaName = Text
a} :: GetCodeBindingSource)
getCodeBindingSource_language :: Lens.Lens' GetCodeBindingSource Prelude.Text
getCodeBindingSource_language :: (Text -> f Text) -> GetCodeBindingSource -> f GetCodeBindingSource
getCodeBindingSource_language = (GetCodeBindingSource -> Text)
-> (GetCodeBindingSource -> Text -> GetCodeBindingSource)
-> Lens GetCodeBindingSource GetCodeBindingSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCodeBindingSource' {Text
language :: Text
$sel:language:GetCodeBindingSource' :: GetCodeBindingSource -> Text
language} -> Text
language) (\s :: GetCodeBindingSource
s@GetCodeBindingSource' {} Text
a -> GetCodeBindingSource
s {$sel:language:GetCodeBindingSource' :: Text
language = Text
a} :: GetCodeBindingSource)
instance Core.AWSRequest GetCodeBindingSource where
type
AWSResponse GetCodeBindingSource =
GetCodeBindingSourceResponse
request :: GetCodeBindingSource -> Request GetCodeBindingSource
request = Service -> GetCodeBindingSource -> Request GetCodeBindingSource
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetCodeBindingSource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetCodeBindingSource)))
response =
(Int
-> ResponseHeaders
-> ByteString
-> Either String (AWSResponse GetCodeBindingSource))
-> Logger
-> Service
-> Proxy GetCodeBindingSource
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetCodeBindingSource)))
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 -> Int -> GetCodeBindingSourceResponse
GetCodeBindingSourceResponse'
(Maybe ByteString -> Int -> GetCodeBindingSourceResponse)
-> Either String (Maybe ByteString)
-> Either String (Int -> GetCodeBindingSourceResponse)
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 (Int -> GetCodeBindingSourceResponse)
-> Either String Int -> Either String GetCodeBindingSourceResponse
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 GetCodeBindingSource
instance Prelude.NFData GetCodeBindingSource
instance Core.ToHeaders GetCodeBindingSource where
toHeaders :: GetCodeBindingSource -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetCodeBindingSource -> 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 GetCodeBindingSource where
toPath :: GetCodeBindingSource -> ByteString
toPath GetCodeBindingSource' {Maybe Text
Text
language :: Text
schemaName :: Text
registryName :: Text
schemaVersion :: Maybe Text
$sel:language:GetCodeBindingSource' :: GetCodeBindingSource -> Text
$sel:schemaName:GetCodeBindingSource' :: GetCodeBindingSource -> Text
$sel:registryName:GetCodeBindingSource' :: GetCodeBindingSource -> Text
$sel:schemaVersion:GetCodeBindingSource' :: GetCodeBindingSource -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/registries/name/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
registryName,
ByteString
"/schemas/name/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
schemaName,
ByteString
"/language/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
language,
ByteString
"/source"
]
instance Core.ToQuery GetCodeBindingSource where
toQuery :: GetCodeBindingSource -> QueryString
toQuery GetCodeBindingSource' {Maybe Text
Text
language :: Text
schemaName :: Text
registryName :: Text
schemaVersion :: Maybe Text
$sel:language:GetCodeBindingSource' :: GetCodeBindingSource -> Text
$sel:schemaName:GetCodeBindingSource' :: GetCodeBindingSource -> Text
$sel:registryName:GetCodeBindingSource' :: GetCodeBindingSource -> Text
$sel:schemaVersion:GetCodeBindingSource' :: GetCodeBindingSource -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"schemaVersion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
schemaVersion]
data GetCodeBindingSourceResponse = GetCodeBindingSourceResponse'
{ GetCodeBindingSourceResponse -> Maybe ByteString
body :: Prelude.Maybe Prelude.ByteString,
GetCodeBindingSourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetCodeBindingSourceResponse
-> GetCodeBindingSourceResponse -> Bool
(GetCodeBindingSourceResponse
-> GetCodeBindingSourceResponse -> Bool)
-> (GetCodeBindingSourceResponse
-> GetCodeBindingSourceResponse -> Bool)
-> Eq GetCodeBindingSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCodeBindingSourceResponse
-> GetCodeBindingSourceResponse -> Bool
$c/= :: GetCodeBindingSourceResponse
-> GetCodeBindingSourceResponse -> Bool
== :: GetCodeBindingSourceResponse
-> GetCodeBindingSourceResponse -> Bool
$c== :: GetCodeBindingSourceResponse
-> GetCodeBindingSourceResponse -> Bool
Prelude.Eq, ReadPrec [GetCodeBindingSourceResponse]
ReadPrec GetCodeBindingSourceResponse
Int -> ReadS GetCodeBindingSourceResponse
ReadS [GetCodeBindingSourceResponse]
(Int -> ReadS GetCodeBindingSourceResponse)
-> ReadS [GetCodeBindingSourceResponse]
-> ReadPrec GetCodeBindingSourceResponse
-> ReadPrec [GetCodeBindingSourceResponse]
-> Read GetCodeBindingSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCodeBindingSourceResponse]
$creadListPrec :: ReadPrec [GetCodeBindingSourceResponse]
readPrec :: ReadPrec GetCodeBindingSourceResponse
$creadPrec :: ReadPrec GetCodeBindingSourceResponse
readList :: ReadS [GetCodeBindingSourceResponse]
$creadList :: ReadS [GetCodeBindingSourceResponse]
readsPrec :: Int -> ReadS GetCodeBindingSourceResponse
$creadsPrec :: Int -> ReadS GetCodeBindingSourceResponse
Prelude.Read, Int -> GetCodeBindingSourceResponse -> ShowS
[GetCodeBindingSourceResponse] -> ShowS
GetCodeBindingSourceResponse -> String
(Int -> GetCodeBindingSourceResponse -> ShowS)
-> (GetCodeBindingSourceResponse -> String)
-> ([GetCodeBindingSourceResponse] -> ShowS)
-> Show GetCodeBindingSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCodeBindingSourceResponse] -> ShowS
$cshowList :: [GetCodeBindingSourceResponse] -> ShowS
show :: GetCodeBindingSourceResponse -> String
$cshow :: GetCodeBindingSourceResponse -> String
showsPrec :: Int -> GetCodeBindingSourceResponse -> ShowS
$cshowsPrec :: Int -> GetCodeBindingSourceResponse -> ShowS
Prelude.Show, (forall x.
GetCodeBindingSourceResponse -> Rep GetCodeBindingSourceResponse x)
-> (forall x.
Rep GetCodeBindingSourceResponse x -> GetCodeBindingSourceResponse)
-> Generic GetCodeBindingSourceResponse
forall x.
Rep GetCodeBindingSourceResponse x -> GetCodeBindingSourceResponse
forall x.
GetCodeBindingSourceResponse -> Rep GetCodeBindingSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCodeBindingSourceResponse x -> GetCodeBindingSourceResponse
$cfrom :: forall x.
GetCodeBindingSourceResponse -> Rep GetCodeBindingSourceResponse x
Prelude.Generic)
newGetCodeBindingSourceResponse ::
Prelude.Int ->
GetCodeBindingSourceResponse
newGetCodeBindingSourceResponse :: Int -> GetCodeBindingSourceResponse
newGetCodeBindingSourceResponse Int
pHttpStatus_ =
GetCodeBindingSourceResponse' :: Maybe ByteString -> Int -> GetCodeBindingSourceResponse
GetCodeBindingSourceResponse'
{ $sel:body:GetCodeBindingSourceResponse' :: Maybe ByteString
body =
Maybe ByteString
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCodeBindingSourceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getCodeBindingSourceResponse_body :: Lens.Lens' GetCodeBindingSourceResponse (Prelude.Maybe Prelude.ByteString)
getCodeBindingSourceResponse_body :: (Maybe ByteString -> f (Maybe ByteString))
-> GetCodeBindingSourceResponse -> f GetCodeBindingSourceResponse
getCodeBindingSourceResponse_body = (GetCodeBindingSourceResponse -> Maybe ByteString)
-> (GetCodeBindingSourceResponse
-> Maybe ByteString -> GetCodeBindingSourceResponse)
-> Lens
GetCodeBindingSourceResponse
GetCodeBindingSourceResponse
(Maybe ByteString)
(Maybe ByteString)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCodeBindingSourceResponse' {Maybe ByteString
body :: Maybe ByteString
$sel:body:GetCodeBindingSourceResponse' :: GetCodeBindingSourceResponse -> Maybe ByteString
body} -> Maybe ByteString
body) (\s :: GetCodeBindingSourceResponse
s@GetCodeBindingSourceResponse' {} Maybe ByteString
a -> GetCodeBindingSourceResponse
s {$sel:body:GetCodeBindingSourceResponse' :: Maybe ByteString
body = Maybe ByteString
a} :: GetCodeBindingSourceResponse)
getCodeBindingSourceResponse_httpStatus :: Lens.Lens' GetCodeBindingSourceResponse Prelude.Int
getCodeBindingSourceResponse_httpStatus :: (Int -> f Int)
-> GetCodeBindingSourceResponse -> f GetCodeBindingSourceResponse
getCodeBindingSourceResponse_httpStatus = (GetCodeBindingSourceResponse -> Int)
-> (GetCodeBindingSourceResponse
-> Int -> GetCodeBindingSourceResponse)
-> Lens
GetCodeBindingSourceResponse GetCodeBindingSourceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCodeBindingSourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCodeBindingSourceResponse' :: GetCodeBindingSourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCodeBindingSourceResponse
s@GetCodeBindingSourceResponse' {} Int
a -> GetCodeBindingSourceResponse
s {$sel:httpStatus:GetCodeBindingSourceResponse' :: Int
httpStatus = Int
a} :: GetCodeBindingSourceResponse)
instance Prelude.NFData GetCodeBindingSourceResponse