{-# 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.SSM.GetDocument
-- 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)
--
-- Gets the contents of the specified Amazon Web Services Systems Manager
-- document (SSM document).
module Amazonka.SSM.GetDocument
  ( -- * Creating a Request
    GetDocument (..),
    newGetDocument,

    -- * Request Lenses
    getDocument_versionName,
    getDocument_documentFormat,
    getDocument_documentVersion,
    getDocument_name,

    -- * Destructuring the Response
    GetDocumentResponse (..),
    newGetDocumentResponse,

    -- * Response Lenses
    getDocumentResponse_status,
    getDocumentResponse_documentType,
    getDocumentResponse_versionName,
    getDocumentResponse_attachmentsContent,
    getDocumentResponse_reviewStatus,
    getDocumentResponse_content,
    getDocumentResponse_createdDate,
    getDocumentResponse_documentFormat,
    getDocumentResponse_name,
    getDocumentResponse_documentVersion,
    getDocumentResponse_displayName,
    getDocumentResponse_statusInformation,
    getDocumentResponse_requires,
    getDocumentResponse_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

-- | /See:/ 'newGetDocument' smart constructor.
data GetDocument = GetDocument'
  { -- | An optional field specifying the version of the artifact associated with
    -- the document. For example, \"Release 12, Update 6\". This value is
    -- unique across all versions of a document and can\'t be changed.
    GetDocument -> Maybe Text
versionName :: Prelude.Maybe Prelude.Text,
    -- | Returns the document in the specified format. The document format can be
    -- either JSON or YAML. JSON is the default format.
    GetDocument -> Maybe DocumentFormat
documentFormat :: Prelude.Maybe DocumentFormat,
    -- | The document version for which you want information.
    GetDocument -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the SSM document.
    GetDocument -> Text
name :: Prelude.Text
  }
  deriving (GetDocument -> GetDocument -> Bool
(GetDocument -> GetDocument -> Bool)
-> (GetDocument -> GetDocument -> Bool) -> Eq GetDocument
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDocument -> GetDocument -> Bool
$c/= :: GetDocument -> GetDocument -> Bool
== :: GetDocument -> GetDocument -> Bool
$c== :: GetDocument -> GetDocument -> Bool
Prelude.Eq, ReadPrec [GetDocument]
ReadPrec GetDocument
Int -> ReadS GetDocument
ReadS [GetDocument]
(Int -> ReadS GetDocument)
-> ReadS [GetDocument]
-> ReadPrec GetDocument
-> ReadPrec [GetDocument]
-> Read GetDocument
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDocument]
$creadListPrec :: ReadPrec [GetDocument]
readPrec :: ReadPrec GetDocument
$creadPrec :: ReadPrec GetDocument
readList :: ReadS [GetDocument]
$creadList :: ReadS [GetDocument]
readsPrec :: Int -> ReadS GetDocument
$creadsPrec :: Int -> ReadS GetDocument
Prelude.Read, Int -> GetDocument -> ShowS
[GetDocument] -> ShowS
GetDocument -> String
(Int -> GetDocument -> ShowS)
-> (GetDocument -> String)
-> ([GetDocument] -> ShowS)
-> Show GetDocument
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDocument] -> ShowS
$cshowList :: [GetDocument] -> ShowS
show :: GetDocument -> String
$cshow :: GetDocument -> String
showsPrec :: Int -> GetDocument -> ShowS
$cshowsPrec :: Int -> GetDocument -> ShowS
Prelude.Show, (forall x. GetDocument -> Rep GetDocument x)
-> (forall x. Rep GetDocument x -> GetDocument)
-> Generic GetDocument
forall x. Rep GetDocument x -> GetDocument
forall x. GetDocument -> Rep GetDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDocument x -> GetDocument
$cfrom :: forall x. GetDocument -> Rep GetDocument x
Prelude.Generic)

-- |
-- Create a value of 'GetDocument' 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:
--
-- 'versionName', 'getDocument_versionName' - An optional field specifying the version of the artifact associated with
-- the document. For example, \"Release 12, Update 6\". This value is
-- unique across all versions of a document and can\'t be changed.
--
-- 'documentFormat', 'getDocument_documentFormat' - Returns the document in the specified format. The document format can be
-- either JSON or YAML. JSON is the default format.
--
-- 'documentVersion', 'getDocument_documentVersion' - The document version for which you want information.
--
-- 'name', 'getDocument_name' - The name of the SSM document.
newGetDocument ::
  -- | 'name'
  Prelude.Text ->
  GetDocument
