{-# 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.FinSpaceData.UpdateChangeset
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a FinSpace Changeset.
module Amazonka.FinSpaceData.UpdateChangeset
  ( -- * Creating a Request
    UpdateChangeset (..),
    newUpdateChangeset,

    -- * Request Lenses
    updateChangeset_clientToken,
    updateChangeset_datasetId,
    updateChangeset_changesetId,
    updateChangeset_sourceParams,
    updateChangeset_formatParams,

    -- * Destructuring the Response
    UpdateChangesetResponse (..),
    newUpdateChangesetResponse,

    -- * Response Lenses
    updateChangesetResponse_changesetId,
    updateChangesetResponse_datasetId,
    updateChangesetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FinSpaceData.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Request to update an existing changeset.
--
-- /See:/ 'newUpdateChangeset' smart constructor.
data UpdateChangeset = UpdateChangeset'
  { -- | A token that ensures idempotency. This token expires in 10 minutes.
    UpdateChangeset -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the FinSpace Dataset in which the Changeset is
    -- created.
    UpdateChangeset -> Text
datasetId :: Prelude.Text,
    -- | The unique identifier for the Changeset to update.
    UpdateChangeset -> Text
changesetId :: Prelude.Text,
    -- | Options that define the location of the data being ingested
    -- (@s3SourcePath@) and the source of the changeset (@sourceType@).
    --
    -- Both @s3SourcePath@ and @sourceType@ are required attributes.
    --
    -- Here is an example of how you could specify the @sourceParams@:
    --
    -- @ \"sourceParams\": { \"s3SourcePath\": \"s3:\/\/finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d\/scratch\/wr5hh8pwkpqqkxa4sxrmcw\/ingestion\/equity.csv\", \"sourceType\": \"S3\" } @
    --
    -- The S3 path that you specify must allow the FinSpace role access. To do
    -- that, you first need to configure the IAM policy on S3 bucket. For more
    -- information, see
    -- <https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets Loading data from an Amazon S3 Bucket using the FinSpace API>section.
    UpdateChangeset -> HashMap Text Text
sourceParams :: Prelude.HashMap Prelude.Text Prelude.Text,
    -- | Options that define the structure of the source file(s) including the
    -- format type (@formatType@), header row (@withHeader@), data separation
    -- character (@separator@) and the type of compression (@compression@).
    --
    -- @formatType@ is a required attribute and can have the following values:
    --
    -- -   @PARQUET@ – Parquet source file format.
    --
    -- -   @CSV@ – CSV source file format.
    --
    -- -   @JSON@ – JSON source file format.
    --
    -- -   @XML@ – XML source file format.
    --
    -- Here is an example of how you could specify the @formatParams@:
    --
    -- @ \"formatParams\": { \"formatType\": \"CSV\", \"withHeader\": \"true\", \"separator\": \",\", \"compression\":\"None\" } @
    --
    -- Note that if you only provide @formatType@ as @CSV@, the rest of the
    -- attributes will automatically default to CSV values as following:
    --
    -- @ { \"withHeader\": \"true\", \"separator\": \",\" } @
    --
    -- For more information about supported file formats, see
    -- <https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html Supported Data Types and File Formats>
    -- in the FinSpace User Guide.
    UpdateChangeset -> HashMap Text Text
formatParams :: Prelude.HashMap Prelude.Text Prelude.Text
  }
  deriving (UpdateChangeset -> UpdateChangeset -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChangeset -> UpdateChangeset -> Bool
$c/= :: UpdateChangeset -> UpdateChangeset -> Bool
== :: UpdateChangeset -> UpdateChangeset -> Bool
$c== :: UpdateChangeset -> UpdateChangeset -> Bool
Prelude.Eq, ReadPrec [UpdateChangeset]
ReadPrec UpdateChangeset
Int -> ReadS UpdateChangeset
ReadS [UpdateChangeset]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChangeset]
$creadListPrec :: ReadPrec [UpdateChangeset]
readPrec :: ReadPrec UpdateChangeset
$creadPrec :: ReadPrec UpdateChangeset
readList :: ReadS [UpdateChangeset]
$creadList :: ReadS [UpdateChangeset]
readsPrec :: Int -> ReadS UpdateChangeset
$creadsPrec :: Int -> ReadS UpdateChangeset
Prelude.Read, Int -> UpdateChangeset -> ShowS
[UpdateChangeset] -> ShowS
UpdateChangeset -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChangeset] -> ShowS
$cshowList :: [UpdateChangeset] -> ShowS
show :: UpdateChangeset -> String
$cshow :: UpdateChangeset -> String
showsPrec :: Int -> UpdateChangeset -> ShowS
$cshowsPrec :: Int -> UpdateChangeset -> ShowS
Prelude.Show, forall x. Rep UpdateChangeset x -> UpdateChangeset
forall x. UpdateChangeset -> Rep UpdateChangeset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChangeset x -> UpdateChangeset
$cfrom :: forall x. UpdateChangeset -> Rep UpdateChangeset x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChangeset' 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:
--
-- 'clientToken', 'updateChangeset_clientToken' - A token that ensures idempotency. This token expires in 10 minutes.
--
-- 'datasetId', 'updateChangeset_datasetId' - The unique identifier for the FinSpace Dataset in which the Changeset is
-- created.
--
-- 'changesetId', 'updateChangeset_changesetId' - The unique identifier for the Changeset to update.
--
-- 'sourceParams', 'updateChangeset_sourceParams' - Options that define the location of the data being ingested
-- (@s3SourcePath@) and the source of the changeset (@sourceType@).
--
-- Both @s3SourcePath@ and @sourceType@ are required attributes.
--
-- Here is an example of how you could specify the @sourceParams@:
--
-- @ \"sourceParams\": { \"s3SourcePath\": \"s3:\/\/finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d\/scratch\/wr5hh8pwkpqqkxa4sxrmcw\/ingestion\/equity.csv\", \"sourceType\": \"S3\" } @
--
-- The S3 path that you specify must allow the FinSpace role access. To do
-- that, you first need to configure the IAM policy on S3 bucket. For more
-- information, see
-- <https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets Loading data from an Amazon S3 Bucket using the FinSpace API>section.
--
-- 'formatParams', 'updateChangeset_formatParams' - Options that define the structure of the source file(s) including the
-- format type (@formatType@), header row (@withHeader@), data separation
-- character (@separator@) and the type of compression (@compression@).
--
-- @formatType@ is a required attribute and can have the following values:
--
-- -   @PARQUET@ – Parquet source file format.
--
-- -   @CSV@ – CSV source file format.
--
-- -   @JSON@ – JSON source file format.
--
-- -   @XML@ – XML source file format.
--
-- Here is an example of how you could specify the @formatParams@:
--
-- @ \"formatParams\": { \"formatType\": \"CSV\", \"withHeader\": \"true\", \"separator\": \",\", \"compression\":\"None\" } @
--
-- Note that if you only provide @formatType@ as @CSV@, the rest of the
-- attributes will automatically default to CSV values as following:
--
-- @ { \"withHeader\": \"true\", \"separator\": \",\" } @
--
-- For more information about supported file formats, see
-- <https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html Supported Data Types and File Formats>
-- in the FinSpace User Guide.
newUpdateChangeset ::
  -- | 'datasetId'
  Prelude.Text ->
  -- | 'changesetId'
  Prelude.Text ->
  UpdateChangeset
newUpdateChangeset :: Text -> Text -> UpdateChangeset
newUpdateChangeset Text
pDatasetId_ Text
pChangesetId_ =
  UpdateChangeset'
    { $sel:clientToken:UpdateChangeset' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:datasetId:UpdateChangeset' :: Text
datasetId = Text
pDatasetId_,
      $sel:changesetId:UpdateChangeset' :: Text
changesetId = Text
pChangesetId_,
      $sel:sourceParams:UpdateChangeset' :: HashMap Text Text
sourceParams = forall a. Monoid a => a
Prelude.mempty,
      $sel:formatParams:UpdateChangeset' :: HashMap Text Text
formatParams = forall a. Monoid a => a
Prelude.mempty
    }

-- | A token that ensures idempotency. This token expires in 10 minutes.
updateChangeset_clientToken :: Lens.Lens' UpdateChangeset (Prelude.Maybe Prelude.Text)
updateChangeset_clientToken :: Lens' UpdateChangeset (Maybe Text)
updateChangeset_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChangeset' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateChangeset' :: UpdateChangeset -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateChangeset
s@UpdateChangeset' {} Maybe Text
a -> UpdateChangeset
s {$sel:clientToken:UpdateChangeset' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateChangeset)

-- | The unique identifier for the FinSpace Dataset in which the Changeset is
-- created.
updateChangeset_datasetId :: Lens.Lens' UpdateChangeset Prelude.Text
updateChangeset_datasetId :: Lens' UpdateChangeset Text
updateChangeset_datasetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChangeset' {Text
datasetId :: Text
$sel:datasetId:UpdateChangeset' :: UpdateChangeset -> Text
datasetId} -> Text
datasetId) (\s :: UpdateChangeset
s@UpdateChangeset' {} Text
a -> UpdateChangeset
s {$sel:datasetId:UpdateChangeset' :: Text
datasetId = Text
a} :: UpdateChangeset)

-- | The unique identifier for the Changeset to update.
updateChangeset_changesetId :: Lens.Lens' UpdateChangeset Prelude.Text
updateChangeset_changesetId :: Lens' UpdateChangeset Text
updateChangeset_changesetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChangeset' {Text
changesetId :: Text
$sel:changesetId:UpdateChangeset' :: UpdateChangeset -> Text
changesetId} -> Text
changesetId) (\s :: UpdateChangeset
s@UpdateChangeset' {} Text
a -> UpdateChangeset
s {$sel:changesetId:UpdateChangeset' :: Text
changesetId = Text
a} :: UpdateChangeset)

-- | Options that define the location of the data being ingested
-- (@s3SourcePath@) and the source of the changeset (@sourceType@).
--
-- Both @s3SourcePath@ and @sourceType@ are required attributes.
--
-- Here is an example of how you could specify the @sourceParams@:
--
-- @ \"sourceParams\": { \"s3SourcePath\": \"s3:\/\/finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d\/scratch\/wr5hh8pwkpqqkxa4sxrmcw\/ingestion\/equity.csv\", \"sourceType\": \"S3\" } @
--
-- The S3 path that you specify must allow the FinSpace role access. To do
-- that, you first need to configure the IAM policy on S3 bucket. For more
-- information, see
-- <https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets Loading data from an Amazon S3 Bucket using the FinSpace API>section.
updateChangeset_sourceParams :: Lens.Lens' UpdateChangeset (Prelude.HashMap Prelude.Text Prelude.Text)
updateChangeset_sourceParams :: Lens' UpdateChangeset (HashMap Text Text)
updateChangeset_sourceParams = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChangeset' {HashMap Text Text
sourceParams :: HashMap Text Text
$sel:sourceParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
sourceParams} -> HashMap Text Text
sourceParams) (\s :: UpdateChangeset
s@UpdateChangeset' {} HashMap Text Text
a -> UpdateChangeset
s {$sel:sourceParams:UpdateChangeset' :: HashMap Text Text
sourceParams = HashMap Text Text
a} :: UpdateChangeset) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Options that define the structure of the source file(s) including the
-- format type (@formatType@), header row (@withHeader@), data separation
-- character (@separator@) and the type of compression (@compression@).
--
-- @formatType@ is a required attribute and can have the following values:
--
-- -   @PARQUET@ – Parquet source file format.
--
-- -   @CSV@ – CSV source file format.
--
-- -   @JSON@ – JSON source file format.
--
-- -   @XML@ – XML source file format.
--
-- Here is an example of how you could specify the @formatParams@:
--
-- @ \"formatParams\": { \"formatType\": \"CSV\", \"withHeader\": \"true\", \"separator\": \",\", \"compression\":\"None\" } @
--
-- Note that if you only provide @formatType@ as @CSV@, the rest of the
-- attributes will automatically default to CSV values as following:
--
-- @ { \"withHeader\": \"true\", \"separator\": \",\" } @
--
-- For more information about supported file formats, see
-- <https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html Supported Data Types and File Formats>
-- in the FinSpace User Guide.
updateChangeset_formatParams :: Lens.Lens' UpdateChangeset (Prelude.HashMap Prelude.Text Prelude.Text)
updateChangeset_formatParams :: Lens' UpdateChangeset (HashMap Text Text)
updateChangeset_formatParams = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChangeset' {HashMap Text Text
formatParams :: HashMap Text Text
$sel:formatParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
formatParams} -> HashMap Text Text
formatParams) (\s :: UpdateChangeset
s@UpdateChangeset' {} HashMap Text Text
a -> UpdateChangeset
s {$sel:formatParams:UpdateChangeset' :: HashMap Text Text
formatParams = HashMap Text Text
a} :: UpdateChangeset) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest UpdateChangeset where
  type
    AWSResponse UpdateChangeset =
      UpdateChangesetResponse
  request :: (Service -> Service) -> UpdateChangeset -> Request UpdateChangeset
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateChangeset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateChangeset)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Int -> UpdateChangesetResponse
UpdateChangesetResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"changesetId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"datasetId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateChangeset where
  hashWithSalt :: Int -> UpdateChangeset -> Int
