{-# 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.ExportSchema
(
ExportSchema (..),
newExportSchema,
exportSchema_schemaVersion,
exportSchema_registryName,
exportSchema_schemaName,
exportSchema_type,
ExportSchemaResponse (..),
newExportSchemaResponse,
exportSchemaResponse_content,
exportSchemaResponse_schemaArn,
exportSchemaResponse_schemaName,
exportSchemaResponse_schemaVersion,
exportSchemaResponse_type,
exportSchemaResponse_httpStatus,
)
where
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
import Amazonka.Schemas.Types
data ExportSchema = ExportSchema'
{
ExportSchema -> Maybe Text
schemaVersion :: Prelude.Maybe Prelude.Text,
ExportSchema -> Text
registryName :: Prelude.Text,
ExportSchema -> Text
schemaName :: Prelude.Text,
ExportSchema -> Text
type' :: Prelude.Text
}
deriving (ExportSchema -> ExportSchema -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportSchema -> ExportSchema -> Bool
$c/= :: ExportSchema -> ExportSchema -> Bool
== :: ExportSchema -> ExportSchema -> Bool
$c== :: ExportSchema -> ExportSchema -> Bool
Prelude.Eq, ReadPrec [ExportSchema]
ReadPrec ExportSchema
Int -> ReadS ExportSchema
ReadS [ExportSchema]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportSchema]
$creadListPrec :: ReadPrec [ExportSchema]
readPrec :: ReadPrec ExportSchema
$creadPrec :: ReadPrec ExportSchema
readList :: ReadS [ExportSchema]
$creadList :: ReadS [ExportSchema]
readsPrec :: Int -> ReadS ExportSchema
$creadsPrec :: Int -> ReadS ExportSchema
Prelude.Read, Int -> ExportSchema -> ShowS
[ExportSchema] -> ShowS
ExportSchema -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportSchema] -> ShowS
$cshowList :: [ExportSchema] -> ShowS
show :: ExportSchema -> String
$cshow :: ExportSchema -> String
showsPrec :: Int -> ExportSchema -> ShowS
$cshowsPrec :: Int -> ExportSchema -> ShowS
Prelude.Show, forall x. Rep ExportSchema x -> ExportSchema
forall x. ExportSchema -> Rep ExportSchema x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportSchema x -> ExportSchema
$cfrom :: forall x. ExportSchema -> Rep ExportSchema x
Prelude.Generic)
newExportSchema ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ExportSchema
newExportSchema :: Text -> Text -> Text -> ExportSchema
newExportSchema Text
pRegistryName_ Text
pSchemaName_ Text
pType_ =
ExportSchema'
{ $sel:schemaVersion:ExportSchema' :: Maybe Text
schemaVersion = forall a. Maybe a
Prelude.Nothing,
$sel:registryName:ExportSchema' :: Text
registryName = Text
pRegistryName_,
$sel:schemaName:ExportSchema' :: Text
schemaName = Text
pSchemaName_,
$sel:type':ExportSchema' :: Text
type' = Text
pType_
}
exportSchema_schemaVersion :: Lens.Lens' ExportSchema (Prelude.Maybe Prelude.Text)
exportSchema_schemaVersion :: Lens' ExportSchema (Maybe Text)
exportSchema_schemaVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchema' {Maybe Text
schemaVersion :: Maybe Text
$sel:schemaVersion:ExportSchema' :: ExportSchema -> Maybe Text
schemaVersion} -> Maybe Text
schemaVersion) (\s :: ExportSchema
s@ExportSchema' {} Maybe Text
a -> ExportSchema
s {$sel:schemaVersion:ExportSchema' :: Maybe Text
schemaVersion = Maybe Text
a} :: ExportSchema)
exportSchema_registryName :: Lens.Lens' ExportSchema Prelude.Text
exportSchema_registryName :: Lens' ExportSchema Text
exportSchema_registryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchema' {Text
registryName :: Text
$sel:registryName:ExportSchema' :: ExportSchema -> Text
registryName} -> Text
registryName) (\s :: ExportSchema
s@ExportSchema' {} Text
a -> ExportSchema
s {$sel:registryName:ExportSchema' :: Text
registryName = Text
a} :: ExportSchema)
exportSchema_schemaName :: Lens.Lens' ExportSchema Prelude.Text
exportSchema_schemaName :: Lens' ExportSchema Text
exportSchema_schemaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchema' {Text
schemaName :: Text
$sel:schemaName:ExportSchema' :: ExportSchema -> Text
schemaName} -> Text
schemaName) (\s :: ExportSchema
s@ExportSchema' {} Text
a -> ExportSchema
s {$sel:schemaName:ExportSchema' :: Text
schemaName = Text
a} :: ExportSchema)
exportSchema_type :: Lens.Lens' ExportSchema Prelude.Text
exportSchema_type :: Lens' ExportSchema Text
exportSchema_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchema' {Text
type' :: Text
$sel:type':ExportSchema' :: ExportSchema -> Text
type'} -> Text
type') (\s :: ExportSchema
s@ExportSchema' {} Text
a -> ExportSchema
s {$sel:type':ExportSchema' :: Text
type' = Text
a} :: ExportSchema)
instance Core.AWSRequest ExportSchema where
type AWSResponse ExportSchema = ExportSchemaResponse
request :: (Service -> Service) -> ExportSchema -> Request ExportSchema
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 ExportSchema
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ExportSchema)))
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 ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> ExportSchemaResponse
ExportSchemaResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Content")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SchemaArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SchemaName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SchemaVersion")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Type")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable ExportSchema where
hashWithSalt :: Int -> ExportSchema -> Int
hashWithSalt Int
_salt ExportSchema' {Maybe Text
Text
type' :: Text
schemaName :: Text
registryName :: Text
schemaVersion :: Maybe Text
$sel:type':ExportSchema' :: ExportSchema -> Text
$sel:schemaName:ExportSchema' :: ExportSchema -> Text
$sel:registryName:ExportSchema' :: ExportSchema -> Text
$sel:schemaVersion:ExportSchema' :: ExportSchema -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
registryName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
schemaName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
type'
instance Prelude.NFData ExportSchema where
rnf :: ExportSchema -> ()
rnf ExportSchema' {Maybe Text
Text
type' :: Text
schemaName :: Text
registryName :: Text
schemaVersion :: Maybe Text
$sel:type':ExportSchema' :: ExportSchema -> Text
$sel:schemaName:ExportSchema' :: ExportSchema -> Text
$sel:registryName:ExportSchema' :: ExportSchema -> Text
$sel:schemaVersion:ExportSchema' :: ExportSchema -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
registryName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
schemaName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
type'
instance Data.ToHeaders ExportSchema where
toHeaders :: ExportSchema -> 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 ExportSchema where
toPath :: ExportSchema -> ByteString
toPath ExportSchema' {Maybe Text
Text
type' :: Text
schemaName :: Text
registryName :: Text
schemaVersion :: Maybe Text
$sel:type':ExportSchema' :: ExportSchema -> Text
$sel:schemaName:ExportSchema' :: ExportSchema -> Text
$sel:registryName:ExportSchema' :: ExportSchema -> Text
$sel:schemaVersion:ExportSchema' :: ExportSchema -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/registries/name/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
registryName,
ByteString
"/schemas/name/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
schemaName,
ByteString
"/export"
]
instance Data.ToQuery ExportSchema where
toQuery :: ExportSchema -> QueryString
toQuery ExportSchema' {Maybe Text
Text
type' :: Text
schemaName :: Text
registryName :: Text
schemaVersion :: Maybe Text
$sel:type':ExportSchema' :: ExportSchema -> Text
$sel:schemaName:ExportSchema' :: ExportSchema -> Text
$sel:registryName:ExportSchema' :: ExportSchema -> Text
$sel:schemaVersion:ExportSchema' :: ExportSchema -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"schemaVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
schemaVersion,
ByteString
"type" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
type'
]
data ExportSchemaResponse = ExportSchemaResponse'
{ ExportSchemaResponse -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
ExportSchemaResponse -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
ExportSchemaResponse -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
ExportSchemaResponse -> Maybe Text
schemaVersion :: Prelude.Maybe Prelude.Text,
ExportSchemaResponse -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
ExportSchemaResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ExportSchemaResponse -> ExportSchemaResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportSchemaResponse -> ExportSchemaResponse -> Bool
$c/= :: ExportSchemaResponse -> ExportSchemaResponse -> Bool
== :: ExportSchemaResponse -> ExportSchemaResponse -> Bool
$c== :: ExportSchemaResponse -> ExportSchemaResponse -> Bool
Prelude.Eq, ReadPrec [ExportSchemaResponse]
ReadPrec ExportSchemaResponse
Int -> ReadS ExportSchemaResponse
ReadS [ExportSchemaResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportSchemaResponse]
$creadListPrec :: ReadPrec [ExportSchemaResponse]
readPrec :: ReadPrec ExportSchemaResponse
$creadPrec :: ReadPrec ExportSchemaResponse
readList :: ReadS [ExportSchemaResponse]
$creadList :: ReadS [ExportSchemaResponse]
readsPrec :: Int -> ReadS ExportSchemaResponse
$creadsPrec :: Int -> ReadS ExportSchemaResponse
Prelude.Read, Int -> ExportSchemaResponse -> ShowS
[ExportSchemaResponse] -> ShowS
ExportSchemaResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportSchemaResponse] -> ShowS
$cshowList :: [ExportSchemaResponse] -> ShowS
show :: ExportSchemaResponse -> String
$cshow :: ExportSchemaResponse -> String
showsPrec :: Int -> ExportSchemaResponse -> ShowS
$cshowsPrec :: Int -> ExportSchemaResponse -> ShowS
Prelude.Show, forall x. Rep ExportSchemaResponse x -> ExportSchemaResponse
forall x. ExportSchemaResponse -> Rep ExportSchemaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportSchemaResponse x -> ExportSchemaResponse
$cfrom :: forall x. ExportSchemaResponse -> Rep ExportSchemaResponse x
Prelude.Generic)
newExportSchemaResponse ::
Prelude.Int ->
ExportSchemaResponse
newExportSchemaResponse :: Int -> ExportSchemaResponse
newExportSchemaResponse Int
pHttpStatus_ =
ExportSchemaResponse'
{ $sel:content:ExportSchemaResponse' :: Maybe Text
content = forall a. Maybe a
Prelude.Nothing,
$sel:schemaArn:ExportSchemaResponse' :: Maybe Text
schemaArn = forall a. Maybe a
Prelude.Nothing,
$sel:schemaName:ExportSchemaResponse' :: Maybe Text
schemaName = forall a. Maybe a
Prelude.Nothing,
$sel:schemaVersion:ExportSchemaResponse' :: Maybe Text
schemaVersion = forall a. Maybe a
Prelude.Nothing,
$sel:type':ExportSchemaResponse' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ExportSchemaResponse' :: Int
httpStatus = Int
pHttpStatus_
}
exportSchemaResponse_content :: Lens.Lens' ExportSchemaResponse (Prelude.Maybe Prelude.Text)
exportSchemaResponse_content :: Lens' ExportSchemaResponse (Maybe Text)
exportSchemaResponse_content = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchemaResponse' {Maybe Text
content :: Maybe Text
$sel:content:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
content} -> Maybe Text
content) (\s :: ExportSchemaResponse
s@ExportSchemaResponse' {} Maybe Text
a -> ExportSchemaResponse
s {$sel:content:ExportSchemaResponse' :: Maybe Text
content = Maybe Text
a} :: ExportSchemaResponse)
exportSchemaResponse_schemaArn :: Lens.Lens' ExportSchemaResponse (Prelude.Maybe Prelude.Text)
exportSchemaResponse_schemaArn :: Lens' ExportSchemaResponse (Maybe Text)
exportSchemaResponse_schemaArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchemaResponse' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: ExportSchemaResponse
s@ExportSchemaResponse' {} Maybe Text
a -> ExportSchemaResponse
s {$sel:schemaArn:ExportSchemaResponse' :: Maybe Text
schemaArn = Maybe Text
a} :: ExportSchemaResponse)
exportSchemaResponse_schemaName :: Lens.Lens' ExportSchemaResponse (Prelude.Maybe Prelude.Text)
exportSchemaResponse_schemaName :: Lens' ExportSchemaResponse (Maybe Text)
exportSchemaResponse_schemaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchemaResponse' {Maybe Text
schemaName :: Maybe Text
$sel:schemaName:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
schemaName} -> Maybe Text
schemaName) (\s :: ExportSchemaResponse
s@ExportSchemaResponse' {} Maybe Text
a -> ExportSchemaResponse
s {$sel:schemaName:ExportSchemaResponse' :: Maybe Text
schemaName = Maybe Text
a} :: ExportSchemaResponse)
exportSchemaResponse_schemaVersion :: Lens.Lens' ExportSchemaResponse (Prelude.Maybe Prelude.Text)
exportSchemaResponse_schemaVersion :: Lens' ExportSchemaResponse (Maybe Text)
exportSchemaResponse_schemaVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchemaResponse' {Maybe Text
schemaVersion :: Maybe Text
$sel:schemaVersion:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
schemaVersion} -> Maybe Text
schemaVersion) (\s :: ExportSchemaResponse
s@ExportSchemaResponse' {} Maybe Text
a -> ExportSchemaResponse
s {$sel:schemaVersion:ExportSchemaResponse' :: Maybe Text
schemaVersion = Maybe Text
a} :: ExportSchemaResponse)
exportSchemaResponse_type :: Lens.Lens' ExportSchemaResponse (Prelude.Maybe Prelude.Text)
exportSchemaResponse_type :: Lens' ExportSchemaResponse (Maybe Text)
exportSchemaResponse_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchemaResponse' {Maybe Text
type' :: Maybe Text
$sel:type':ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
type'} -> Maybe Text
type') (\s :: ExportSchemaResponse
s@ExportSchemaResponse' {} Maybe Text
a -> ExportSchemaResponse
s {$sel:type':ExportSchemaResponse' :: Maybe Text
type' = Maybe Text
a} :: ExportSchemaResponse)
exportSchemaResponse_httpStatus :: Lens.Lens' ExportSchemaResponse Prelude.Int
exportSchemaResponse_httpStatus :: Lens' ExportSchemaResponse Int
exportSchemaResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportSchemaResponse' {Int
httpStatus :: Int
$sel:httpStatus:ExportSchemaResponse' :: ExportSchemaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ExportSchemaResponse
s@ExportSchemaResponse' {} Int
a -> ExportSchemaResponse
s {$sel:httpStatus:ExportSchemaResponse' :: Int
httpStatus = Int
a} :: ExportSchemaResponse)
instance Prelude.NFData ExportSchemaResponse where
rnf :: ExportSchemaResponse -> ()
rnf ExportSchemaResponse' {Int
Maybe Text
httpStatus :: Int
type' :: Maybe Text
schemaVersion :: Maybe Text
schemaName :: Maybe Text
schemaArn :: Maybe Text
content :: Maybe Text
$sel:httpStatus:ExportSchemaResponse' :: ExportSchemaResponse -> Int
$sel:type':ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
$sel:schemaVersion:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
$sel:schemaName:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
$sel:schemaArn:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
$sel:content:ExportSchemaResponse' :: ExportSchemaResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
content
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus