{-# 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.UpdateRevision
-- 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 updates a revision.
module Amazonka.DataExchange.UpdateRevision
  ( -- * Creating a Request
    UpdateRevision (..),
    newUpdateRevision,

    -- * Request Lenses
    updateRevision_finalized,
    updateRevision_comment,
    updateRevision_revisionId,
    updateRevision_dataSetId,

    -- * Destructuring the Response
    UpdateRevisionResponse (..),
    newUpdateRevisionResponse,

    -- * Response Lenses
    updateRevisionResponse_arn,
    updateRevisionResponse_createdAt,
    updateRevisionResponse_sourceId,
    updateRevisionResponse_finalized,
    updateRevisionResponse_dataSetId,
    updateRevisionResponse_id,
    updateRevisionResponse_updatedAt,
    updateRevisionResponse_comment,
    updateRevisionResponse_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

-- | The request body for UpdateRevision.
--
-- /See:/ 'newUpdateRevision' smart constructor.
data UpdateRevision = UpdateRevision'
  { -- | 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.
    UpdateRevision -> Maybe Bool
finalized :: Prelude.Maybe Prelude.Bool,
    -- | An optional comment about the revision.
    UpdateRevision -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for a revision.
    UpdateRevision -> Text
revisionId :: Prelude.Text,
    -- | The unique identifier for a data set.
    UpdateRevision -> Text
dataSetId :: Prelude.Text
  }
  deriving (UpdateRevision -> UpdateRevision -> Bool
(UpdateRevision -> UpdateRevision -> Bool)
-> (UpdateRevision -> UpdateRevision -> Bool) -> Eq UpdateRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRevision -> UpdateRevision -> Bool
$c/= :: UpdateRevision -> UpdateRevision -> Bool
== :: UpdateRevision -> UpdateRevision -> Bool
$c== :: UpdateRevision -> UpdateRevision -> Bool
Prelude.Eq, ReadPrec [UpdateRevision]
ReadPrec UpdateRevision
Int -> ReadS UpdateRevision
ReadS [UpdateRevision]
(Int -> ReadS UpdateRevision)
-> ReadS [UpdateRevision]
-> ReadPrec UpdateRevision
-> ReadPrec [UpdateRevision]
-> Read UpdateRevision
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRevision]
$creadListPrec :: ReadPrec [UpdateRevision]
readPrec :: ReadPrec UpdateRevision
$creadPrec :: ReadPrec UpdateRevision
readList :: ReadS [UpdateRevision]
$creadList :: ReadS [UpdateRevision]
readsPrec :: Int -> ReadS UpdateRevision
$creadsPrec :: Int -> ReadS UpdateRevision
Prelude.Read, Int -> UpdateRevision -> ShowS
[UpdateRevision] -> ShowS
UpdateRevision -> String
(Int -> UpdateRevision -> ShowS)
-> (UpdateRevision -> String)
-> ([UpdateRevision] -> ShowS)
-> Show UpdateRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRevision] -> ShowS
$cshowList :: [UpdateRevision] -> ShowS
show :: UpdateRevision -> String
$cshow :: UpdateRevision -> String
showsPrec :: Int -> UpdateRevision -> ShowS
$cshowsPrec :: Int -> UpdateRevision -> ShowS
Prelude.Show, (forall x. UpdateRevision -> Rep UpdateRevision x)
-> (forall x. Rep UpdateRevision x -> UpdateRevision)
-> Generic UpdateRevision
forall x. Rep UpdateRevision x -> UpdateRevision
forall x. UpdateRevision -> Rep UpdateRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRevision x -> UpdateRevision
$cfrom :: forall x. UpdateRevision -> Rep UpdateRevision x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRevision' 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:
--
-- 'finalized', 'updateRevision_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.
--
-- 'comment', 'updateRevision_comment' - An optional comment about the revision.
--
-- 'revisionId', 'updateRevision_revisionId' - The unique identifier for a revision.
--
-- 'dataSetId', 'updateRevision_dataSetId' - The unique identifier for a data set.
newUpdateRevision ::
  -- | 'revisionId'
  Prelude.Text ->
  -- | 'dataSetId'
  Prelude.Text ->
  UpdateRevision
newUpdateRevision :: Text -> Text -> UpdateRevision
newUpdateRevision Text
pRevisionId_ Text
pDataSetId_ =
  UpdateRevision' :: Maybe Bool -> Maybe Text -> Text -> Text -> UpdateRevision
UpdateRevision'
    { $sel:finalized:UpdateRevision' :: Maybe Bool
finalized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:UpdateRevision' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionId:UpdateRevision' :: Text
revisionId = Text
pRevisionId_,
      $sel:dataSetId:UpdateRevision' :: Text
dataSetId = Text
pDataSetId_
    }

-- | 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.
updateRevision_finalized :: Lens.Lens' UpdateRevision (Prelude.Maybe Prelude.Bool)
updateRevision_finalized :: (Maybe Bool -> f (Maybe Bool))
-> UpdateRevision -> f UpdateRevision
updateRevision_finalized = (UpdateRevision -> Maybe Bool)
-> (UpdateRevision -> Maybe Bool -> UpdateRevision)
-> Lens UpdateRevision UpdateRevision (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRevision' {Maybe Bool
finalized :: Maybe Bool
$sel:finalized:UpdateRevision' :: UpdateRevision -> Maybe Bool
finalized} -> Maybe Bool
finalized) (\s :: UpdateRevision
s@UpdateRevision' {} Maybe Bool
a -> UpdateRevision
s {$sel:finalized:UpdateRevision' :: Maybe Bool
finalized = Maybe Bool
a} :: UpdateRevision)

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

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

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

