{-# 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.CreateRevision
-- 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 creates a revision for a data set.
module Amazonka.DataExchange.CreateRevision
  ( -- * Creating a Request
    CreateRevision (..),
    newCreateRevision,

    -- * Request Lenses
    createRevision_comment,
    createRevision_tags,
    createRevision_dataSetId,

    -- * Destructuring the Response
    CreateRevisionResponse (..),
    newCreateRevisionResponse,

    -- * Response Lenses
    createRevisionResponse_arn,
    createRevisionResponse_createdAt,
    createRevisionResponse_sourceId,
    createRevisionResponse_finalized,
    createRevisionResponse_dataSetId,
    createRevisionResponse_id,
    createRevisionResponse_updatedAt,
    createRevisionResponse_comment,
    createRevisionResponse_tags,
    createRevisionResponse_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 CreateRevision.
--
-- /See:/ 'newCreateRevision' smart constructor.
data CreateRevision = CreateRevision'
  { -- | An optional comment about the revision.
    CreateRevision -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | A revision tag is an optional label that you can assign to a revision
    -- when you create it. Each tag consists of a key and an optional value,
    -- both of which you define. When you use tagging, you can also use
    -- tag-based access control in IAM policies to control access to these data
    -- sets and revisions.
    CreateRevision -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique identifier for a data set.
    CreateRevision -> Text
dataSetId :: Prelude.Text
  }
  deriving (CreateRevision -> CreateRevision -> Bool
(CreateRevision -> CreateRevision -> Bool)
-> (CreateRevision -> CreateRevision -> Bool) -> Eq CreateRevision
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRevision -> CreateRevision -> Bool
$c/= :: CreateRevision -> CreateRevision -> Bool
== :: CreateRevision -> CreateRevision -> Bool
$c== :: CreateRevision -> CreateRevision -> Bool
Prelude.Eq, ReadPrec [CreateRevision]
ReadPrec CreateRevision
Int -> ReadS CreateRevision
ReadS [CreateRevision]
(Int -> ReadS CreateRevision)
-> ReadS [CreateRevision]
-> ReadPrec CreateRevision
-> ReadPrec [CreateRevision]
-> Read CreateRevision
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRevision]
$creadListPrec :: ReadPrec [CreateRevision]
readPrec :: ReadPrec CreateRevision
$creadPrec :: ReadPrec CreateRevision
readList :: ReadS [CreateRevision]
$creadList :: ReadS [CreateRevision]
readsPrec :: Int -> ReadS CreateRevision
$creadsPrec :: Int -> ReadS CreateRevision
Prelude.Read, Int -> CreateRevision -> ShowS
[CreateRevision] -> ShowS
CreateRevision -> String
(Int -> CreateRevision -> ShowS)
-> (CreateRevision -> String)
-> ([CreateRevision] -> ShowS)
-> Show CreateRevision
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRevision] -> ShowS
$cshowList :: [CreateRevision] -> ShowS
show :: CreateRevision -> String
$cshow :: CreateRevision -> String
showsPrec :: Int -> CreateRevision -> ShowS
$cshowsPrec :: Int -> CreateRevision -> ShowS
Prelude.Show, (forall x. CreateRevision -> Rep CreateRevision x)
-> (forall x. Rep CreateRevision x -> CreateRevision)
-> Generic CreateRevision
forall x. Rep CreateRevision x -> CreateRevision
forall x. CreateRevision -> Rep CreateRevision x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRevision x -> CreateRevision
$cfrom :: forall x. CreateRevision -> Rep CreateRevision x
Prelude.Generic)

-- |
-- Create a value of 'CreateRevision' 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:
--
-- 'comment', 'createRevision_comment' - An optional comment about the revision.
--
-- 'tags', 'createRevision_tags' - A revision tag is an optional label that you can assign to a revision
-- when you create it. Each tag consists of a key and an optional value,
-- both of which you define. When you use tagging, you can also use
-- tag-based access control in IAM policies to control access to these data
-- sets and revisions.
--
-- 'dataSetId', 'createRevision_dataSetId' - The unique identifier for a data set.
newCreateRevision ::
  -- | 'dataSetId'
  Prelude.Text ->
  CreateRevision
newCreateRevision :: Text -> CreateRevision
newCreateRevision Text
pDataSetId_ =
  CreateRevision' :: Maybe Text -> Maybe (HashMap Text Text) -> Text -> CreateRevision
CreateRevision'
    { $sel:comment:CreateRevision' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateRevision' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetId:CreateRevision' :: Text
dataSetId = Text
pDataSetId_
    }

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