newGetDocument :: Text -> GetDocument
newGetDocument Text
pName_ =
  GetDocument' :: Maybe Text
-> Maybe DocumentFormat -> Maybe Text -> Text -> GetDocument
GetDocument'
    { $sel:versionName:GetDocument' :: Maybe Text
versionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:documentFormat:GetDocument' :: Maybe DocumentFormat
documentFormat = Maybe DocumentFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:documentVersion:GetDocument' :: Maybe Text
documentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetDocument' :: Text
name = Text
pName_
    }

-- | An optional field specifying the version of the artifact associated with
-- the document. For example, \"Release 12, Update 6\". This value is
-- unique across all versions of a document and can\'t be changed.
getDocument_versionName :: Lens.Lens' GetDocument (Prelude.Maybe Prelude.Text)
getDocument_versionName :: (Maybe Text -> f (Maybe Text)) -> GetDocument -> f GetDocument
getDocument_versionName = (GetDocument -> Maybe Text)
-> (GetDocument -> Maybe Text -> GetDocument)
-> Lens GetDocument GetDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocument' {Maybe Text
versionName :: Maybe Text
$sel:versionName:GetDocument' :: GetDocument -> Maybe Text
versionName} -> Maybe Text
versionName) (\s :: GetDocument
s@GetDocument' {} Maybe Text
a -> GetDocument
s {$sel:versionName:GetDocument' :: Maybe Text
versionName = Maybe Text
a} :: GetDocument)

-- | Returns the document in the specified format. The document format can be
-- either JSON or YAML. JSON is the default format.
getDocument_documentFormat :: Lens.Lens' GetDocument (Prelude.Maybe DocumentFormat)
getDocument_documentFormat :: (Maybe DocumentFormat -> f (Maybe DocumentFormat))
-> GetDocument -> f GetDocument
getDocument_documentFormat = (GetDocument -> Maybe DocumentFormat)
-> (GetDocument -> Maybe DocumentFormat -> GetDocument)
-> Lens
     GetDocument
     GetDocument
     (Maybe DocumentFormat)
     (Maybe DocumentFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocument' {Maybe DocumentFormat
documentFormat :: Maybe DocumentFormat
$sel:documentFormat:GetDocument' :: GetDocument -> Maybe DocumentFormat
documentFormat} -> Maybe DocumentFormat
documentFormat) (\s :: GetDocument
s@GetDocument' {} Maybe DocumentFormat
a -> GetDocument
s {$sel:documentFormat:GetDocument' :: Maybe DocumentFormat
documentFormat = Maybe DocumentFormat
a} :: GetDocument)

-- | The document version for which you want information.
getDocument_documentVersion :: Lens.Lens' GetDocument (Prelude.Maybe Prelude.Text)
getDocument_documentVersion :: (Maybe Text -> f (Maybe Text)) -> GetDocument -> f GetDocument
getDocument_documentVersion = (GetDocument -> Maybe Text)
-> (GetDocument -> Maybe Text -> GetDocument)
-> Lens GetDocument GetDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocument' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:GetDocument' :: GetDocument -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: GetDocument
s@GetDocument' {} Maybe Text
a -> GetDocument
s {$sel:documentVersion:GetDocument' :: Maybe Text
documentVersion = Maybe Text
a} :: GetDocument)

-- | The name of the SSM document.
getDocument_name :: Lens.Lens' GetDocument Prelude.Text
getDocument_name :: (Text -> f Text) -> GetDocument -> f GetDocument
getDocument_name = (GetDocument -> Text)
-> (GetDocument -> Text -> GetDocument)
-> Lens GetDocument GetDocument Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocument' {Text
name :: Text
$sel:name:GetDocument' :: GetDocument -> Text
name} -> Text
name) (\s :: GetDocument
s@GetDocument' {} Text
a -> GetDocument
s {$sel:name:GetDocument' :: Text
name = Text
a} :: GetDocument)

instance Core.AWSRequest GetDocument where
  type AWSResponse GetDocument = GetDocumentResponse
  request :: GetDocument -> Request GetDocument
request = Service -> GetDocument -> Request GetDocument
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDocument
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDocument)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetDocument))
-> Logger
-> Service
-> Proxy GetDocument
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDocument)))
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 DocumentStatus
-> Maybe DocumentType
-> Maybe Text
-> Maybe [AttachmentContent]
-> Maybe ReviewStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe DocumentFormat
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty DocumentRequires)
-> Int
-> GetDocumentResponse
GetDocumentResponse'
            (Maybe DocumentStatus
 -> Maybe DocumentType
 -> Maybe Text
 -> Maybe [AttachmentContent]
 -> Maybe ReviewStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe DocumentFormat
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty DocumentRequires)
 -> Int
 -> GetDocumentResponse)