instance Core.AWSRequest UpdateRevision where
  type
    AWSResponse UpdateRevision =
      UpdateRevisionResponse
  request :: UpdateRevision -> Request UpdateRevision
request = Service -> UpdateRevision -> Request UpdateRevision
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateRevision
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRevision)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateRevision))
-> Logger
-> Service
-> Proxy UpdateRevision
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRevision)))
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
-> Int
-> UpdateRevisionResponse
UpdateRevisionResponse'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Int
 -> UpdateRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> UpdateRevisionResponse)
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
   -> Int
   -> UpdateRevisionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> UpdateRevisionResponse)
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
   -> Int
   -> UpdateRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> UpdateRevisionResponse)
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
   -> Int
   -> UpdateRevisionResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> UpdateRevisionResponse)
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
   -> Int
   -> UpdateRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Int -> UpdateRevisionResponse)
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 -> Int -> UpdateRevisionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe POSIX -> Maybe Text -> Int -> UpdateRevisionResponse)
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 -> Int -> UpdateRevisionResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe Text -> Int -> UpdateRevisionResponse)
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 -> Int -> UpdateRevisionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateRevisionResponse)
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 (Int -> UpdateRevisionResponse)
-> Either String Int -> Either String UpdateRevisionResponse
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 UpdateRevision

instance Prelude.NFData UpdateRevision

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

instance Core.ToJSON UpdateRevision where
  toJSON :: UpdateRevision -> Value
toJSON UpdateRevision' {Maybe Bool
Maybe Text
Text
dataSetId :: Text
revisionId :: Text
comment :: Maybe Text
finalized :: Maybe Bool
$sel:dataSetId:UpdateRevision' :: UpdateRevision -> Text
$sel:revisionId:UpdateRevision' :: UpdateRevision -> Text
$sel:comment:UpdateRevision' :: UpdateRevision -> Maybe Text
$sel:finalized:UpdateRevision' :: UpdateRevision -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Finalized" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
finalized,
            (Text
"Comment" 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
comment
          ]
      )

instance Core.ToPath UpdateRevision where
  toPath :: UpdateRevision -> ByteString