-- | A revision tag is an optional label that you can assign to a revision
-- when you create it. Each tag consists of a key and an optional value,
-- both of which you define. When you use tagging, you can also use
-- tag-based access control in IAM policies to control access to these data
-- sets and revisions.
createRevision_tags :: Lens.Lens' CreateRevision (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRevision_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRevision -> f CreateRevision
createRevision_tags = (CreateRevision -> Maybe (HashMap Text Text))
-> (CreateRevision -> Maybe (HashMap Text Text) -> CreateRevision)
-> Lens
     CreateRevision
     CreateRevision
     (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 (\CreateRevision' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateRevision' :: CreateRevision -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateRevision
s@CreateRevision' {} Maybe (HashMap Text Text)
a -> CreateRevision
s {$sel:tags:CreateRevision' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateRevision) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateRevision -> f CreateRevision)
-> ((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)))
-> CreateRevision
-> f CreateRevision
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 unique identifier for a data set.
createRevision_dataSetId :: Lens.Lens' CreateRevision Prelude.Text
createRevision_dataSetId :: (Text -> f Text) -> CreateRevision -> f CreateRevision
createRevision_dataSetId = (CreateRevision -> Text)
-> (CreateRevision -> Text -> CreateRevision)
-> Lens CreateRevision CreateRevision Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRevision' {Text
dataSetId :: Text
$sel:dataSetId:CreateRevision' :: CreateRevision -> Text
dataSetId} -> Text
dataSetId) (\s :: CreateRevision
s@CreateRevision' {} Text
a -> CreateRevision
s {$sel:dataSetId:CreateRevision' :: Text
dataSetId = Text
a} :: CreateRevision)

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

instance Prelude.NFData CreateRevision

instance Core.ToHeaders CreateRevision where
  toHeaders :: CreateRevision -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateRevision -> 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 CreateRevision where
  toJSON :: CreateRevision -> Value
toJSON CreateRevision' {Maybe Text
Maybe (HashMap Text Text)
Text
dataSetId :: Text
tags :: Maybe (HashMap Text Text)
comment :: Maybe Text
$sel:dataSetId:CreateRevision' :: CreateRevision -> Text
$sel:tags:CreateRevision' :: CreateRevision -> Maybe (HashMap Text Text)
$sel:comment:CreateRevision' :: CreateRevision -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
          ]
      )

instance Core.ToPath CreateRevision where
  toPath :: CreateRevision -> ByteString
toPath CreateRevision' {Maybe Text
Maybe (HashMap Text Text)
Text
dataSetId :: Text
tags :: Maybe (HashMap Text Text)
comment :: Maybe Text
$sel:dataSetId:CreateRevision' :: CreateRevision -> Text
$sel:tags:CreateRevision' :: CreateRevision -> Maybe (HashMap Text Text)
$sel:comment:CreateRevision' :: CreateRevision -> Maybe 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"]

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

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

-- |
-- Create a value of 'CreateRevisionResponse' 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', 'createRevisionResponse_arn' - The ARN for the revision.
--
-- 'createdAt', 'createRevisionResponse_createdAt' - The date and time that the revision was created, in ISO 8601 format.
--
-- 'sourceId', 'createRevisionResponse_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', 'createRevisionResponse_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', 'createRevisionResponse_dataSetId' - The unique identifier for the data set associated with this revision.
--
-- 'id', 'createRevisionResponse_id' - The unique identifier for the revision.
--
-- 'updatedAt', 'createRevisionResponse_updatedAt' - The date and time that the revision was last updated, in ISO 8601
-- format.
--
-- 'comment', 'createRevisionResponse_comment' - An optional comment about the revision.
--
-- 'tags', 'createRevisionResponse_tags' - The tags for the revision.
--
-- 'httpStatus', 'createRevisionResponse_httpStatus' - The response's http status code.
newCreateRevisionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRevisionResponse
newCreateRevisionResponse :: Int -> CreateRevisionResponse
newCreateRevisionResponse Int
pHttpStatus_ =
  CreateRevisionResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateRevisionResponse
CreateRevisionResponse'
    { $sel:arn:CreateRevisionResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CreateRevisionResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceId:CreateRevisionResponse' :: Maybe Text
sourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:finalized:CreateRevisionResponse' :: Maybe Bool
finalized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetId:CreateRevisionResponse' :: Maybe Text
dataSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateRevisionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:CreateRevisionResponse' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:CreateRevisionResponse' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateRevisionResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateRevisionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

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

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

instance Prelude.NFData CreateRevisionResponse