-> Either String (Maybe DocumentStatus)
-> Either
     String
     (Maybe DocumentType
      -> Maybe Text
      -> Maybe [AttachmentContent]
      -> Maybe ReviewStatus
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe DocumentFormat
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DocumentStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe DocumentType
   -> Maybe Text
   -> Maybe [AttachmentContent]
   -> Maybe ReviewStatus
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe DocumentFormat
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe DocumentType)
-> Either
     String
     (Maybe Text
      -> Maybe [AttachmentContent]
      -> Maybe ReviewStatus
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe DocumentFormat
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DocumentType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DocumentType")
            Either
  String
  (Maybe Text
   -> Maybe [AttachmentContent]
   -> Maybe ReviewStatus
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe DocumentFormat
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [AttachmentContent]
      -> Maybe ReviewStatus
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe DocumentFormat
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
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
"VersionName")
            Either
  String
  (Maybe [AttachmentContent]
   -> Maybe ReviewStatus
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe DocumentFormat
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe [AttachmentContent])
-> Either
     String
     (Maybe ReviewStatus
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe DocumentFormat
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [AttachmentContent]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AttachmentsContent"
                            Either String (Maybe (Maybe [AttachmentContent]))
-> Maybe [AttachmentContent]
-> Either String (Maybe [AttachmentContent])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AttachmentContent]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe ReviewStatus
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe DocumentFormat
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe ReviewStatus)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe DocumentFormat
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ReviewStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReviewStatus")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe DocumentFormat
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe DocumentFormat
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
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
"Content")
            Either
  String
  (Maybe POSIX
   -> Maybe DocumentFormat
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe DocumentFormat
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
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
"CreatedDate")
            Either
  String
  (Maybe DocumentFormat
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe DocumentFormat)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DocumentFormat)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DocumentFormat")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
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
"Name")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DocumentRequires)
      -> Int
      -> GetDocumentResponse)
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
"DocumentVersion")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DocumentRequires)
   -> Int
   -> GetDocumentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (NonEmpty DocumentRequires) -> Int -> GetDocumentResponse)
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
"DisplayName")
            Either
  String
  (Maybe Text
   -> Maybe (NonEmpty DocumentRequires) -> Int -> GetDocumentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty DocumentRequires) -> Int -> GetDocumentResponse)
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
"StatusInformation")
            Either
  String
  (Maybe (NonEmpty DocumentRequires) -> Int -> GetDocumentResponse)
-> Either String (Maybe (NonEmpty DocumentRequires))
-> Either String (Int -> GetDocumentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (NonEmpty DocumentRequires))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Requires")
            Either String (Int -> GetDocumentResponse)
-> Either String Int -> Either String GetDocumentResponse
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 GetDocument

instance Prelude.NFData GetDocument

instance Core.ToHeaders GetDocument where
  toHeaders :: GetDocument -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetDocument -> 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.GetDocument" :: 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 GetDocument where
  toJSON :: GetDocument -> Value
toJSON GetDocument' {Maybe Text
Maybe DocumentFormat
Text
name :: Text
documentVersion :: Maybe Text
documentFormat :: Maybe DocumentFormat
versionName :: Maybe Text
$sel:name:GetDocument' :: GetDocument -> Text
$sel:documentVersion:GetDocument' :: GetDocument -> Maybe Text
$sel:documentFormat:GetDocument' :: GetDocument -> Maybe DocumentFormat
$sel:versionName:GetDocument' :: GetDocument -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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
"DocumentVersion" 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
documentVersion,
            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 GetDocument where
  toPath :: GetDocument -> ByteString