toPath UpdateRevision' {Maybe Bool
Maybe Text
Text
dataSetId :: Text
revisionId :: Text
comment :: Maybe Text
finalized :: Maybe Bool
$sel:dataSetId:UpdateRevision' :: UpdateRevision -> Text
$sel:revisionId:UpdateRevision' :: UpdateRevision -> Text
$sel:comment:UpdateRevision' :: UpdateRevision -> Maybe Text
$sel:finalized:UpdateRevision' :: UpdateRevision -> Maybe Bool
..} =
    [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 UpdateRevision where
  toQuery :: UpdateRevision -> QueryString
toQuery = QueryString -> UpdateRevision -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateRevisionResponse' smart constructor.
data UpdateRevisionResponse = UpdateRevisionResponse'
  { -- | The ARN for the revision.
    UpdateRevisionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the revision was created, in ISO 8601 format.
    UpdateRevisionResponse -> 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.
    UpdateRevisionResponse -> 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
    -- 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.
    UpdateRevisionResponse -> Maybe Bool
finalized :: Prelude.Maybe Prelude.Bool,
    -- | The unique identifier for the data set associated with this revision.
    UpdateRevisionResponse -> Maybe Text
dataSetId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the revision.
    UpdateRevisionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the revision was last updated, in ISO 8601
    -- format.
    UpdateRevisionResponse -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | An optional comment about the revision.
    UpdateRevisionResponse -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateRevisionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateRevisionResponse -> UpdateRevisionResponse -> Bool
(UpdateRevisionResponse -> UpdateRevisionResponse -> Bool)
-> (UpdateRevisionResponse -> UpdateRevisionResponse -> Bool)
-> Eq UpdateRevisionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRevisionResponse -> UpdateRevisionResponse -> Bool
$c/= :: UpdateRevisionResponse -> UpdateRevisionResponse -> Bool
== :: UpdateRevisionResponse -> UpdateRevisionResponse -> Bool
$c== :: UpdateRevisionResponse -> UpdateRevisionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRevisionResponse]
ReadPrec UpdateRevisionResponse
Int -> ReadS UpdateRevisionResponse
ReadS [UpdateRevisionResponse]
(Int -> ReadS UpdateRevisionResponse)
-> ReadS [UpdateRevisionResponse]
-> ReadPrec UpdateRevisionResponse
-> ReadPrec [UpdateRevisionResponse]
-> Read UpdateRevisionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRevisionResponse]
$creadListPrec :: ReadPrec [UpdateRevisionResponse]
readPrec :: ReadPrec UpdateRevisionResponse
$creadPrec :: ReadPrec UpdateRevisionResponse
readList :: ReadS [UpdateRevisionResponse]
$creadList :: ReadS [UpdateRevisionResponse]
readsPrec :: Int -> ReadS UpdateRevisionResponse
$creadsPrec :: Int -> ReadS UpdateRevisionResponse
Prelude.Read, Int -> UpdateRevisionResponse -> ShowS
[UpdateRevisionResponse] -> ShowS
UpdateRevisionResponse -> String
(Int -> UpdateRevisionResponse -> ShowS)
-> (UpdateRevisionResponse -> String)
-> ([UpdateRevisionResponse] -> ShowS)
-> Show UpdateRevisionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRevisionResponse] -> ShowS
$cshowList :: [UpdateRevisionResponse] -> ShowS
show :: UpdateRevisionResponse -> String
$cshow :: UpdateRevisionResponse -> String
showsPrec :: Int -> UpdateRevisionResponse -> ShowS
$cshowsPrec :: Int -> UpdateRevisionResponse -> ShowS
Prelude.Show, (forall x. UpdateRevisionResponse -> Rep UpdateRevisionResponse x)
-> (forall x.
    Rep UpdateRevisionResponse x -> UpdateRevisionResponse)
-> Generic UpdateRevisionResponse
forall x. Rep UpdateRevisionResponse x -> UpdateRevisionResponse
forall x. UpdateRevisionResponse -> Rep UpdateRevisionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRevisionResponse x -> UpdateRevisionResponse
$cfrom :: forall x. UpdateRevisionResponse -> Rep UpdateRevisionResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRevisionResponse' 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', 'updateRevisionResponse_arn' - The ARN for the revision.
--
-- 'createdAt', 'updateRevisionResponse_createdAt' - The date and time that the revision was created, in ISO 8601 format.
--
-- 'sourceId', 'updateRevisionResponse_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', 'updateRevisionResponse_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
-- 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', 'updateRevisionResponse_dataSetId' - The unique identifier for the data set associated with this revision.
--
-- 'id', 'updateRevisionResponse_id' - The unique identifier for the revision.
--
-- 'updatedAt', 'updateRevisionResponse_updatedAt' - The date and time that the revision was last updated, in ISO 8601
-- format.
--
-- 'comment', 'updateRevisionResponse_comment' - An optional comment about the revision.
--
-- 'httpStatus', 'updateRevisionResponse_httpStatus' - The response's http status code.
newUpdateRevisionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateRevisionResponse
newUpdateRevisionResponse :: Int -> UpdateRevisionResponse
newUpdateRevisionResponse Int
pHttpStatus_ =
  UpdateRevisionResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> UpdateRevisionResponse