hashWithSalt Int
_salt UpdateChangeset' {Maybe Text
Text
HashMap Text Text
formatParams :: HashMap Text Text
sourceParams :: HashMap Text Text
changesetId :: Text
datasetId :: Text
clientToken :: Maybe Text
$sel:formatParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:sourceParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:changesetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:datasetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:clientToken:UpdateChangeset' :: UpdateChangeset -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
datasetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
changesetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Text
sourceParams
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Text
formatParams

instance Prelude.NFData UpdateChangeset where
  rnf :: UpdateChangeset -> ()
rnf UpdateChangeset' {Maybe Text
Text
HashMap Text Text
formatParams :: HashMap Text Text
sourceParams :: HashMap Text Text
changesetId :: Text
datasetId :: Text
clientToken :: Maybe Text
$sel:formatParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:sourceParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:changesetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:datasetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:clientToken:UpdateChangeset' :: UpdateChangeset -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
datasetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
changesetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Text
sourceParams
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Text
formatParams

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

instance Data.ToJSON UpdateChangeset where
  toJSON :: UpdateChangeset -> Value
toJSON UpdateChangeset' {Maybe Text
Text
HashMap Text Text
formatParams :: HashMap Text Text
sourceParams :: HashMap Text Text
changesetId :: Text
datasetId :: Text
clientToken :: Maybe Text
$sel:formatParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:sourceParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:changesetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:datasetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:clientToken:UpdateChangeset' :: UpdateChangeset -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"sourceParams" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text Text
sourceParams),
            forall a. a -> Maybe a