toPath = ByteString -> GetDocument -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetDocumentResponse' smart constructor.
data GetDocumentResponse = GetDocumentResponse'
  { -- | The status of the SSM document, such as @Creating@, @Active@,
    -- @Updating@, @Failed@, and @Deleting@.
    GetDocumentResponse -> Maybe DocumentStatus
status :: Prelude.Maybe DocumentStatus,
    -- | The document type.
    GetDocumentResponse -> Maybe DocumentType
documentType :: Prelude.Maybe DocumentType,
    -- | The version of the artifact associated with the document. For example,
    -- \"Release 12, Update 6\". This value is unique across all versions of a
    -- document, and can\'t be changed.
    GetDocumentResponse -> Maybe Text
versionName :: Prelude.Maybe Prelude.Text,
    -- | A description of the document attachments, including names, locations,
    -- sizes, and so on.
    GetDocumentResponse -> Maybe [AttachmentContent]
attachmentsContent :: Prelude.Maybe [AttachmentContent],
    -- | The current review status of a new custom Systems Manager document (SSM
    -- document) created by a member of your organization, or of the latest
    -- version of an existing SSM document.
    --
    -- Only one version of an SSM document can be in the APPROVED state at a
    -- time. When a new version is approved, the status of the previous version
    -- changes to REJECTED.
    --
    -- Only one version of an SSM document can be in review, or PENDING, at a
    -- time.
    GetDocumentResponse -> Maybe ReviewStatus
reviewStatus :: Prelude.Maybe ReviewStatus,
    -- | The contents of the SSM document.
    GetDocumentResponse -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
    -- | The date the SSM document was created.
    GetDocumentResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The document format, either JSON or YAML.
    GetDocumentResponse -> Maybe DocumentFormat
documentFormat :: Prelude.Maybe DocumentFormat,
    -- | The name of the SSM document.
    GetDocumentResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The document version.
    GetDocumentResponse -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | The friendly name of the SSM document. This value can differ for each
    -- version of the document. If you want to update this value, see
    -- UpdateDocument.
    GetDocumentResponse -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | A message returned by Amazon Web Services Systems Manager that explains
    -- the @Status@ value. For example, a @Failed@ status might be explained by
    -- the @StatusInformation@ message, \"The specified S3 bucket doesn\'t
    -- exist. Verify that the URL of the S3 bucket is correct.\"
    GetDocumentResponse -> Maybe Text
statusInformation :: Prelude.Maybe Prelude.Text,
    -- | A list of SSM documents required by a document. For example, an
    -- @ApplicationConfiguration@ document requires an
    -- @ApplicationConfigurationSchema@ document.
    GetDocumentResponse -> Maybe (NonEmpty DocumentRequires)
requires :: Prelude.Maybe (Prelude.NonEmpty DocumentRequires),
    -- | The response's http status code.
    GetDocumentResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDocumentResponse -> GetDocumentResponse -> Bool
(GetDocumentResponse -> GetDocumentResponse -> Bool)
-> (GetDocumentResponse -> GetDocumentResponse -> Bool)
-> Eq GetDocumentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDocumentResponse -> GetDocumentResponse -> Bool
$c/= :: GetDocumentResponse -> GetDocumentResponse -> Bool
== :: GetDocumentResponse -> GetDocumentResponse -> Bool
$c== :: GetDocumentResponse -> GetDocumentResponse -> Bool
Prelude.Eq, ReadPrec [GetDocumentResponse]
ReadPrec GetDocumentResponse
Int -> ReadS GetDocumentResponse
ReadS [GetDocumentResponse]
(Int -> ReadS GetDocumentResponse)
-> ReadS [GetDocumentResponse]
-> ReadPrec GetDocumentResponse
-> ReadPrec [GetDocumentResponse]
-> Read GetDocumentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDocumentResponse]
$creadListPrec :: ReadPrec [GetDocumentResponse]
readPrec :: ReadPrec GetDocumentResponse
$creadPrec :: ReadPrec GetDocumentResponse
readList :: ReadS [GetDocumentResponse]
$creadList :: ReadS [GetDocumentResponse]
readsPrec :: Int -> ReadS GetDocumentResponse
$creadsPrec :: Int -> ReadS GetDocumentResponse
Prelude.Read, Int -> GetDocumentResponse -> ShowS
[GetDocumentResponse] -> ShowS
GetDocumentResponse -> String
(Int -> GetDocumentResponse -> ShowS)
-> (GetDocumentResponse -> String)
-> ([GetDocumentResponse] -> ShowS)
-> Show GetDocumentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDocumentResponse] -> ShowS
$cshowList :: [GetDocumentResponse] -> ShowS
show :: GetDocumentResponse -> String
$cshow :: GetDocumentResponse -> String
showsPrec :: Int -> GetDocumentResponse -> ShowS
$cshowsPrec :: Int -> GetDocumentResponse -> ShowS
Prelude.Show, (forall x. GetDocumentResponse -> Rep GetDocumentResponse x)
-> (forall x. Rep GetDocumentResponse x -> GetDocumentResponse)
-> Generic GetDocumentResponse
forall x. Rep GetDocumentResponse x -> GetDocumentResponse
forall x. GetDocumentResponse -> Rep GetDocumentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDocumentResponse x -> GetDocumentResponse
$cfrom :: forall x. GetDocumentResponse -> Rep GetDocumentResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDocumentResponse' 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:
--
-- 'status', 'getDocumentResponse_status' - The status of the SSM document, such as @Creating@, @Active@,
-- @Updating@, @Failed@, and @Deleting@.
--
-- 'documentType', 'getDocumentResponse_documentType' - The document type.
--
-- 'versionName', 'getDocumentResponse_versionName' - The version of the artifact associated with the document. For example,
-- \"Release 12, Update 6\". This value is unique across all versions of a
-- document, and can\'t be changed.
--
-- 'attachmentsContent', 'getDocumentResponse_attachmentsContent' - A description of the document attachments, including names, locations,
-- sizes, and so on.
--
-- 'reviewStatus', 'getDocumentResponse_reviewStatus' - The current review status of a new custom Systems Manager document (SSM
-- document) created by a member of your organization, or of the latest
-- version of an existing SSM document.
--
-- Only one version of an SSM document can be in the APPROVED state at a
-- time. When a new version is approved, the status of the previous version
-- changes to REJECTED.
--
-- Only one version of an SSM document can be in review, or PENDING, at a
-- time.
--
-- 'content', 'getDocumentResponse_content' - The contents of the SSM document.
--
-- 'createdDate', 'getDocumentResponse_createdDate' - The date the SSM document was created.
--
-- 'documentFormat', 'getDocumentResponse_documentFormat' - The document format, either JSON or YAML.
--
-- 'name', 'getDocumentResponse_name' - The name of the SSM document.
--
-- 'documentVersion', 'getDocumentResponse_documentVersion' - The document version.
--
-- 'displayName', 'getDocumentResponse_displayName' - The friendly name of the SSM document. This value can differ for each
-- version of the document. If you want to update this value, see
-- UpdateDocument.
--
-- 'statusInformation', 'getDocumentResponse_statusInformation' - A message returned by Amazon Web Services Systems Manager that explains
-- the @Status@ value. For example, a @Failed@ status might be explained by
-- the @StatusInformation@ message, \"The specified S3 bucket doesn\'t
-- exist. Verify that the URL of the S3 bucket is correct.\"
--
-- 'requires', 'getDocumentResponse_requires' - A list of SSM documents required by a document. For example, an
-- @ApplicationConfiguration@ document requires an
-- @ApplicationConfigurationSchema@ document.
--
-- 'httpStatus', 'getDocumentResponse_httpStatus' - The response's http status code.
newGetDocumentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDocumentResponse
newGetDocumentResponse :: Int -> GetDocumentResponse
newGetDocumentResponse Int
pHttpStatus_ =
  GetDocumentResponse' :: Maybe DocumentStatus
-> Maybe DocumentType
-> Maybe Text
-> Maybe [AttachmentContent]
-> Maybe ReviewStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe DocumentFormat
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty DocumentRequires)
-> Int
-> GetDocumentResponse
GetDocumentResponse'
    { $sel:status:GetDocumentResponse' :: Maybe DocumentStatus
status = Maybe DocumentStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:documentType:GetDocumentResponse' :: Maybe DocumentType
documentType = Maybe DocumentType
forall a. Maybe a
Prelude.Nothing,
      $sel:versionName:GetDocumentResponse' :: Maybe Text
versionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentsContent:GetDocumentResponse' :: Maybe [AttachmentContent]
attachmentsContent = Maybe [AttachmentContent]
forall a. Maybe a
Prelude.Nothing,
      $sel:reviewStatus:GetDocumentResponse' :: Maybe ReviewStatus
reviewStatus = Maybe ReviewStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:content:GetDocumentResponse' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:GetDocumentResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:documentFormat:GetDocumentResponse' :: Maybe DocumentFormat
documentFormat = Maybe DocumentFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetDocumentResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:documentVersion:GetDocumentResponse' :: Maybe Text
documentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:GetDocumentResponse' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusInformation:GetDocumentResponse' :: Maybe Text
statusInformation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requires:GetDocumentResponse' :: Maybe (NonEmpty DocumentRequires)
requires = Maybe (NonEmpty DocumentRequires)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDocumentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the SSM document, such as @Creating@, @Active@,
-- @Updating@, @Failed@, and @Deleting@.
getDocumentResponse_status :: Lens.Lens' GetDocumentResponse (Prelude.Maybe DocumentStatus)
getDocumentResponse_status :: (Maybe DocumentStatus -> f (Maybe DocumentStatus))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_status = (GetDocumentResponse -> Maybe DocumentStatus)
-> (GetDocumentResponse
    -> Maybe DocumentStatus -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (Maybe DocumentStatus)
     (Maybe DocumentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe DocumentStatus
status :: Maybe DocumentStatus
$sel:status:GetDocumentResponse' :: GetDocumentResponse -> Maybe DocumentStatus
status} -> Maybe DocumentStatus
status) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe DocumentStatus
a -> GetDocumentResponse
s {$sel:status:GetDocumentResponse' :: Maybe DocumentStatus
status = Maybe DocumentStatus
a} :: GetDocumentResponse)

-- | The document type.
getDocumentResponse_documentType :: Lens.Lens' GetDocumentResponse (Prelude.Maybe DocumentType)
getDocumentResponse_documentType :: (Maybe DocumentType -> f (Maybe DocumentType))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_documentType = (GetDocumentResponse -> Maybe DocumentType)
-> (GetDocumentResponse
    -> Maybe DocumentType -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (Maybe DocumentType)
     (Maybe DocumentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe DocumentType
documentType :: Maybe DocumentType
$sel:documentType:GetDocumentResponse' :: GetDocumentResponse -> Maybe DocumentType
documentType} -> Maybe DocumentType
documentType) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe DocumentType
a -> GetDocumentResponse
s {$sel:documentType:GetDocumentResponse' :: Maybe DocumentType
documentType = Maybe DocumentType
a} :: GetDocumentResponse)

-- | The version of the artifact associated with the document. For example,
-- \"Release 12, Update 6\". This value is unique across all versions of a
-- document, and can\'t be changed.
getDocumentResponse_versionName :: Lens.Lens' GetDocumentResponse (Prelude.Maybe Prelude.Text)
getDocumentResponse_versionName :: (Maybe Text -> f (Maybe Text))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_versionName = (GetDocumentResponse -> Maybe Text)
-> (GetDocumentResponse -> Maybe Text -> GetDocumentResponse)
-> Lens
     GetDocumentResponse GetDocumentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe Text
versionName :: Maybe Text
$sel:versionName:GetDocumentResponse' :: GetDocumentResponse -> Maybe Text
versionName} -> Maybe Text
versionName) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe Text
a -> GetDocumentResponse
s {$sel:versionName:GetDocumentResponse' :: Maybe Text
versionName = Maybe Text
a} :: GetDocumentResponse)

-- | A description of the document attachments, including names, locations,
-- sizes, and so on.
getDocumentResponse_attachmentsContent :: Lens.Lens' GetDocumentResponse (Prelude.Maybe [AttachmentContent])
getDocumentResponse_attachmentsContent :: (Maybe [AttachmentContent] -> f (Maybe [AttachmentContent]))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_attachmentsContent = (GetDocumentResponse -> Maybe [AttachmentContent])
-> (GetDocumentResponse
    -> Maybe [AttachmentContent] -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (Maybe [AttachmentContent])
     (Maybe [AttachmentContent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe [AttachmentContent]
attachmentsContent :: Maybe [AttachmentContent]
$sel:attachmentsContent:GetDocumentResponse' :: GetDocumentResponse -> Maybe [AttachmentContent]
attachmentsContent} -> Maybe [AttachmentContent]
attachmentsContent) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe [AttachmentContent]
a -> GetDocumentResponse
s {$sel:attachmentsContent:GetDocumentResponse' :: Maybe [AttachmentContent]
attachmentsContent = Maybe [AttachmentContent]
a} :: GetDocumentResponse) ((Maybe [AttachmentContent] -> f (Maybe [AttachmentContent]))
 -> GetDocumentResponse -> f GetDocumentResponse)
-> ((Maybe [AttachmentContent] -> f (Maybe [AttachmentContent]))
    -> Maybe [AttachmentContent] -> f (Maybe [AttachmentContent]))
-> (Maybe [AttachmentContent] -> f (Maybe [AttachmentContent]))
-> GetDocumentResponse
-> f GetDocumentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttachmentContent]
  [AttachmentContent]
  [AttachmentContent]
  [AttachmentContent]