UpdateRevisionResponse'
    { $sel:arn:UpdateRevisionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:UpdateRevisionResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceId:UpdateRevisionResponse' :: Maybe Text
sourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:finalized:UpdateRevisionResponse' :: Maybe Bool
finalized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetId:UpdateRevisionResponse' :: Maybe Text
dataSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:UpdateRevisionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:UpdateRevisionResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:UpdateRevisionResponse' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateRevisionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The date and time that the revision was created, in ISO 8601 format.
updateRevisionResponse_createdAt :: Lens.Lens' UpdateRevisionResponse (Prelude.Maybe Prelude.UTCTime)
updateRevisionResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateRevisionResponse -> f UpdateRevisionResponse
updateRevisionResponse_createdAt = (UpdateRevisionResponse -> Maybe POSIX)
-> (UpdateRevisionResponse
    -> Maybe POSIX -> UpdateRevisionResponse)
-> Lens
     UpdateRevisionResponse
     UpdateRevisionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRevisionResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:UpdateRevisionResponse' :: UpdateRevisionResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: UpdateRevisionResponse
s@UpdateRevisionResponse' {} Maybe POSIX
a -> UpdateRevisionResponse
s {$sel:createdAt:UpdateRevisionResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: UpdateRevisionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateRevisionResponse -> f UpdateRevisionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateRevisionResponse
-> f UpdateRevisionResponse
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.
updateRevisionResponse_sourceId :: Lens.Lens' UpdateRevisionResponse (Prelude.Maybe Prelude.Text)
updateRevisionResponse_sourceId :: (Maybe Text -> f (Maybe Text))
-> UpdateRevisionResponse -> f UpdateRevisionResponse
updateRevisionResponse_sourceId = (UpdateRevisionResponse -> Maybe Text)
-> (UpdateRevisionResponse -> Maybe Text -> UpdateRevisionResponse)
-> Lens
     UpdateRevisionResponse
     UpdateRevisionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRevisionResponse' {Maybe Text
sourceId :: Maybe Text
$sel:sourceId:UpdateRevisionResponse' :: UpdateRevisionResponse -> Maybe Text
sourceId} -> Maybe Text
sourceId) (\s :: UpdateRevisionResponse
s@UpdateRevisionResponse' {} Maybe Text
a -> UpdateRevisionResponse
s {$sel:sourceId:UpdateRevisionResponse' :: Maybe Text
sourceId = Maybe Text
a} :: UpdateRevisionResponse)

-- | 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
-- 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.
updateRevisionResponse_finalized :: Lens.Lens' UpdateRevisionResponse (Prelude.Maybe Prelude.Bool)
updateRevisionResponse_finalized :: (Maybe Bool -> f (Maybe Bool))
-> UpdateRevisionResponse -> f UpdateRevisionResponse
updateRevisionResponse_finalized = (UpdateRevisionResponse -> Maybe Bool)
-> (UpdateRevisionResponse -> Maybe Bool -> UpdateRevisionResponse)
-> Lens
     UpdateRevisionResponse
     UpdateRevisionResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRevisionResponse' {Maybe Bool
finalized :: Maybe Bool
$sel:finalized:UpdateRevisionResponse' :: UpdateRevisionResponse -> Maybe Bool
finalized} -> Maybe Bool
finalized) (\s :: UpdateRevisionResponse
s@UpdateRevisionResponse' {} Maybe Bool
a -> UpdateRevisionResponse
s {$sel:finalized:UpdateRevisionResponse' :: Maybe Bool
finalized = Maybe Bool
a} :: UpdateRevisionResponse)

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

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

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

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

instance Prelude.NFData UpdateRevisionResponse