Prelude.Just (Key
"formatParams" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text Text
formatParams)
          ]
      )

instance Data.ToPath UpdateChangeset where
  toPath :: UpdateChangeset -> ByteString
toPath UpdateChangeset' {Maybe Text
Text
HashMap Text Text
formatParams :: HashMap Text Text
sourceParams :: HashMap Text Text
changesetId :: Text
datasetId :: Text
clientToken :: Maybe Text
$sel:formatParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:sourceParams:UpdateChangeset' :: UpdateChangeset -> HashMap Text Text
$sel:changesetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:datasetId:UpdateChangeset' :: UpdateChangeset -> Text
$sel:clientToken:UpdateChangeset' :: UpdateChangeset -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/datasets/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
datasetId,
        ByteString
"/changesetsv2/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
changesetId
      ]

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

-- | The response from a update changeset operation.
--
-- /See:/ 'newUpdateChangesetResponse' smart constructor.
data UpdateChangesetResponse = UpdateChangesetResponse'
  { -- | The unique identifier for the Changeset to update.
    UpdateChangesetResponse -> Maybe Text
changesetId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the FinSpace Dataset in which the Changeset is
    -- created.
    UpdateChangesetResponse -> Maybe Text
datasetId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateChangesetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateChangesetResponse -> UpdateChangesetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChangesetResponse -> UpdateChangesetResponse -> Bool
$c/= :: UpdateChangesetResponse -> UpdateChangesetResponse -> Bool
== :: UpdateChangesetResponse -> UpdateChangesetResponse -> Bool
$c== :: UpdateChangesetResponse -> UpdateChangesetResponse -> Bool
Prelude.Eq, ReadPrec [UpdateChangesetResponse]
ReadPrec UpdateChangesetResponse
Int -> ReadS UpdateChangesetResponse
ReadS [UpdateChangesetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChangesetResponse]
$creadListPrec :: ReadPrec [UpdateChangesetResponse]
readPrec :: ReadPrec UpdateChangesetResponse
$creadPrec :: ReadPrec UpdateChangesetResponse
readList :: ReadS [UpdateChangesetResponse]
$creadList :: ReadS [UpdateChangesetResponse]
readsPrec :: Int -> ReadS UpdateChangesetResponse
$creadsPrec :: Int -> ReadS UpdateChangesetResponse
Prelude.Read, Int -> UpdateChangesetResponse -> ShowS
[UpdateChangesetResponse] -> ShowS
UpdateChangesetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChangesetResponse] -> ShowS
$cshowList :: [UpdateChangesetResponse] -> ShowS
show :: UpdateChangesetResponse -> String
$cshow :: UpdateChangesetResponse -> String
showsPrec :: Int -> UpdateChangesetResponse -> ShowS
$cshowsPrec :: Int -> UpdateChangesetResponse -> ShowS
Prelude.Show, forall x. Rep UpdateChangesetResponse x -> UpdateChangesetResponse
forall x. UpdateChangesetResponse -> Rep UpdateChangesetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChangesetResponse x -> UpdateChangesetResponse
$cfrom :: forall x. UpdateChangesetResponse -> Rep UpdateChangesetResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChangesetResponse' 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:
--
-- 'changesetId', 'updateChangesetResponse_changesetId' - The unique identifier for the Changeset to update.
--
-- 'datasetId', 'updateChangesetResponse_datasetId' - The unique identifier for the FinSpace Dataset in which the Changeset is
-- created.
--
-- 'httpStatus', 'updateChangesetResponse_httpStatus' - The response's http status code.
newUpdateChangesetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateChangesetResponse
newUpdateChangesetResponse :: Int -> UpdateChangesetResponse
newUpdateChangesetResponse Int
pHttpStatus_ =
  UpdateChangesetResponse'
    { $sel:changesetId:UpdateChangesetResponse' :: Maybe Text
changesetId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:datasetId:UpdateChangesetResponse' :: Maybe Text
datasetId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateChangesetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier for the Changeset to update.
updateChangesetResponse_changesetId :: Lens.Lens' UpdateChangesetResponse (Prelude.Maybe Prelude.Text)
updateChangesetResponse_changesetId :: Lens' UpdateChangesetResponse (Maybe Text)
updateChangesetResponse_changesetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChangesetResponse' {Maybe Text
changesetId :: Maybe Text
$sel:changesetId:UpdateChangesetResponse' :: UpdateChangesetResponse -> Maybe Text
changesetId} -> Maybe Text
changesetId) (\s :: UpdateChangesetResponse
s@UpdateChangesetResponse' {} Maybe Text
a -> UpdateChangesetResponse
s {$sel:changesetId:UpdateChangesetResponse' :: Maybe Text
changesetId = Maybe Text
a} :: UpdateChangesetResponse)