-> Iso
     (Maybe [AttachmentContent])
     (Maybe [AttachmentContent])
     (Maybe [AttachmentContent])
     (Maybe [AttachmentContent])
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
  [AttachmentContent]
  [AttachmentContent]
  [AttachmentContent]
  [AttachmentContent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The current review status of a new custom Systems Manager document (SSM
-- document) created by a member of your organization, or of the latest
-- version of an existing SSM document.
--
-- Only one version of an SSM document can be in the APPROVED state at a
-- time. When a new version is approved, the status of the previous version
-- changes to REJECTED.
--
-- Only one version of an SSM document can be in review, or PENDING, at a
-- time.
getDocumentResponse_reviewStatus :: Lens.Lens' GetDocumentResponse (Prelude.Maybe ReviewStatus)
getDocumentResponse_reviewStatus :: (Maybe ReviewStatus -> f (Maybe ReviewStatus))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_reviewStatus = (GetDocumentResponse -> Maybe ReviewStatus)
-> (GetDocumentResponse
    -> Maybe ReviewStatus -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (Maybe ReviewStatus)
     (Maybe ReviewStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe ReviewStatus
reviewStatus :: Maybe ReviewStatus
$sel:reviewStatus:GetDocumentResponse' :: GetDocumentResponse -> Maybe ReviewStatus
reviewStatus} -> Maybe ReviewStatus
reviewStatus) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe ReviewStatus
a -> GetDocumentResponse
s {$sel:reviewStatus:GetDocumentResponse' :: Maybe ReviewStatus
reviewStatus = Maybe ReviewStatus
a} :: GetDocumentResponse)

-- | The contents of the SSM document.
getDocumentResponse_content :: Lens.Lens' GetDocumentResponse (Prelude.Maybe Prelude.Text)
getDocumentResponse_content :: (Maybe Text -> f (Maybe Text))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_content = (GetDocumentResponse -> Maybe Text)
-> (GetDocumentResponse -> Maybe Text -> GetDocumentResponse)
-> Lens
     GetDocumentResponse GetDocumentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe Text
content :: Maybe Text
$sel:content:GetDocumentResponse' :: GetDocumentResponse -> Maybe Text
content} -> Maybe Text
content) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe Text
a -> GetDocumentResponse
s {$sel:content:GetDocumentResponse' :: Maybe Text
content = Maybe Text
a} :: GetDocumentResponse)

-- | The date the SSM document was created.
getDocumentResponse_createdDate :: Lens.Lens' GetDocumentResponse (Prelude.Maybe Prelude.UTCTime)
getDocumentResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_createdDate = (GetDocumentResponse -> Maybe POSIX)
-> (GetDocumentResponse -> Maybe POSIX -> GetDocumentResponse)
-> Lens
     GetDocumentResponse GetDocumentResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:GetDocumentResponse' :: GetDocumentResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe POSIX
a -> GetDocumentResponse
s {$sel:createdDate:GetDocumentResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: GetDocumentResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetDocumentResponse -> f GetDocumentResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetDocumentResponse
-> f GetDocumentResponse
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 document format, either JSON or YAML.
getDocumentResponse_documentFormat :: Lens.Lens' GetDocumentResponse (Prelude.Maybe DocumentFormat)
getDocumentResponse_documentFormat :: (Maybe DocumentFormat -> f (Maybe DocumentFormat))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_documentFormat = (GetDocumentResponse -> Maybe DocumentFormat)
-> (GetDocumentResponse
    -> Maybe DocumentFormat -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (Maybe DocumentFormat)
     (Maybe DocumentFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe DocumentFormat
documentFormat :: Maybe DocumentFormat
$sel:documentFormat:GetDocumentResponse' :: GetDocumentResponse -> Maybe DocumentFormat
documentFormat} -> Maybe DocumentFormat
documentFormat) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe DocumentFormat
a -> GetDocumentResponse
s {$sel:documentFormat:GetDocumentResponse' :: Maybe DocumentFormat
documentFormat = Maybe DocumentFormat
a} :: GetDocumentResponse)

-- | The name of the SSM document.
getDocumentResponse_name :: Lens.Lens' GetDocumentResponse (Prelude.Maybe Prelude.Text)
getDocumentResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_name = (GetDocumentResponse -> Maybe Text)
-> (GetDocumentResponse -> Maybe Text -> GetDocumentResponse)
-> Lens
     GetDocumentResponse GetDocumentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetDocumentResponse' :: GetDocumentResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe Text
a -> GetDocumentResponse
s {$sel:name:GetDocumentResponse' :: Maybe Text
name = Maybe Text
a} :: GetDocumentResponse)

-- | The document version.
getDocumentResponse_documentVersion :: Lens.Lens' GetDocumentResponse (Prelude.Maybe Prelude.Text)
getDocumentResponse_documentVersion :: (Maybe Text -> f (Maybe Text))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_documentVersion = (GetDocumentResponse -> Maybe Text)
-> (GetDocumentResponse -> Maybe Text -> GetDocumentResponse)
-> Lens
     GetDocumentResponse GetDocumentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:GetDocumentResponse' :: GetDocumentResponse -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe Text
a -> GetDocumentResponse
s {$sel:documentVersion:GetDocumentResponse' :: Maybe Text
documentVersion = Maybe Text
a} :: GetDocumentResponse)

-- | The friendly name of the SSM document. This value can differ for each
-- version of the document. If you want to update this value, see
-- UpdateDocument.
getDocumentResponse_displayName :: Lens.Lens' GetDocumentResponse (Prelude.Maybe Prelude.Text)
getDocumentResponse_displayName :: (Maybe Text -> f (Maybe Text))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_displayName = (GetDocumentResponse -> Maybe Text)
-> (GetDocumentResponse -> Maybe Text -> GetDocumentResponse)
-> Lens
     GetDocumentResponse GetDocumentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe Text
displayName :: Maybe Text
$sel:displayName:GetDocumentResponse' :: GetDocumentResponse -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe Text
a -> GetDocumentResponse
s {$sel:displayName:GetDocumentResponse' :: Maybe Text
displayName = Maybe Text
a} :: GetDocumentResponse)

-- | A message returned by Amazon Web Services Systems Manager that explains
-- the @Status@ value. For example, a @Failed@ status might be explained by
-- the @StatusInformation@ message, \"The specified S3 bucket doesn\'t
-- exist. Verify that the URL of the S3 bucket is correct.\"
getDocumentResponse_statusInformation :: Lens.Lens' GetDocumentResponse (Prelude.Maybe Prelude.Text)
getDocumentResponse_statusInformation :: (Maybe Text -> f (Maybe Text))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_statusInformation = (GetDocumentResponse -> Maybe Text)
-> (GetDocumentResponse -> Maybe Text -> GetDocumentResponse)
-> Lens
     GetDocumentResponse GetDocumentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe Text
statusInformation :: Maybe Text
$sel:statusInformation:GetDocumentResponse' :: GetDocumentResponse -> Maybe Text
statusInformation} -> Maybe Text
statusInformation) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe Text
a -> GetDocumentResponse
s {$sel:statusInformation:GetDocumentResponse' :: Maybe Text
statusInformation = Maybe Text
a} :: GetDocumentResponse)

-- | A list of SSM documents required by a document. For example, an
-- @ApplicationConfiguration@ document requires an
-- @ApplicationConfigurationSchema@ document.
getDocumentResponse_requires :: Lens.Lens' GetDocumentResponse (Prelude.Maybe (Prelude.NonEmpty DocumentRequires))
getDocumentResponse_requires :: (Maybe (NonEmpty DocumentRequires)
 -> f (Maybe (NonEmpty DocumentRequires)))
-> GetDocumentResponse -> f GetDocumentResponse
getDocumentResponse_requires = (GetDocumentResponse -> Maybe (NonEmpty DocumentRequires))
-> (GetDocumentResponse
    -> Maybe (NonEmpty DocumentRequires) -> GetDocumentResponse)
-> Lens
     GetDocumentResponse
     GetDocumentResponse
     (Maybe (NonEmpty DocumentRequires))
     (Maybe (NonEmpty DocumentRequires))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDocumentResponse' {Maybe (NonEmpty DocumentRequires)
requires :: Maybe (NonEmpty DocumentRequires)
$sel:requires:GetDocumentResponse' :: GetDocumentResponse -> Maybe (NonEmpty DocumentRequires)
requires} -> Maybe (NonEmpty DocumentRequires)
requires) (\s :: GetDocumentResponse
s@GetDocumentResponse' {} Maybe (NonEmpty DocumentRequires)
a -> GetDocumentResponse
s {$sel:requires:GetDocumentResponse' :: Maybe (NonEmpty DocumentRequires)
requires = Maybe (NonEmpty DocumentRequires)
a} :: GetDocumentResponse) ((Maybe (NonEmpty DocumentRequires)
  -> f (Maybe (NonEmpty DocumentRequires)))
 -> GetDocumentResponse -> f GetDocumentResponse)
-> ((Maybe (NonEmpty DocumentRequires)
     -> f (Maybe (NonEmpty DocumentRequires)))
    -> Maybe (NonEmpty DocumentRequires)
    -> f (Maybe (NonEmpty DocumentRequires)))
-> (Maybe (NonEmpty DocumentRequires)
    -> f (Maybe (NonEmpty DocumentRequires)))
-> GetDocumentResponse
-> f GetDocumentResponse
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

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

instance Prelude.NFData GetDocumentResponse