{-# 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.SSM.CreateDocument
(
CreateDocument (..),
newCreateDocument,
createDocument_documentType,
createDocument_attachments,
createDocument_versionName,
createDocument_targetType,
createDocument_documentFormat,
createDocument_displayName,
createDocument_requires,
createDocument_tags,
createDocument_content,
createDocument_name,
CreateDocumentResponse (..),
newCreateDocumentResponse,
createDocumentResponse_documentDescription,
createDocumentResponse_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.SSM.Types
data CreateDocument = CreateDocument'
{
CreateDocument -> Maybe DocumentType
documentType :: Prelude.Maybe DocumentType,
CreateDocument -> Maybe [AttachmentsSource]
attachments :: Prelude.Maybe [AttachmentsSource],
CreateDocument -> Maybe Text
versionName :: Prelude.Maybe Prelude.Text,
CreateDocument -> Maybe Text
targetType :: Prelude.Maybe Prelude.Text,
CreateDocument -> Maybe DocumentFormat
documentFormat :: Prelude.Maybe DocumentFormat,
CreateDocument -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
CreateDocument -> Maybe (NonEmpty DocumentRequires)
requires :: Prelude.Maybe (Prelude.NonEmpty DocumentRequires),
CreateDocument -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateDocument -> Text
content :: Prelude.Text,
CreateDocument -> Text
name :: Prelude.Text
}
deriving (CreateDocument -> CreateDocument -> Bool
(CreateDocument -> CreateDocument -> Bool)
-> (CreateDocument -> CreateDocument -> Bool) -> Eq CreateDocument
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDocument -> CreateDocument -> Bool
$c/= :: CreateDocument -> CreateDocument -> Bool
== :: CreateDocument -> CreateDocument -> Bool
$c== :: CreateDocument -> CreateDocument -> Bool
Prelude.Eq, ReadPrec [CreateDocument]
ReadPrec CreateDocument
Int -> ReadS CreateDocument
ReadS [CreateDocument]
(Int -> ReadS CreateDocument)
-> ReadS [CreateDocument]
-> ReadPrec CreateDocument
-> ReadPrec [CreateDocument]
-> Read CreateDocument
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDocument]
$creadListPrec :: ReadPrec [CreateDocument]
readPrec :: ReadPrec CreateDocument
$creadPrec :: ReadPrec CreateDocument
readList :: ReadS [CreateDocument]
$creadList :: ReadS [CreateDocument]
readsPrec :: Int -> ReadS CreateDocument
$creadsPrec :: Int -> ReadS CreateDocument
Prelude.Read, Int -> CreateDocument -> ShowS
[CreateDocument] -> ShowS
CreateDocument -> String
(Int -> CreateDocument -> ShowS)
-> (CreateDocument -> String)
-> ([CreateDocument] -> ShowS)
-> Show CreateDocument
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDocument] -> ShowS
$cshowList :: [CreateDocument] -> ShowS
show :: CreateDocument -> String
$cshow :: CreateDocument -> String
showsPrec :: Int -> CreateDocument -> ShowS
$cshowsPrec :: Int -> CreateDocument -> ShowS
Prelude.Show, (forall x. CreateDocument -> Rep CreateDocument x)
-> (forall x. Rep CreateDocument x -> CreateDocument)
-> Generic CreateDocument
forall x. Rep CreateDocument x -> CreateDocument
forall x. CreateDocument -> Rep CreateDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDocument x -> CreateDocument
$cfrom :: forall x. CreateDocument -> Rep CreateDocument x
Prelude.Generic)
newCreateDocument ::
Prelude.Text ->
Prelude.Text ->
CreateDocument
newCreateDocument :: Text -> Text -> CreateDocument
newCreateDocument Text
pContent_ Text
pName_ =
CreateDocument' :: Maybe DocumentType
-> Maybe [AttachmentsSource]
-> Maybe Text
-> Maybe Text
-> Maybe DocumentFormat
-> Maybe Text
-> Maybe (NonEmpty DocumentRequires)
-> Maybe [Tag]
-> Text
-> Text
-> CreateDocument
CreateDocument'
{ $sel:documentType:CreateDocument' :: Maybe DocumentType
documentType = Maybe DocumentType
forall a. Maybe a
Prelude.Nothing,
$sel:attachments:CreateDocument' :: Maybe [AttachmentsSource]
attachments = Maybe [AttachmentsSource]
forall a. Maybe a
Prelude.Nothing,
$sel:versionName:CreateDocument' :: Maybe Text
versionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetType:CreateDocument' :: Maybe Text
targetType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:documentFormat:CreateDocument' :: Maybe DocumentFormat
documentFormat = Maybe DocumentFormat
forall a. Maybe a
Prelude.Nothing,
$sel:displayName:CreateDocument' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:requires:CreateDocument' :: Maybe (NonEmpty DocumentRequires)
requires = Maybe (NonEmpty DocumentRequires)
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDocument' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:content:CreateDocument' :: Text
content = Text
pContent_,
$sel:name:CreateDocument' :: Text
name = Text
pName_
}
createDocument_documentType :: Lens.Lens' CreateDocument (Prelude.Maybe DocumentType)
createDocument_documentType :: (Maybe DocumentType -> f (Maybe DocumentType))
-> CreateDocument -> f CreateDocument
createDocument_documentType = (CreateDocument -> Maybe DocumentType)
-> (CreateDocument -> Maybe DocumentType -> CreateDocument)
-> Lens
CreateDocument
CreateDocument
(Maybe DocumentType)
(Maybe DocumentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe DocumentType
documentType :: Maybe DocumentType
$sel:documentType:CreateDocument' :: CreateDocument -> Maybe DocumentType
documentType} -> Maybe DocumentType
documentType) (\s :: CreateDocument
s@CreateDocument' {} Maybe DocumentType
a -> CreateDocument
s {$sel:documentType:CreateDocument' :: Maybe DocumentType
documentType = Maybe DocumentType
a} :: CreateDocument)
createDocument_attachments :: Lens.Lens' CreateDocument (Prelude.Maybe [AttachmentsSource])
createDocument_attachments :: (Maybe [AttachmentsSource] -> f (Maybe [AttachmentsSource]))
-> CreateDocument -> f CreateDocument
createDocument_attachments = (CreateDocument -> Maybe [AttachmentsSource])
-> (CreateDocument -> Maybe [AttachmentsSource] -> CreateDocument)
-> Lens
CreateDocument
CreateDocument
(Maybe [AttachmentsSource])
(Maybe [AttachmentsSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe [AttachmentsSource]
attachments :: Maybe [AttachmentsSource]
$sel:attachments:CreateDocument' :: CreateDocument -> Maybe [AttachmentsSource]
attachments} -> Maybe [AttachmentsSource]
attachments) (\s :: CreateDocument
s@CreateDocument' {} Maybe [AttachmentsSource]
a -> CreateDocument
s {$sel:attachments:CreateDocument' :: Maybe [AttachmentsSource]
attachments = Maybe [AttachmentsSource]
a} :: CreateDocument) ((Maybe [AttachmentsSource] -> f (Maybe [AttachmentsSource]))
-> CreateDocument -> f CreateDocument)
-> ((Maybe [AttachmentsSource] -> f (Maybe [AttachmentsSource]))
-> Maybe [AttachmentsSource] -> f (Maybe [AttachmentsSource]))
-> (Maybe [AttachmentsSource] -> f (Maybe [AttachmentsSource]))
-> CreateDocument
-> f CreateDocument
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AttachmentsSource]
[AttachmentsSource]
[AttachmentsSource]
[AttachmentsSource]
-> Iso
(Maybe [AttachmentsSource])
(Maybe [AttachmentsSource])
(Maybe [AttachmentsSource])
(Maybe [AttachmentsSource])
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
[AttachmentsSource]
[AttachmentsSource]
[AttachmentsSource]
[AttachmentsSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDocument_versionName :: Lens.Lens' CreateDocument (Prelude.Maybe Prelude.Text)
createDocument_versionName :: (Maybe Text -> f (Maybe Text))
-> CreateDocument -> f CreateDocument
createDocument_versionName = (CreateDocument -> Maybe Text)
-> (CreateDocument -> Maybe Text -> CreateDocument)
-> Lens CreateDocument CreateDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe Text
versionName :: Maybe Text
$sel:versionName:CreateDocument' :: CreateDocument -> Maybe Text
versionName} -> Maybe Text
versionName) (\s :: CreateDocument
s@CreateDocument' {} Maybe Text
a -> CreateDocument
s {$sel:versionName:CreateDocument' :: Maybe Text
versionName = Maybe Text
a} :: CreateDocument)
createDocument_targetType :: Lens.Lens' CreateDocument (Prelude.Maybe Prelude.Text)
createDocument_targetType :: (Maybe Text -> f (Maybe Text))
-> CreateDocument -> f CreateDocument
createDocument_targetType = (CreateDocument -> Maybe Text)
-> (CreateDocument -> Maybe Text -> CreateDocument)
-> Lens CreateDocument CreateDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe Text
targetType :: Maybe Text
$sel:targetType:CreateDocument' :: CreateDocument -> Maybe Text
targetType} -> Maybe Text
targetType) (\s :: CreateDocument
s@CreateDocument' {} Maybe Text
a -> CreateDocument
s {$sel:targetType:CreateDocument' :: Maybe Text
targetType = Maybe Text
a} :: CreateDocument)
createDocument_documentFormat :: Lens.Lens' CreateDocument (Prelude.Maybe DocumentFormat)
createDocument_documentFormat :: (Maybe DocumentFormat -> f (Maybe DocumentFormat))
-> CreateDocument -> f CreateDocument
createDocument_documentFormat = (CreateDocument -> Maybe DocumentFormat)
-> (CreateDocument -> Maybe DocumentFormat -> CreateDocument)
-> Lens
CreateDocument
CreateDocument
(Maybe DocumentFormat)
(Maybe DocumentFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe DocumentFormat
documentFormat :: Maybe DocumentFormat
$sel:documentFormat:CreateDocument' :: CreateDocument -> Maybe DocumentFormat
documentFormat} -> Maybe DocumentFormat
documentFormat) (\s :: CreateDocument
s@CreateDocument' {} Maybe DocumentFormat
a -> CreateDocument
s {$sel:documentFormat:CreateDocument' :: Maybe DocumentFormat
documentFormat = Maybe DocumentFormat
a} :: CreateDocument)
createDocument_displayName :: Lens.Lens' CreateDocument (Prelude.Maybe Prelude.Text)
createDocument_displayName :: (Maybe Text -> f (Maybe Text))
-> CreateDocument -> f CreateDocument
createDocument_displayName = (CreateDocument -> Maybe Text)
-> (CreateDocument -> Maybe Text -> CreateDocument)
-> Lens CreateDocument CreateDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe Text
displayName :: Maybe Text
$sel:displayName:CreateDocument' :: CreateDocument -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: CreateDocument
s@CreateDocument' {} Maybe Text
a -> CreateDocument
s {$sel:displayName:CreateDocument' :: Maybe Text
displayName = Maybe Text
a} :: CreateDocument)
createDocument_requires :: Lens.Lens' CreateDocument (Prelude.Maybe (Prelude.NonEmpty DocumentRequires))
createDocument_requires :: (Maybe (NonEmpty DocumentRequires)
-> f (Maybe (NonEmpty DocumentRequires)))
-> CreateDocument -> f CreateDocument
createDocument_requires = (CreateDocument -> Maybe (NonEmpty DocumentRequires))
-> (CreateDocument
-> Maybe (NonEmpty DocumentRequires) -> CreateDocument)
-> Lens
CreateDocument
CreateDocument
(Maybe (NonEmpty DocumentRequires))
(Maybe (NonEmpty DocumentRequires))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe (NonEmpty DocumentRequires)
requires :: Maybe (NonEmpty DocumentRequires)
$sel:requires:CreateDocument' :: CreateDocument -> Maybe (NonEmpty DocumentRequires)
requires} -> Maybe (NonEmpty DocumentRequires)
requires) (\s :: CreateDocument
s@CreateDocument' {} Maybe (NonEmpty DocumentRequires)
a -> CreateDocument
s {$sel:requires:CreateDocument' :: Maybe (NonEmpty DocumentRequires)
requires = Maybe (NonEmpty DocumentRequires)
a} :: CreateDocument) ((Maybe (NonEmpty DocumentRequires)
-> f (Maybe (NonEmpty DocumentRequires)))
-> CreateDocument -> f CreateDocument)
-> ((Maybe (NonEmpty DocumentRequires)
-> f (Maybe (NonEmpty DocumentRequires)))
-> Maybe (NonEmpty DocumentRequires)
-> f (Maybe (NonEmpty DocumentRequires)))
-> (Maybe (NonEmpty DocumentRequires)
-> f (Maybe (NonEmpty DocumentRequires)))
-> CreateDocument
-> f CreateDocument
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty DocumentRequires)
(NonEmpty DocumentRequires)
(NonEmpty DocumentRequires)
(NonEmpty DocumentRequires)
-> Iso
(Maybe (NonEmpty DocumentRequires))
(Maybe (NonEmpty DocumentRequires))
(Maybe (NonEmpty DocumentRequires))
(Maybe (NonEmpty DocumentRequires))
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
(NonEmpty DocumentRequires)
(NonEmpty DocumentRequires)
(NonEmpty DocumentRequires)
(NonEmpty DocumentRequires)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDocument_tags :: Lens.Lens' CreateDocument (Prelude.Maybe [Tag])
createDocument_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDocument -> f CreateDocument
createDocument_tags = (CreateDocument -> Maybe [Tag])
-> (CreateDocument -> Maybe [Tag] -> CreateDocument)
-> Lens CreateDocument CreateDocument (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDocument' :: CreateDocument -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDocument
s@CreateDocument' {} Maybe [Tag]
a -> CreateDocument
s {$sel:tags:CreateDocument' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDocument) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDocument -> f CreateDocument)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDocument
-> f CreateDocument
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDocument_content :: Lens.Lens' CreateDocument Prelude.Text
createDocument_content :: (Text -> f Text) -> CreateDocument -> f CreateDocument
createDocument_content = (CreateDocument -> Text)
-> (CreateDocument -> Text -> CreateDocument)
-> Lens CreateDocument CreateDocument Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Text
content :: Text
$sel:content:CreateDocument' :: CreateDocument -> Text
content} -> Text
content) (\s :: CreateDocument
s@CreateDocument' {} Text
a -> CreateDocument
s {$sel:content:CreateDocument' :: Text
content = Text
a} :: CreateDocument)
createDocument_name :: Lens.Lens' CreateDocument Prelude.Text
createDocument_name :: (Text -> f Text) -> CreateDocument -> f CreateDocument
createDocument_name = (CreateDocument -> Text)
-> (CreateDocument -> Text -> CreateDocument)
-> Lens CreateDocument CreateDocument Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocument' {Text
name :: Text
$sel:name:CreateDocument' :: CreateDocument -> Text
name} -> Text
name) (\s :: CreateDocument
s@CreateDocument' {} Text
a -> CreateDocument
s {$sel:name:CreateDocument' :: Text
name = Text
a} :: CreateDocument)
instance Core.AWSRequest CreateDocument where
type
AWSResponse CreateDocument =
CreateDocumentResponse
request :: CreateDocument -> Request CreateDocument
request = Service -> CreateDocument -> Request CreateDocument
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDocument
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDocument)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDocument))
-> Logger
-> Service
-> Proxy CreateDocument
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDocument)))
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 DocumentDescription -> Int -> CreateDocumentResponse
CreateDocumentResponse'
(Maybe DocumentDescription -> Int -> CreateDocumentResponse)
-> Either String (Maybe DocumentDescription)
-> Either String (Int -> CreateDocumentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DocumentDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DocumentDescription")
Either String (Int -> CreateDocumentResponse)
-> Either String Int -> Either String CreateDocumentResponse
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 CreateDocument
instance Prelude.NFData CreateDocument
instance Core.ToHeaders CreateDocument where
toHeaders :: CreateDocument -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateDocument -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"AmazonSSM.CreateDocument" :: Prelude.ByteString),
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 CreateDocument where
toJSON :: CreateDocument -> Value
toJSON CreateDocument' {Maybe [AttachmentsSource]
Maybe [Tag]
Maybe (NonEmpty DocumentRequires)
Maybe Text
Maybe DocumentFormat
Maybe DocumentType
Text
name :: Text
content :: Text
tags :: Maybe [Tag]
requires :: Maybe (NonEmpty DocumentRequires)
displayName :: Maybe Text
documentFormat :: Maybe DocumentFormat
targetType :: Maybe Text
versionName :: Maybe Text
attachments :: Maybe [AttachmentsSource]
documentType :: Maybe DocumentType
$sel:name:CreateDocument' :: CreateDocument -> Text
$sel:content:CreateDocument' :: CreateDocument -> Text
$sel:tags:CreateDocument' :: CreateDocument -> Maybe [Tag]
$sel:requires:CreateDocument' :: CreateDocument -> Maybe (NonEmpty DocumentRequires)
$sel:displayName:CreateDocument' :: CreateDocument -> Maybe Text
$sel:documentFormat:CreateDocument' :: CreateDocument -> Maybe DocumentFormat
$sel:targetType:CreateDocument' :: CreateDocument -> Maybe Text
$sel:versionName:CreateDocument' :: CreateDocument -> Maybe Text
$sel:attachments:CreateDocument' :: CreateDocument -> Maybe [AttachmentsSource]
$sel:documentType:CreateDocument' :: CreateDocument -> Maybe DocumentType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DocumentType" Text -> DocumentType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DocumentType -> Pair) -> Maybe DocumentType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DocumentType
documentType,
(Text
"Attachments" Text -> [AttachmentsSource] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AttachmentsSource] -> Pair)
-> Maybe [AttachmentsSource] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttachmentsSource]
attachments,
(Text
"VersionName" 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
versionName,
(Text
"TargetType" 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
targetType,
(Text
"DocumentFormat" Text -> DocumentFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DocumentFormat -> Pair) -> Maybe DocumentFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DocumentFormat
documentFormat,
(Text
"DisplayName" 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
displayName,
(Text
"Requires" Text -> NonEmpty DocumentRequires -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty DocumentRequires -> Pair)
-> Maybe (NonEmpty DocumentRequires) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty DocumentRequires)
requires,
(Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
content),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)
instance Core.ToPath CreateDocument where
toPath :: CreateDocument -> ByteString
toPath = ByteString -> CreateDocument -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateDocument where
toQuery :: CreateDocument -> QueryString
toQuery = QueryString -> CreateDocument -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDocumentResponse = CreateDocumentResponse'
{
CreateDocumentResponse -> Maybe DocumentDescription
documentDescription :: Prelude.Maybe DocumentDescription,
CreateDocumentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDocumentResponse -> CreateDocumentResponse -> Bool
(CreateDocumentResponse -> CreateDocumentResponse -> Bool)
-> (CreateDocumentResponse -> CreateDocumentResponse -> Bool)
-> Eq CreateDocumentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDocumentResponse -> CreateDocumentResponse -> Bool
$c/= :: CreateDocumentResponse -> CreateDocumentResponse -> Bool
== :: CreateDocumentResponse -> CreateDocumentResponse -> Bool
$c== :: CreateDocumentResponse -> CreateDocumentResponse -> Bool
Prelude.Eq, ReadPrec [CreateDocumentResponse]
ReadPrec CreateDocumentResponse
Int -> ReadS CreateDocumentResponse
ReadS [CreateDocumentResponse]
(Int -> ReadS CreateDocumentResponse)
-> ReadS [CreateDocumentResponse]
-> ReadPrec CreateDocumentResponse
-> ReadPrec [CreateDocumentResponse]
-> Read CreateDocumentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDocumentResponse]
$creadListPrec :: ReadPrec [CreateDocumentResponse]
readPrec :: ReadPrec CreateDocumentResponse
$creadPrec :: ReadPrec CreateDocumentResponse
readList :: ReadS [CreateDocumentResponse]
$creadList :: ReadS [CreateDocumentResponse]
readsPrec :: Int -> ReadS CreateDocumentResponse
$creadsPrec :: Int -> ReadS CreateDocumentResponse
Prelude.Read, Int -> CreateDocumentResponse -> ShowS
[CreateDocumentResponse] -> ShowS
CreateDocumentResponse -> String
(Int -> CreateDocumentResponse -> ShowS)
-> (CreateDocumentResponse -> String)
-> ([CreateDocumentResponse] -> ShowS)
-> Show CreateDocumentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDocumentResponse] -> ShowS
$cshowList :: [CreateDocumentResponse] -> ShowS
show :: CreateDocumentResponse -> String
$cshow :: CreateDocumentResponse -> String
showsPrec :: Int -> CreateDocumentResponse -> ShowS
$cshowsPrec :: Int -> CreateDocumentResponse -> ShowS
Prelude.Show, (forall x. CreateDocumentResponse -> Rep CreateDocumentResponse x)
-> (forall x.
Rep CreateDocumentResponse x -> CreateDocumentResponse)
-> Generic CreateDocumentResponse
forall x. Rep CreateDocumentResponse x -> CreateDocumentResponse
forall x. CreateDocumentResponse -> Rep CreateDocumentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDocumentResponse x -> CreateDocumentResponse
$cfrom :: forall x. CreateDocumentResponse -> Rep CreateDocumentResponse x
Prelude.Generic)
newCreateDocumentResponse ::
Prelude.Int ->
CreateDocumentResponse
newCreateDocumentResponse :: Int -> CreateDocumentResponse
newCreateDocumentResponse Int
pHttpStatus_ =
CreateDocumentResponse' :: Maybe DocumentDescription -> Int -> CreateDocumentResponse
CreateDocumentResponse'
{ $sel:documentDescription:CreateDocumentResponse' :: Maybe DocumentDescription
documentDescription =
Maybe DocumentDescription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDocumentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createDocumentResponse_documentDescription :: Lens.Lens' CreateDocumentResponse (Prelude.Maybe DocumentDescription)
createDocumentResponse_documentDescription :: (Maybe DocumentDescription -> f (Maybe DocumentDescription))
-> CreateDocumentResponse -> f CreateDocumentResponse
createDocumentResponse_documentDescription = (CreateDocumentResponse -> Maybe DocumentDescription)
-> (CreateDocumentResponse
-> Maybe DocumentDescription -> CreateDocumentResponse)
-> Lens
CreateDocumentResponse
CreateDocumentResponse
(Maybe DocumentDescription)
(Maybe DocumentDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocumentResponse' {Maybe DocumentDescription
documentDescription :: Maybe DocumentDescription
$sel:documentDescription:CreateDocumentResponse' :: CreateDocumentResponse -> Maybe DocumentDescription
documentDescription} -> Maybe DocumentDescription
documentDescription) (\s :: CreateDocumentResponse
s@CreateDocumentResponse' {} Maybe DocumentDescription
a -> CreateDocumentResponse
s {$sel:documentDescription:CreateDocumentResponse' :: Maybe DocumentDescription
documentDescription = Maybe DocumentDescription
a} :: CreateDocumentResponse)
createDocumentResponse_httpStatus :: Lens.Lens' CreateDocumentResponse Prelude.Int
createDocumentResponse_httpStatus :: (Int -> f Int)
-> CreateDocumentResponse -> f CreateDocumentResponse
createDocumentResponse_httpStatus = (CreateDocumentResponse -> Int)
-> (CreateDocumentResponse -> Int -> CreateDocumentResponse)
-> Lens CreateDocumentResponse CreateDocumentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDocumentResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDocumentResponse' :: CreateDocumentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDocumentResponse
s@CreateDocumentResponse' {} Int
a -> CreateDocumentResponse
s {$sel:httpStatus:CreateDocumentResponse' :: Int
httpStatus = Int
a} :: CreateDocumentResponse)
instance Prelude.NFData CreateDocumentResponse