{-# 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.DataExchange.GetRevision
-- 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)
--
-- This operation returns information about a revision.
module Amazonka.DataExchange.GetRevision
  ( -- * Creating a Request
    GetRevision (..),
    newGetRevision,

    -- * Request Lenses
    getRevision_revisionId,
    getRevision_dataSetId,

    -- * Destructuring the Response
    GetRevisionResponse (..),
    newGetRevisionResponse,

    -- * Response Lenses
    getRevisionResponse_arn,
    getRevisionResponse_createdAt,
    getRevisionResponse_sourceId,
    getRevisionResponse_finalized,
    getRevisionResponse_dataSetId,
    getRevisionResponse_id,
    getRevisionResponse_updatedAt,
    getRevisionResponse_comment,
    getRevisionResponse_tags,
    getRevisionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataExchange.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetRevision' smart constructor.
data GetRevision = GetRevision'
  { -- | The unique identifier for a revision.
    GetRevision -> Text
revisionId :: Prelude.Text,
    -- | The unique identifier for a data set.
    GetRevision -> Text
dataSetId :: Prelude.Text
  }
  deriving (GetRevision -> GetRevision -> Bool
(GetRevision -> GetRevision -> Bool)
-> (GetRevision -> GetRevision -> Bool) -> Eq GetRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRevision -> GetRevision -> Bool
$c/= :: GetRevision -> GetRevision -> Bool
== :: GetRevision -> GetRevision -> Bool
$c== :: GetRevision -> GetRevision -> Bool
Prelude.Eq, ReadPrec [GetRevision]
ReadPrec GetRevision
Int -> ReadS GetRevision
ReadS [GetRevision]
(Int -> ReadS GetRevision)
-> ReadS [GetRevision]
-> ReadPrec GetRevision
-> ReadPrec [GetRevision]
-> Read GetRevision
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRevision]
$creadListPrec :: ReadPrec [GetRevision]
readPrec :: ReadPrec GetRevision
$creadPrec :: ReadPrec GetRevision
readList :: ReadS [GetRevision]
$creadList :: ReadS [GetRevision]
readsPrec :: Int -> ReadS GetRevision
$creadsPrec :: Int -> ReadS GetRevision
Prelude.Read, Int -> GetRevision -> ShowS
[GetRevision] -> ShowS
GetRevision -> String
(Int -> GetRevision -> ShowS)
-> (GetRevision -> String)
-> ([GetRevision] -> ShowS)
-> Show GetRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRevision] -> ShowS
$cshowList :: [GetRevision] -> ShowS
show :: GetRevision -> String
$cshow :: GetRevision -> String
showsPrec :: Int -> GetRevision -> ShowS
$cshowsPrec :: Int -> GetRevision -> ShowS
Prelude.Show, (forall x. GetRevision -> Rep GetRevision x)
-> (forall x. Rep GetRevision x -> GetRevision)
-> Generic GetRevision
forall x. Rep GetRevision x -> GetRevision
forall x. GetRevision -> Rep GetRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRevision x -> GetRevision
$cfrom :: forall x. GetRevision -> Rep GetRevision x
Prelude.Generic)

-- |
-- Create a value of 'GetRevision' 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:
--
-- 'revisionId', 'getRevision_revisionId' - The unique identifier for a revision.
--
-- 'dataSetId', 'getRevision_dataSetId' - The unique identifier for a data set.
newGetRevision ::
  -- | 'revisionId'
  Prelude.Text ->
  -- | 'dataSetId'
  Prelude.Text ->
  GetRevision
newGetRevision :: Text -> Text -> GetRevision
newGetRevision Text
pRevisionId_ Text
pDataSetId_ =
  GetRevision' :: Text -> Text -> GetRevision
GetRevision'
    { $sel:revisionId:GetRevision' :: Text
revisionId = Text
pRevisionId_,
      $sel:dataSetId:GetRevision' :: Text
dataSetId = Text
pDataSetId_
    }