-- | The unique identifier for the FinSpace Dataset in which the Changeset is
-- created.
updateChangesetResponse_datasetId :: Lens.Lens' UpdateChangesetResponse (Prelude.Maybe Prelude.Text)
updateChangesetResponse_datasetId :: Lens' UpdateChangesetResponse (Maybe Text)
updateChangesetResponse_datasetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChangesetResponse' {Maybe Text
datasetId :: Maybe Text
$sel:datasetId:UpdateChangesetResponse' :: UpdateChangesetResponse -> Maybe Text
datasetId} -> Maybe Text
datasetId) (\s :: UpdateChangesetResponse
s@UpdateChangesetResponse' {} Maybe Text
a -> UpdateChangesetResponse
s {$sel:datasetId:UpdateChangesetResponse' :: Maybe Text
datasetId = Maybe Text
a} :: UpdateChangesetResponse)

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

instance Prelude.NFData UpdateChangesetResponse where
  rnf :: UpdateChangesetResponse -> ()
rnf UpdateChangesetResponse' {Int
Maybe Text
httpStatus :: Int
datasetId :: Maybe Text
changesetId :: Maybe Text
$sel:httpStatus:UpdateChangesetResponse' :: UpdateChangesetResponse -> Int
$sel:datasetId:UpdateChangesetResponse' :: UpdateChangesetResponse -> Maybe Text
$sel:changesetId:UpdateChangesetResponse' :: UpdateChangesetResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
changesetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datasetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus