{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Schemas.UpdateSchema
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the schema definition
--
-- Inactive schemas will be deleted after two years.
module Amazonka.Schemas.UpdateSchema
  ( -- * Creating a Request
    UpdateSchema (..),
    newUpdateSchema,

    -- * Request Lenses
    updateSchema_content,
    updateSchema_clientTokenId,
    updateSchema_type,
    updateSchema_description,
    updateSchema_registryName,
    updateSchema_schemaName,

    -- * Destructuring the Response
    UpdateSchemaResponse (..),
    newUpdateSchemaResponse,

    -- * Response Lenses
    updateSchemaResponse_schemaVersion,
    updateSchemaResponse_schemaName,
    updateSchemaResponse_schemaArn,
    updateSchemaResponse_type,
    updateSchemaResponse_lastModified,
    updateSchemaResponse_description,
    updateSchemaResponse_versionCreatedDate,
    updateSchemaResponse_tags,
    updateSchemaResponse_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

-- | /See:/ 'newUpdateSchema' smart constructor.
data UpdateSchema = UpdateSchema'
  { -- | The source of the schema definition.
    UpdateSchema -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
    -- | The ID of the client token.
    UpdateSchema -> Maybe Text
clientTokenId :: Prelude.Maybe Prelude.Text,
    -- | The schema type for the events schema.
    UpdateSchema -> Maybe Type
type' :: Prelude.Maybe Type,
    -- | The description of the schema.
    UpdateSchema -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the registry.
    UpdateSchema -> Text
registryName :: Prelude.Text,
    -- | The name of the schema.
    UpdateSchema -> Text
schemaName :: Prelude.Text
  }
  deriving (UpdateSchema -> UpdateSchema -> Bool
(UpdateSchema -> UpdateSchema -> Bool)
-> (UpdateSchema -> UpdateSchema -> Bool) -> Eq UpdateSchema
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSchema -> UpdateSchema -> Bool
$c/= :: UpdateSchema -> UpdateSchema -> Bool
== :: UpdateSchema -> UpdateSchema -> Bool
$c== :: UpdateSchema -> UpdateSchema -> Bool
Prelude.Eq, ReadPrec [UpdateSchema]
ReadPrec UpdateSchema
Int -> ReadS UpdateSchema
ReadS [UpdateSchema]
(Int -> ReadS UpdateSchema)
-> ReadS [UpdateSchema]
-> ReadPrec UpdateSchema
-> ReadPrec [UpdateSchema]
-> Read UpdateSchema
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSchema]
$creadListPrec :: ReadPrec [UpdateSchema]
readPrec :: ReadPrec UpdateSchema
$creadPrec :: ReadPrec UpdateSchema
readList :: ReadS [UpdateSchema]
$creadList :: ReadS [UpdateSchema]
readsPrec :: Int -> ReadS UpdateSchema
$creadsPrec :: Int -> ReadS UpdateSchema
Prelude.Read, Int -> UpdateSchema -> ShowS
[UpdateSchema] -> ShowS
UpdateSchema -> String
(Int -> UpdateSchema -> ShowS)
-> (UpdateSchema -> String)
-> ([UpdateSchema] -> ShowS)
-> Show UpdateSchema
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSchema] -> ShowS
$cshowList :: [UpdateSchema] -> ShowS
show :: UpdateSchema -> String
$cshow :: UpdateSchema -> String
showsPrec :: Int -> UpdateSchema -> ShowS
$cshowsPrec :: Int -> UpdateSchema -> ShowS
Prelude.Show, (forall x. UpdateSchema -> Rep UpdateSchema x)
-> (forall x. Rep UpdateSchema x -> UpdateSchema)
-> Generic UpdateSchema
forall x. Rep UpdateSchema x -> UpdateSchema
forall x. UpdateSchema -> Rep UpdateSchema x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSchema x -> UpdateSchema
$cfrom :: forall x. UpdateSchema -> Rep UpdateSchema x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSchema' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'content', 'updateSchema_content' - The source of the schema definition.
--
-- 'clientTokenId', 'updateSchema_clientTokenId' - The ID of the client token.
--
-- 'type'', 'updateSchema_type' - The schema type for the events schema.
--
-- 'description', 'updateSchema_description' - The description of the schema.
--
-- 'registryName', 'updateSchema_registryName' - The name of the registry.
--
-- 'schemaName', 'updateSchema_schemaName' - The name of the schema.
newUpdateSchema ::
  -- | 'registryName'
  Prelude.Text ->
  -- | 'schemaName'
  Prelude.Text ->
  UpdateSchema
newUpdateSchema :: Text -> Text -> UpdateSchema
newUpdateSchema Text
pRegistryName_ Text
pSchemaName_ =
  UpdateSchema' :: Maybe Text
-> Maybe Text
-> Maybe Type
-> Maybe Text
-> Text
-> Text
-> UpdateSchema
UpdateSchema'
    { $sel:content:UpdateSchema' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientTokenId:UpdateSchema' :: Maybe Text
clientTokenId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':UpdateSchema' :: Maybe Type
type' = Maybe Type
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateSchema' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:registryName:UpdateSchema' :: Text
registryName = Text
pRegistryName_,
      $sel:schemaName:UpdateSchema' :: Text
schemaName = Text
pSchemaName_
    }

-- | The source of the schema definition.
updateSchema_content :: Lens.Lens' UpdateSchema (Prelude.Maybe Prelude.Text)
updateSchema_content :: (Maybe Text -> f (Maybe Text)) -> UpdateSchema -> f UpdateSchema
updateSchema_content = (UpdateSchema -> Maybe Text)
-> (UpdateSchema -> Maybe Text -> UpdateSchema)
-> Lens UpdateSchema UpdateSchema (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Maybe Text
content :: Maybe Text
$sel:content:UpdateSchema' :: UpdateSchema -> Maybe Text
content} -> Maybe Text
content) (\s :: UpdateSchema
s@UpdateSchema' {} Maybe Text
a -> UpdateSchema
s {$sel:content:UpdateSchema' :: Maybe Text
content = Maybe Text
a} :: UpdateSchema)

-- | The ID of the client token.
updateSchema_clientTokenId :: Lens.Lens' UpdateSchema (Prelude.Maybe Prelude.Text)
updateSchema_clientTokenId :: (Maybe Text -> f (Maybe Text)) -> UpdateSchema -> f UpdateSchema
updateSchema_clientTokenId = (UpdateSchema -> Maybe Text)
-> (UpdateSchema -> Maybe Text -> UpdateSchema)
-> Lens UpdateSchema UpdateSchema (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Maybe Text
clientTokenId :: Maybe Text
$sel:clientTokenId:UpdateSchema' :: UpdateSchema -> Maybe Text
clientTokenId} -> Maybe Text
clientTokenId) (\s :: UpdateSchema
s@UpdateSchema' {} Maybe Text
a -> UpdateSchema
s {$sel:clientTokenId:UpdateSchema' :: Maybe Text
clientTokenId = Maybe Text
a} :: UpdateSchema)

-- | The schema type for the events schema.
updateSchema_type :: Lens.Lens' UpdateSchema (Prelude.Maybe Type)
updateSchema_type :: (Maybe Type -> f (Maybe Type)) -> UpdateSchema -> f UpdateSchema
updateSchema_type = (UpdateSchema -> Maybe Type)
-> (UpdateSchema -> Maybe Type -> UpdateSchema)
-> Lens UpdateSchema UpdateSchema (Maybe Type) (Maybe Type)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Maybe Type
type' :: Maybe Type
$sel:type':UpdateSchema' :: UpdateSchema -> Maybe Type
type'} -> Maybe Type
type') (\s :: UpdateSchema
s@UpdateSchema' {} Maybe Type
a -> UpdateSchema
s {$sel:type':UpdateSchema' :: Maybe Type
type' = Maybe Type
a} :: UpdateSchema)

-- | The description of the schema.
updateSchema_description :: Lens.Lens' UpdateSchema (Prelude.Maybe Prelude.Text)
updateSchema_description :: (Maybe Text -> f (Maybe Text)) -> UpdateSchema -> f UpdateSchema
updateSchema_description = (UpdateSchema -> Maybe Text)
-> (UpdateSchema -> Maybe Text -> UpdateSchema)
-> Lens UpdateSchema UpdateSchema (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Maybe Text
description :: Maybe Text
$sel:description:UpdateSchema' :: UpdateSchema -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateSchema
s@UpdateSchema' {} Maybe Text
a -> UpdateSchema
s {$sel:description:UpdateSchema' :: Maybe Text
description = Maybe Text
a} :: UpdateSchema)

-- | The name of the registry.
updateSchema_registryName :: Lens.Lens' UpdateSchema Prelude.Text
updateSchema_registryName :: (Text -> f Text) -> UpdateSchema -> f UpdateSchema
updateSchema_registryName = (UpdateSchema -> Text)
-> (UpdateSchema -> Text -> UpdateSchema)
-> Lens UpdateSchema UpdateSchema Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Text
registryName :: Text
$sel:registryName:UpdateSchema' :: UpdateSchema -> Text
registryName} -> Text
registryName) (\s :: UpdateSchema
s@UpdateSchema' {} Text
a -> UpdateSchema
s {$sel:registryName:UpdateSchema' :: Text
registryName = Text
a} :: UpdateSchema)

-- | The name of the schema.
updateSchema_schemaName :: Lens.Lens' UpdateSchema Prelude.Text
updateSchema_schemaName :: (Text -> f Text) -> UpdateSchema -> f UpdateSchema
updateSchema_schemaName = (UpdateSchema -> Text)
-> (UpdateSchema -> Text -> UpdateSchema)
-> Lens UpdateSchema UpdateSchema Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchema' {Text
schemaName :: Text
$sel:schemaName:UpdateSchema' :: UpdateSchema -> Text
schemaName} -> Text
schemaName) (\s :: UpdateSchema
s@UpdateSchema' {} Text
a -> UpdateSchema
s {$sel:schemaName:UpdateSchema' :: Text
schemaName = Text
a} :: UpdateSchema)

instance Core.AWSRequest UpdateSchema where
  type AWSResponse UpdateSchema = UpdateSchemaResponse
  request :: UpdateSchema -> Request UpdateSchema
request = Service -> UpdateSchema -> Request UpdateSchema
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateSchema
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateSchema)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateSchema))
-> Logger
-> Service
-> Proxy UpdateSchema
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateSchema)))
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 ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Int
-> UpdateSchemaResponse
UpdateSchemaResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe (HashMap Text Text)
 -> Int
 -> UpdateSchemaResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SchemaVersion")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateSchemaResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SchemaName")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateSchemaResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SchemaArn")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateSchemaResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Type")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateSchemaResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModified")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateSchemaResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe (HashMap Text Text) -> Int -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either
  String
  (Maybe POSIX
   -> Maybe (HashMap Text Text) -> Int -> UpdateSchemaResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VersionCreatedDate")
            Either
  String (Maybe (HashMap Text Text) -> Int -> UpdateSchemaResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> UpdateSchemaResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> UpdateSchemaResponse)
-> Either String Int -> Either String UpdateSchemaResponse
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 UpdateSchema

instance Prelude.NFData UpdateSchema

instance Core.ToHeaders UpdateSchema where
  toHeaders :: UpdateSchema -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateSchema -> 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.ToJSON UpdateSchema where
  toJSON :: UpdateSchema -> Value
toJSON UpdateSchema' {Maybe Text
Maybe Type
Text
schemaName :: Text
registryName :: Text
description :: Maybe Text
type' :: Maybe Type
clientTokenId :: Maybe Text
content :: Maybe Text
$sel:schemaName:UpdateSchema' :: UpdateSchema -> Text
$sel:registryName:UpdateSchema' :: UpdateSchema -> Text
$sel:description:UpdateSchema' :: UpdateSchema -> Maybe Text
$sel:type':UpdateSchema' :: UpdateSchema -> Maybe Type
$sel:clientTokenId:UpdateSchema' :: UpdateSchema -> Maybe Text
$sel:content:UpdateSchema' :: UpdateSchema -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
content,
            (Text
"ClientTokenId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientTokenId,
            (Text
"Type" Text -> Type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Type -> Pair) -> Maybe Type -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Type
type',
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
          ]
      )

instance Core.ToPath UpdateSchema where
  toPath :: UpdateSchema -> ByteString
toPath UpdateSchema' {Maybe Text
Maybe Type
Text
schemaName :: Text
registryName :: Text
description :: Maybe Text
type' :: Maybe Type
clientTokenId :: Maybe Text
content :: Maybe Text
$sel:schemaName:UpdateSchema' :: UpdateSchema -> Text
$sel:registryName:UpdateSchema' :: UpdateSchema -> Text
$sel:description:UpdateSchema' :: UpdateSchema -> Maybe Text
$sel:type':UpdateSchema' :: UpdateSchema -> Maybe Type
$sel:clientTokenId:UpdateSchema' :: UpdateSchema -> Maybe Text
$sel:content:UpdateSchema' :: UpdateSchema -> 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
      ]

instance Core.ToQuery UpdateSchema where
  toQuery :: UpdateSchema -> QueryString
toQuery = QueryString -> UpdateSchema -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateSchemaResponse' smart constructor.
data UpdateSchemaResponse = UpdateSchemaResponse'
  { -- | The version number of the schema
    UpdateSchemaResponse -> Maybe Text
schemaVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the schema.
    UpdateSchemaResponse -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the schema.
    UpdateSchemaResponse -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
    -- | The type of the schema.
    UpdateSchemaResponse -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | The date and time that schema was modified.
    UpdateSchemaResponse -> Maybe POSIX
lastModified :: Prelude.Maybe Core.POSIX,
    -- | The description of the schema.
    UpdateSchemaResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date the schema version was created.
    UpdateSchemaResponse -> Maybe POSIX
versionCreatedDate :: Prelude.Maybe Core.POSIX,
    UpdateSchemaResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    UpdateSchemaResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
(UpdateSchemaResponse -> UpdateSchemaResponse -> Bool)
-> (UpdateSchemaResponse -> UpdateSchemaResponse -> Bool)
-> Eq UpdateSchemaResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
$c/= :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
== :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
$c== :: UpdateSchemaResponse -> UpdateSchemaResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSchemaResponse]
ReadPrec UpdateSchemaResponse
Int -> ReadS UpdateSchemaResponse
ReadS [UpdateSchemaResponse]
(Int -> ReadS UpdateSchemaResponse)
-> ReadS [UpdateSchemaResponse]
-> ReadPrec UpdateSchemaResponse
-> ReadPrec [UpdateSchemaResponse]
-> Read UpdateSchemaResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSchemaResponse]
$creadListPrec :: ReadPrec [UpdateSchemaResponse]
readPrec :: ReadPrec UpdateSchemaResponse
$creadPrec :: ReadPrec UpdateSchemaResponse
readList :: ReadS [UpdateSchemaResponse]
$creadList :: ReadS [UpdateSchemaResponse]
readsPrec :: Int -> ReadS UpdateSchemaResponse
$creadsPrec :: Int -> ReadS UpdateSchemaResponse
Prelude.Read, Int -> UpdateSchemaResponse -> ShowS
[UpdateSchemaResponse] -> ShowS
UpdateSchemaResponse -> String
(Int -> UpdateSchemaResponse -> ShowS)
-> (UpdateSchemaResponse -> String)
-> ([UpdateSchemaResponse] -> ShowS)
-> Show UpdateSchemaResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSchemaResponse] -> ShowS
$cshowList :: [UpdateSchemaResponse] -> ShowS
show :: UpdateSchemaResponse -> String
$cshow :: UpdateSchemaResponse -> String
showsPrec :: Int -> UpdateSchemaResponse -> ShowS
$cshowsPrec :: Int -> UpdateSchemaResponse -> ShowS
Prelude.Show, (forall x. UpdateSchemaResponse -> Rep UpdateSchemaResponse x)
-> (forall x. Rep UpdateSchemaResponse x -> UpdateSchemaResponse)
-> Generic UpdateSchemaResponse
forall x. Rep UpdateSchemaResponse x -> UpdateSchemaResponse
forall x. UpdateSchemaResponse -> Rep UpdateSchemaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSchemaResponse x -> UpdateSchemaResponse
$cfrom :: forall x. UpdateSchemaResponse -> Rep UpdateSchemaResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSchemaResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'schemaVersion', 'updateSchemaResponse_schemaVersion' - The version number of the schema
--
-- 'schemaName', 'updateSchemaResponse_schemaName' - The name of the schema.
--
-- 'schemaArn', 'updateSchemaResponse_schemaArn' - The ARN of the schema.
--
-- 'type'', 'updateSchemaResponse_type' - The type of the schema.
--
-- 'lastModified', 'updateSchemaResponse_lastModified' - The date and time that schema was modified.
--
-- 'description', 'updateSchemaResponse_description' - The description of the schema.
--
-- 'versionCreatedDate', 'updateSchemaResponse_versionCreatedDate' - The date the schema version was created.
--
-- 'tags', 'updateSchemaResponse_tags' - Undocumented member.
--
-- 'httpStatus', 'updateSchemaResponse_httpStatus' - The response's http status code.
newUpdateSchemaResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateSchemaResponse
newUpdateSchemaResponse :: Int -> UpdateSchemaResponse
newUpdateSchemaResponse Int
pHttpStatus_ =
  UpdateSchemaResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Int
-> UpdateSchemaResponse
UpdateSchemaResponse'
    { $sel:schemaVersion:UpdateSchemaResponse' :: Maybe Text
schemaVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaName:UpdateSchemaResponse' :: Maybe Text
schemaName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:UpdateSchemaResponse' :: Maybe Text
schemaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':UpdateSchemaResponse' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModified:UpdateSchemaResponse' :: Maybe POSIX
lastModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateSchemaResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:versionCreatedDate:UpdateSchemaResponse' :: Maybe POSIX
versionCreatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:UpdateSchemaResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateSchemaResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The version number of the schema
updateSchemaResponse_schemaVersion :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_schemaVersion :: (Maybe Text -> f (Maybe Text))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_schemaVersion = (UpdateSchemaResponse -> Maybe Text)
-> (UpdateSchemaResponse -> Maybe Text -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse UpdateSchemaResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
schemaVersion :: Maybe Text
$sel:schemaVersion:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
schemaVersion} -> Maybe Text
schemaVersion) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:schemaVersion:UpdateSchemaResponse' :: Maybe Text
schemaVersion = Maybe Text
a} :: UpdateSchemaResponse)

-- | The name of the schema.
updateSchemaResponse_schemaName :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_schemaName :: (Maybe Text -> f (Maybe Text))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_schemaName = (UpdateSchemaResponse -> Maybe Text)
-> (UpdateSchemaResponse -> Maybe Text -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse UpdateSchemaResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
schemaName :: Maybe Text
$sel:schemaName:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
schemaName} -> Maybe Text
schemaName) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:schemaName:UpdateSchemaResponse' :: Maybe Text
schemaName = Maybe Text
a} :: UpdateSchemaResponse)

-- | The ARN of the schema.
updateSchemaResponse_schemaArn :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_schemaArn :: (Maybe Text -> f (Maybe Text))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_schemaArn = (UpdateSchemaResponse -> Maybe Text)
-> (UpdateSchemaResponse -> Maybe Text -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse UpdateSchemaResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:schemaArn:UpdateSchemaResponse' :: Maybe Text
schemaArn = Maybe Text
a} :: UpdateSchemaResponse)

-- | The type of the schema.
updateSchemaResponse_type :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_type :: (Maybe Text -> f (Maybe Text))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_type = (UpdateSchemaResponse -> Maybe Text)
-> (UpdateSchemaResponse -> Maybe Text -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse UpdateSchemaResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
type' :: Maybe Text
$sel:type':UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
type'} -> Maybe Text
type') (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:type':UpdateSchemaResponse' :: Maybe Text
type' = Maybe Text
a} :: UpdateSchemaResponse)

-- | The date and time that schema was modified.
updateSchemaResponse_lastModified :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.UTCTime)
updateSchemaResponse_lastModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_lastModified = (UpdateSchemaResponse -> Maybe POSIX)
-> (UpdateSchemaResponse -> Maybe POSIX -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse
     UpdateSchemaResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe POSIX
lastModified :: Maybe POSIX
$sel:lastModified:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe POSIX
lastModified} -> Maybe POSIX
lastModified) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe POSIX
a -> UpdateSchemaResponse
s {$sel:lastModified:UpdateSchemaResponse' :: Maybe POSIX
lastModified = Maybe POSIX
a} :: UpdateSchemaResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateSchemaResponse -> f UpdateSchemaResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateSchemaResponse
-> f UpdateSchemaResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description of the schema.
updateSchemaResponse_description :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.Text)
updateSchemaResponse_description :: (Maybe Text -> f (Maybe Text))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_description = (UpdateSchemaResponse -> Maybe Text)
-> (UpdateSchemaResponse -> Maybe Text -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse UpdateSchemaResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe Text
description :: Maybe Text
$sel:description:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe Text
a -> UpdateSchemaResponse
s {$sel:description:UpdateSchemaResponse' :: Maybe Text
description = Maybe Text
a} :: UpdateSchemaResponse)

-- | The date the schema version was created.
updateSchemaResponse_versionCreatedDate :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe Prelude.UTCTime)
updateSchemaResponse_versionCreatedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_versionCreatedDate = (UpdateSchemaResponse -> Maybe POSIX)
-> (UpdateSchemaResponse -> Maybe POSIX -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse
     UpdateSchemaResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Maybe POSIX
versionCreatedDate :: Maybe POSIX
$sel:versionCreatedDate:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe POSIX
versionCreatedDate} -> Maybe POSIX
versionCreatedDate) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe POSIX
a -> UpdateSchemaResponse
s {$sel:versionCreatedDate:UpdateSchemaResponse' :: Maybe POSIX
versionCreatedDate = Maybe POSIX
a} :: UpdateSchemaResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateSchemaResponse -> f UpdateSchemaResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateSchemaResponse
-> f UpdateSchemaResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Undocumented member.
updateSchemaResponse_tags :: Lens.Lens' UpdateSchemaResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateSchemaResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_tags = (UpdateSchemaResponse -> Maybe (HashMap Text Text))
-> (UpdateSchemaResponse
    -> Maybe (HashMap Text Text) -> UpdateSchemaResponse)
-> Lens
     UpdateSchemaResponse
     UpdateSchemaResponse
     (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 (\UpdateSchemaResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:UpdateSchemaResponse' :: UpdateSchemaResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Maybe (HashMap Text Text)
a -> UpdateSchemaResponse
s {$sel:tags:UpdateSchemaResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: UpdateSchemaResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateSchemaResponse -> f UpdateSchemaResponse)
-> ((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)))
-> UpdateSchemaResponse
-> f UpdateSchemaResponse
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

-- | The response's http status code.
updateSchemaResponse_httpStatus :: Lens.Lens' UpdateSchemaResponse Prelude.Int
updateSchemaResponse_httpStatus :: (Int -> f Int) -> UpdateSchemaResponse -> f UpdateSchemaResponse
updateSchemaResponse_httpStatus = (UpdateSchemaResponse -> Int)
-> (UpdateSchemaResponse -> Int -> UpdateSchemaResponse)
-> Lens UpdateSchemaResponse UpdateSchemaResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSchemaResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSchemaResponse' :: UpdateSchemaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSchemaResponse
s@UpdateSchemaResponse' {} Int
a -> UpdateSchemaResponse
s {$sel:httpStatus:UpdateSchemaResponse' :: Int
httpStatus = Int
a} :: UpdateSchemaResponse)

instance Prelude.NFData UpdateSchemaResponse