-- | The unique identifier for a revision.
getRevision_revisionId :: Lens.Lens' GetRevision Prelude.Text
getRevision_revisionId :: (Text -> f Text) -> GetRevision -> f GetRevision
getRevision_revisionId = (GetRevision -> Text)
-> (GetRevision -> Text -> GetRevision)
-> Lens GetRevision GetRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevision' {Text
revisionId :: Text
$sel:revisionId:GetRevision' :: GetRevision -> Text
revisionId} -> Text
revisionId) (\s :: GetRevision
s@GetRevision' {} Text
a -> GetRevision
s {$sel:revisionId:GetRevision' :: Text
revisionId = Text
a} :: GetRevision)

-- | The unique identifier for a data set.
getRevision_dataSetId :: Lens.Lens' GetRevision Prelude.Text
getRevision_dataSetId :: (Text -> f Text) -> GetRevision -> f GetRevision
getRevision_dataSetId = (GetRevision -> Text)
-> (GetRevision -> Text -> GetRevision)
-> Lens GetRevision GetRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevision' {Text
dataSetId :: Text
$sel:dataSetId:GetRevision' :: GetRevision -> Text
dataSetId} -> Text
dataSetId) (\s :: GetRevision
s@GetRevision' {} Text
a -> GetRevision
s {$sel:dataSetId:GetRevision' :: Text
dataSetId = Text
a} :: GetRevision)

instance Core.AWSRequest GetRevision where
  type AWSResponse GetRevision = GetRevisionResponse
  request :: GetRevision -> Request GetRevision
request = Service -> GetRevision -> Request GetRevision
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetRevision
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetRevision)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetRevision))
-> Logger
-> Service
-> Proxy GetRevision
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetRevision)))
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 POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> GetRevisionResponse
GetRevisionResponse'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> GetRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetRevisionResponse)
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
"Arn")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetRevisionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetRevisionResponse)
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
"CreatedAt")
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetRevisionResponse)
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
"SourceId")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetRevisionResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetRevisionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Finalized")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetRevisionResponse)
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
"DataSetId")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> GetRevisionResponse)
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
"Id")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> GetRevisionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text) -> Int -> GetRevisionResponse)
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
"UpdatedAt")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text) -> Int -> GetRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> GetRevisionResponse)
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
"Comment")
            Either
  String (Maybe (HashMap Text Text) -> Int -> GetRevisionResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> GetRevisionResponse)
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 -> GetRevisionResponse)
-> Either String Int -> Either String GetRevisionResponse
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 GetRevision

instance Prelude.NFData GetRevision

instance Core.ToHeaders GetRevision where
  toHeaders :: GetRevision -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetRevision -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetRevision where
  toPath :: GetRevision -> ByteString
toPath GetRevision' {Text
dataSetId :: Text
revisionId :: Text
$sel:dataSetId:GetRevision' :: GetRevision -> Text
$sel:revisionId:GetRevision' :: GetRevision -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/data-sets/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dataSetId,
        ByteString
"/revisions/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
revisionId
      ]

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

-- | /See:/ 'newGetRevisionResponse' smart constructor.
data GetRevisionResponse = GetRevisionResponse'
  { -- | The ARN for the revision.
    GetRevisionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the revision was created, in ISO 8601 format.
    GetRevisionResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The revision ID of the owned revision corresponding to the entitled
    -- revision being viewed. This parameter is returned when a revision owner
    -- is viewing the entitled copy of its owned revision.
    GetRevisionResponse -> Maybe Text
sourceId :: Prelude.Maybe Prelude.Text,
    -- | To publish a revision to a data set in a product, the revision must
    -- first be finalized. Finalizing a revision tells AWS Data Exchange that
    -- your changes to the assets in the revision are complete. After it\'s in
    -- this read-only state, you can publish the revision to your products.
    --
    -- Finalized revisions can be published through the AWS Data Exchange
    -- console or the AWS Marketplace Catalog API, using the StartChangeSet AWS
    -- Marketplace Catalog API action. When using the API, revisions are
    -- uniquely identified by their ARN.
    GetRevisionResponse -> Maybe Bool
finalized :: Prelude.Maybe Prelude.Bool,
    -- | The unique identifier for the data set associated with this revision.
    GetRevisionResponse -> Maybe Text
dataSetId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the revision.
    GetRevisionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the revision was last updated, in ISO 8601
    -- format.
    GetRevisionResponse -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | An optional comment about the revision.
    GetRevisionResponse -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The tags for the revision.
    GetRevisionResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    GetRevisionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRevisionResponse -> GetRevisionResponse -> Bool
(GetRevisionResponse -> GetRevisionResponse -> Bool)
-> (GetRevisionResponse -> GetRevisionResponse -> Bool)
-> Eq GetRevisionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRevisionResponse -> GetRevisionResponse -> Bool
$c/= :: GetRevisionResponse -> GetRevisionResponse -> Bool
== :: GetRevisionResponse -> GetRevisionResponse -> Bool
$c== :: GetRevisionResponse -> GetRevisionResponse -> Bool
Prelude.Eq, ReadPrec [GetRevisionResponse]
ReadPrec GetRevisionResponse
Int -> ReadS GetRevisionResponse
ReadS [GetRevisionResponse]
(Int -> ReadS GetRevisionResponse)
-> ReadS [GetRevisionResponse]
-> ReadPrec GetRevisionResponse
-> ReadPrec [GetRevisionResponse]
-> Read GetRevisionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRevisionResponse]
$creadListPrec :: ReadPrec [GetRevisionResponse]
readPrec :: ReadPrec GetRevisionResponse
$creadPrec :: ReadPrec GetRevisionResponse
readList :: ReadS [GetRevisionResponse]
$creadList :: ReadS [GetRevisionResponse]
readsPrec :: Int -> ReadS GetRevisionResponse
$creadsPrec :: Int -> ReadS GetRevisionResponse
Prelude.Read, Int -> GetRevisionResponse -> ShowS
[GetRevisionResponse] -> ShowS
GetRevisionResponse -> String
(Int -> GetRevisionResponse -> ShowS)
-> (GetRevisionResponse -> String)
-> ([GetRevisionResponse] -> ShowS)
-> Show GetRevisionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRevisionResponse] -> ShowS
$cshowList :: [GetRevisionResponse] -> ShowS
show :: GetRevisionResponse -> String
$cshow :: GetRevisionResponse -> String
showsPrec :: Int -> GetRevisionResponse -> ShowS
$cshowsPrec :: Int -> GetRevisionResponse -> ShowS
Prelude.Show, (forall x. GetRevisionResponse -> Rep GetRevisionResponse x)
-> (forall x. Rep GetRevisionResponse x -> GetRevisionResponse)
-> Generic GetRevisionResponse
forall x. Rep GetRevisionResponse x -> GetRevisionResponse
forall x. GetRevisionResponse -> Rep GetRevisionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRevisionResponse x -> GetRevisionResponse
$cfrom :: forall x. GetRevisionResponse -> Rep GetRevisionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRevisionResponse' 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:
--
-- 'arn', 'getRevisionResponse_arn' - The ARN for the revision.
--
-- 'createdAt', 'getRevisionResponse_createdAt' - The date and time that the revision was created, in ISO 8601 format.
--
-- 'sourceId', 'getRevisionResponse_sourceId' - The revision ID of the owned revision corresponding to the entitled
-- revision being viewed. This parameter is returned when a revision owner
-- is viewing the entitled copy of its owned revision.
--
-- 'finalized', 'getRevisionResponse_finalized' - To publish a revision to a data set in a product, the revision must
-- first be finalized. Finalizing a revision tells AWS Data Exchange that
-- your changes to the assets in the revision are complete. After it\'s in
-- this read-only state, you can publish the revision to your products.
--
-- Finalized revisions can be published through the AWS Data Exchange
-- console or the AWS Marketplace Catalog API, using the StartChangeSet AWS
-- Marketplace Catalog API action. When using the API, revisions are
-- uniquely identified by their ARN.
--
-- 'dataSetId', 'getRevisionResponse_dataSetId' - The unique identifier for the data set associated with this revision.
--
-- 'id', 'getRevisionResponse_id' - The unique identifier for the revision.
--
-- 'updatedAt', 'getRevisionResponse_updatedAt' - The date and time that the revision was last updated, in ISO 8601
-- format.
--
-- 'comment', 'getRevisionResponse_comment' - An optional comment about the revision.
--
-- 'tags', 'getRevisionResponse_tags' - The tags for the revision.
--
-- 'httpStatus', 'getRevisionResponse_httpStatus' - The response's http status code.
newGetRevisionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRevisionResponse
newGetRevisionResponse :: Int -> GetRevisionResponse
newGetRevisionResponse Int
pHttpStatus_ =
  GetRevisionResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> GetRevisionResponse
GetRevisionResponse'
    { $sel:arn:GetRevisionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:GetRevisionResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceId:GetRevisionResponse' :: Maybe Text
sourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:finalized:GetRevisionResponse' :: Maybe Bool
finalized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetId:GetRevisionResponse' :: Maybe Text
dataSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetRevisionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:GetRevisionResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:GetRevisionResponse' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:GetRevisionResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRevisionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN for the revision.
getRevisionResponse_arn :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.Text)
getRevisionResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_arn = (GetRevisionResponse -> Maybe Text)
-> (GetRevisionResponse -> Maybe Text -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetRevisionResponse' :: GetRevisionResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe Text
a -> GetRevisionResponse
s {$sel:arn:GetRevisionResponse' :: Maybe Text
arn = Maybe Text
a} :: GetRevisionResponse)

-- | The date and time that the revision was created, in ISO 8601 format.
getRevisionResponse_createdAt :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.UTCTime)
getRevisionResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_createdAt = (GetRevisionResponse -> Maybe POSIX)
-> (GetRevisionResponse -> Maybe POSIX -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:GetRevisionResponse' :: GetRevisionResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe POSIX
a -> GetRevisionResponse
s {$sel:createdAt:GetRevisionResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: GetRevisionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetRevisionResponse -> f GetRevisionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetRevisionResponse
-> f GetRevisionResponse
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 revision ID of the owned revision corresponding to the entitled
-- revision being viewed. This parameter is returned when a revision owner
-- is viewing the entitled copy of its owned revision.
getRevisionResponse_sourceId :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.Text)
getRevisionResponse_sourceId :: (Maybe Text -> f (Maybe Text))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_sourceId = (GetRevisionResponse -> Maybe Text)
-> (GetRevisionResponse -> Maybe Text -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe Text
sourceId :: Maybe Text
$sel:sourceId:GetRevisionResponse' :: GetRevisionResponse -> Maybe Text
sourceId} -> Maybe Text
sourceId) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe Text
a -> GetRevisionResponse
s {$sel:sourceId:GetRevisionResponse' :: Maybe Text
sourceId = Maybe Text
a} :: GetRevisionResponse)

-- | To publish a revision to a data set in a product, the revision must
-- first be finalized. Finalizing a revision tells AWS Data Exchange that
-- your changes to the assets in the revision are complete. After it\'s in
-- this read-only state, you can publish the revision to your products.
--
-- Finalized revisions can be published through the AWS Data Exchange
-- console or the AWS Marketplace Catalog API, using the StartChangeSet AWS
-- Marketplace Catalog API action. When using the API, revisions are
-- uniquely identified by their ARN.
getRevisionResponse_finalized :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.Bool)
getRevisionResponse_finalized :: (Maybe Bool -> f (Maybe Bool))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_finalized = (GetRevisionResponse -> Maybe Bool)
-> (GetRevisionResponse -> Maybe Bool -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe Bool
finalized :: Maybe Bool
$sel:finalized:GetRevisionResponse' :: GetRevisionResponse -> Maybe Bool
finalized} -> Maybe Bool
finalized) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe Bool
a -> GetRevisionResponse
s {$sel:finalized:GetRevisionResponse' :: Maybe Bool
finalized = Maybe Bool
a} :: GetRevisionResponse)

-- | The unique identifier for the data set associated with this revision.
getRevisionResponse_dataSetId :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.Text)
getRevisionResponse_dataSetId :: (Maybe Text -> f (Maybe Text))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_dataSetId = (GetRevisionResponse -> Maybe Text)
-> (GetRevisionResponse -> Maybe Text -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe Text
dataSetId :: Maybe Text
$sel:dataSetId:GetRevisionResponse' :: GetRevisionResponse -> Maybe Text
dataSetId} -> Maybe Text
dataSetId) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe Text
a -> GetRevisionResponse
s {$sel:dataSetId:GetRevisionResponse' :: Maybe Text
dataSetId = Maybe Text
a} :: GetRevisionResponse)

-- | The unique identifier for the revision.
getRevisionResponse_id :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.Text)
getRevisionResponse_id :: (Maybe Text -> f (Maybe Text))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_id = (GetRevisionResponse -> Maybe Text)
-> (GetRevisionResponse -> Maybe Text -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe Text
id :: Maybe Text
$sel:id:GetRevisionResponse' :: GetRevisionResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe Text
a -> GetRevisionResponse
s {$sel:id:GetRevisionResponse' :: Maybe Text
id = Maybe Text
a} :: GetRevisionResponse)

-- | The date and time that the revision was last updated, in ISO 8601
-- format.
getRevisionResponse_updatedAt :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.UTCTime)
getRevisionResponse_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_updatedAt = (GetRevisionResponse -> Maybe POSIX)
-> (GetRevisionResponse -> Maybe POSIX -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:GetRevisionResponse' :: GetRevisionResponse -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe POSIX
a -> GetRevisionResponse
s {$sel:updatedAt:GetRevisionResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: GetRevisionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetRevisionResponse -> f GetRevisionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetRevisionResponse
-> f GetRevisionResponse
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

-- | An optional comment about the revision.
getRevisionResponse_comment :: Lens.Lens' GetRevisionResponse (Prelude.Maybe Prelude.Text)
getRevisionResponse_comment :: (Maybe Text -> f (Maybe Text))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_comment = (GetRevisionResponse -> Maybe Text)
-> (GetRevisionResponse -> Maybe Text -> GetRevisionResponse)
-> Lens
     GetRevisionResponse GetRevisionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Maybe Text
comment :: Maybe Text
$sel:comment:GetRevisionResponse' :: GetRevisionResponse -> Maybe Text
comment} -> Maybe Text
comment) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe Text
a -> GetRevisionResponse
s {$sel:comment:GetRevisionResponse' :: Maybe Text
comment = Maybe Text
a} :: GetRevisionResponse)

-- | The tags for the revision.
getRevisionResponse_tags :: Lens.Lens' GetRevisionResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getRevisionResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_tags = (GetRevisionResponse -> Maybe (HashMap Text Text))
-> (GetRevisionResponse
    -> Maybe (HashMap Text Text) -> GetRevisionResponse)
-> Lens
     GetRevisionResponse
     GetRevisionResponse
     (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 (\GetRevisionResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:GetRevisionResponse' :: GetRevisionResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Maybe (HashMap Text Text)
a -> GetRevisionResponse
s {$sel:tags:GetRevisionResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: GetRevisionResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetRevisionResponse -> f GetRevisionResponse)
-> ((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)))
-> GetRevisionResponse
-> f GetRevisionResponse
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.
getRevisionResponse_httpStatus :: Lens.Lens' GetRevisionResponse Prelude.Int
getRevisionResponse_httpStatus :: (Int -> f Int) -> GetRevisionResponse -> f GetRevisionResponse
getRevisionResponse_httpStatus = (GetRevisionResponse -> Int)
-> (GetRevisionResponse -> Int -> GetRevisionResponse)
-> Lens GetRevisionResponse GetRevisionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRevisionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRevisionResponse' :: GetRevisionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRevisionResponse
s@GetRevisionResponse' {} Int
a -> GetRevisionResponse
s {$sel:httpStatus:GetRevisionResponse' :: Int
httpStatus = Int
a} :: GetRevisionResponse)

instance Prelude.NFData GetRevisionResponse