{-# 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.LookoutVision.CreateDataset
-- 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)
--
-- Creates a new dataset in an Amazon Lookout for Vision project.
-- @CreateDataset@ can create a training or a test dataset from a valid
-- dataset source (@DatasetSource@).
--
-- If you want a single dataset project, specify @train@ for the value of
-- @DatasetType@.
--
-- To have a project with separate training and test datasets, call
-- @CreateDataset@ twice. On the first call, specify @train@ for the value
-- of @DatasetType@. On the second call, specify @test@ for the value of
-- @DatasetType@.
--
-- This operation requires permissions to perform the
-- @lookoutvision:CreateDataset@ operation.
module Amazonka.LookoutVision.CreateDataset
  ( -- * Creating a Request
    CreateDataset (..),
    newCreateDataset,

    -- * Request Lenses
    createDataset_clientToken,
    createDataset_datasetSource,
    createDataset_projectName,
    createDataset_datasetType,

    -- * Destructuring the Response
    CreateDatasetResponse (..),
    newCreateDatasetResponse,

    -- * Response Lenses
    createDatasetResponse_datasetMetadata,
    createDatasetResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateDataset' smart constructor.
data CreateDataset = CreateDataset'
  { -- | ClientToken is an idempotency token that ensures a call to
    -- @CreateDataset@ completes only once. You choose the value to pass. For
    -- example, An issue, such as an network outage, might prevent you from
    -- getting a response from @CreateDataset@. In this case, safely retry your
    -- call to @CreateDataset@ by using the same @ClientToken@ parameter value.
    -- An error occurs if the other input parameters are not the same as in the
    -- first request. Using a different value for @ClientToken@ is considered a
    -- new call to @CreateDataset@. An idempotency token is active for 8 hours.
    CreateDataset -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The location of the manifest file that Amazon Lookout for Vision uses to
    -- create the dataset.
    --
    -- If you don\'t specify @DatasetSource@, an empty dataset is created and
    -- the operation synchronously returns. Later, you can add JSON Lines by
    -- calling UpdateDatasetEntries.
    --
    -- If you specify a value for @DataSource@, the manifest at the S3 location
    -- is validated and used to create the dataset. The call to @CreateDataset@
    -- is asynchronous and might take a while to complete. To find out the
    -- current status, Check the value of @Status@ returned in a call to
    -- DescribeDataset.
    CreateDataset -> Maybe DatasetSource
datasetSource :: Prelude.Maybe DatasetSource,
    -- | The name of the project in which you want to create a dataset.
    CreateDataset -> Text
projectName :: Prelude.Text,
    -- | The type of the dataset. Specify @train@ for a training dataset. Specify
    -- @test@ for a test dataset.
    CreateDataset -> Text
datasetType :: Prelude.Text
  }
  deriving (CreateDataset -> CreateDataset -> Bool
(CreateDataset -> CreateDataset -> Bool)
-> (CreateDataset -> CreateDataset -> Bool) -> Eq CreateDataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataset -> CreateDataset -> Bool
$c/= :: CreateDataset -> CreateDataset -> Bool
== :: CreateDataset -> CreateDataset -> Bool
$c== :: CreateDataset -> CreateDataset -> Bool
Prelude.Eq, ReadPrec [CreateDataset]
ReadPrec CreateDataset
Int -> ReadS CreateDataset
ReadS [CreateDataset]
(Int -> ReadS CreateDataset)
-> ReadS [CreateDataset]
-> ReadPrec CreateDataset
-> ReadPrec [CreateDataset]
-> Read CreateDataset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDataset]
$creadListPrec :: ReadPrec [CreateDataset]
readPrec :: ReadPrec CreateDataset
$creadPrec :: ReadPrec CreateDataset
readList :: ReadS [CreateDataset]
$creadList :: ReadS [CreateDataset]
readsPrec :: Int -> ReadS CreateDataset
$creadsPrec :: Int -> ReadS CreateDataset
Prelude.Read, Int -> CreateDataset -> ShowS
[CreateDataset] -> ShowS
CreateDataset -> String
(Int -> CreateDataset -> ShowS)
-> (CreateDataset -> String)
-> ([CreateDataset] -> ShowS)
-> Show CreateDataset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataset] -> ShowS
$cshowList :: [CreateDataset] -> ShowS
show :: CreateDataset -> String
$cshow :: CreateDataset -> String
showsPrec :: Int -> CreateDataset -> ShowS
$cshowsPrec :: Int -> CreateDataset -> ShowS
Prelude.Show, (forall x. CreateDataset -> Rep CreateDataset x)
-> (forall x. Rep CreateDataset x -> CreateDataset)
-> Generic CreateDataset
forall x. Rep CreateDataset x -> CreateDataset
forall x. CreateDataset -> Rep CreateDataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDataset x -> CreateDataset
$cfrom :: forall x. CreateDataset -> Rep CreateDataset x
Prelude.Generic)

-- |
-- Create a value of 'CreateDataset' 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', 'createDataset_clientToken' - ClientToken is an idempotency token that ensures a call to
-- @CreateDataset@ completes only once. You choose the value to pass. For
-- example, An issue, such as an network outage, might prevent you from
-- getting a response from @CreateDataset@. In this case, safely retry your
-- call to @CreateDataset@ by using the same @ClientToken@ parameter value.
-- An error occurs if the other input parameters are not the same as in the
-- first request. Using a different value for @ClientToken@ is considered a
-- new call to @CreateDataset@. An idempotency token is active for 8 hours.
--
-- 'datasetSource', 'createDataset_datasetSource' - The location of the manifest file that Amazon Lookout for Vision uses to
-- create the dataset.
--
-- If you don\'t specify @DatasetSource@, an empty dataset is created and
-- the operation synchronously returns. Later, you can add JSON Lines by
-- calling UpdateDatasetEntries.
--
-- If you specify a value for @DataSource@, the manifest at the S3 location
-- is validated and used to create the dataset. The call to @CreateDataset@
-- is asynchronous and might take a while to complete. To find out the
-- current status, Check the value of @Status@ returned in a call to
-- DescribeDataset.
--
-- 'projectName', 'createDataset_projectName' - The name of the project in which you want to create a dataset.
--
-- 'datasetType', 'createDataset_datasetType' - The type of the dataset. Specify @train@ for a training dataset. Specify
-- @test@ for a test dataset.
newCreateDataset ::
  -- | 'projectName'
  Prelude.Text ->
  -- | 'datasetType'
  Prelude.Text ->
  CreateDataset
newCreateDataset :: Text -> Text -> CreateDataset
newCreateDataset Text
pProjectName_ Text
pDatasetType_ =
  CreateDataset' :: Maybe Text -> Maybe DatasetSource -> Text -> Text -> CreateDataset
CreateDataset'
    { $sel:clientToken:CreateDataset' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetSource:CreateDataset' :: Maybe DatasetSource
datasetSource = Maybe DatasetSource
forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:CreateDataset' :: Text
projectName = Text
pProjectName_,
      $sel:datasetType:CreateDataset' :: Text
datasetType = Text
pDatasetType_
    }

-- | ClientToken is an idempotency token that ensures a call to
-- @CreateDataset@ completes only once. You choose the value to pass. For
-- example, An issue, such as an network outage, might prevent you from
-- getting a response from @CreateDataset@. In this case, safely retry your
-- call to @CreateDataset@ by using the same @ClientToken@ parameter value.
-- An error occurs if the other input parameters are not the same as in the
-- first request. Using a different value for @ClientToken@ is considered a
-- new call to @CreateDataset@. An idempotency token is active for 8 hours.
createDataset_clientToken :: Lens.Lens' CreateDataset (Prelude.Maybe Prelude.Text)
createDataset_clientToken :: (Maybe Text -> f (Maybe Text)) -> CreateDataset -> f CreateDataset
createDataset_clientToken = (CreateDataset -> Maybe Text)
-> (CreateDataset -> Maybe Text -> CreateDataset)
-> Lens CreateDataset CreateDataset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateDataset' :: CreateDataset -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateDataset
s@CreateDataset' {} Maybe Text
a -> CreateDataset
s {$sel:clientToken:CreateDataset' :: Maybe Text
clientToken = Maybe Text
a} :: CreateDataset)

-- | The location of the manifest file that Amazon Lookout for Vision uses to
-- create the dataset.
--
-- If you don\'t specify @DatasetSource@, an empty dataset is created and
-- the operation synchronously returns. Later, you can add JSON Lines by
-- calling UpdateDatasetEntries.
--
-- If you specify a value for @DataSource@, the manifest at the S3 location
-- is validated and used to create the dataset. The call to @CreateDataset@
-- is asynchronous and might take a while to complete. To find out the
-- current status, Check the value of @Status@ returned in a call to
-- DescribeDataset.
createDataset_datasetSource :: Lens.Lens' CreateDataset (Prelude.Maybe DatasetSource)
createDataset_datasetSource :: (Maybe DatasetSource -> f (Maybe DatasetSource))
-> CreateDataset -> f CreateDataset
createDataset_datasetSource = (CreateDataset -> Maybe DatasetSource)
-> (CreateDataset -> Maybe DatasetSource -> CreateDataset)
-> Lens
     CreateDataset
     CreateDataset
     (Maybe DatasetSource)
     (Maybe DatasetSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe DatasetSource
datasetSource :: Maybe DatasetSource
$sel:datasetSource:CreateDataset' :: CreateDataset -> Maybe DatasetSource
datasetSource} -> Maybe DatasetSource
datasetSource) (\s :: CreateDataset
s@CreateDataset' {} Maybe DatasetSource
a -> CreateDataset
s {$sel:datasetSource:CreateDataset' :: Maybe DatasetSource
datasetSource = Maybe DatasetSource
a} :: CreateDataset)

-- | The name of the project in which you want to create a dataset.
createDataset_projectName :: Lens.Lens' CreateDataset Prelude.Text
createDataset_projectName :: (Text -> f Text) -> CreateDataset -> f CreateDataset
createDataset_projectName = (CreateDataset -> Text)
-> (CreateDataset -> Text -> CreateDataset)
-> Lens CreateDataset CreateDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Text
projectName :: Text
$sel:projectName:CreateDataset' :: CreateDataset -> Text
projectName} -> Text
projectName) (\s :: CreateDataset
s@CreateDataset' {} Text
a -> CreateDataset
s {$sel:projectName:CreateDataset' :: Text
projectName = Text
a} :: CreateDataset)

-- | The type of the dataset. Specify @train@ for a training dataset. Specify
-- @test@ for a test dataset.
createDataset_datasetType :: Lens.Lens' CreateDataset Prelude.Text
createDataset_datasetType :: (Text -> f Text) -> CreateDataset -> f CreateDataset
createDataset_datasetType = (CreateDataset -> Text)
-> (CreateDataset -> Text -> CreateDataset)
-> Lens CreateDataset CreateDataset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Text
datasetType :: Text
$sel:datasetType:CreateDataset' :: CreateDataset -> Text
datasetType} -> Text
datasetType) (\s :: CreateDataset
s@CreateDataset' {} Text
a -> CreateDataset
s {$sel:datasetType:CreateDataset' :: Text
datasetType = Text
a} :: CreateDataset)

instance Core.AWSRequest CreateDataset where
  type
    AWSResponse CreateDataset =
      CreateDatasetResponse
  request :: CreateDataset -> Request CreateDataset
request = Service -> CreateDataset -> Request CreateDataset
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDataset)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDataset))
-> Logger
-> Service
-> Proxy CreateDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDataset)))
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 DatasetMetadata -> Int -> CreateDatasetResponse
CreateDatasetResponse'
            (Maybe DatasetMetadata -> Int -> CreateDatasetResponse)
-> Either String (Maybe DatasetMetadata)
-> Either String (Int -> CreateDatasetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DatasetMetadata)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DatasetMetadata")
            Either String (Int -> CreateDatasetResponse)
-> Either String Int -> Either String CreateDatasetResponse
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 CreateDataset

instance Prelude.NFData CreateDataset

instance Core.ToHeaders CreateDataset where
  toHeaders :: CreateDataset -> ResponseHeaders
toHeaders CreateDataset' {Maybe Text
Maybe DatasetSource
Text
datasetType :: Text
projectName :: Text
datasetSource :: Maybe DatasetSource
clientToken :: Maybe Text
$sel:datasetType:CreateDataset' :: CreateDataset -> Text
$sel:projectName:CreateDataset' :: CreateDataset -> Text
$sel:datasetSource:CreateDataset' :: CreateDataset -> Maybe DatasetSource
$sel:clientToken:CreateDataset' :: CreateDataset -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amzn-Client-Token" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
clientToken,
        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 CreateDataset where
  toJSON :: CreateDataset -> Value
toJSON CreateDataset' {Maybe Text
Maybe DatasetSource
Text
datasetType :: Text
projectName :: Text
datasetSource :: Maybe DatasetSource
clientToken :: Maybe Text
$sel:datasetType:CreateDataset' :: CreateDataset -> Text
$sel:projectName:CreateDataset' :: CreateDataset -> Text
$sel:datasetSource:CreateDataset' :: CreateDataset -> Maybe DatasetSource
$sel:clientToken:CreateDataset' :: CreateDataset -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DatasetSource" Text -> DatasetSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DatasetSource -> Pair) -> Maybe DatasetSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DatasetSource
datasetSource,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatasetType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetType)
          ]
      )

instance Core.ToPath CreateDataset where
  toPath :: CreateDataset -> ByteString
toPath CreateDataset' {Maybe Text
Maybe DatasetSource
Text
datasetType :: Text
projectName :: Text
datasetSource :: Maybe DatasetSource
clientToken :: Maybe Text
$sel:datasetType:CreateDataset' :: CreateDataset -> Text
$sel:projectName:CreateDataset' :: CreateDataset -> Text
$sel:datasetSource:CreateDataset' :: CreateDataset -> Maybe DatasetSource
$sel:clientToken:CreateDataset' :: CreateDataset -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-11-20/projects/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
projectName,
        ByteString
"/datasets"
      ]

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

-- | /See:/ 'newCreateDatasetResponse' smart constructor.
data CreateDatasetResponse = CreateDatasetResponse'
  { -- | Information about the dataset.
    CreateDatasetResponse -> Maybe DatasetMetadata
datasetMetadata :: Prelude.Maybe DatasetMetadata,
    -- | The response's http status code.
    CreateDatasetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDatasetResponse -> CreateDatasetResponse -> Bool
(CreateDatasetResponse -> CreateDatasetResponse -> Bool)
-> (CreateDatasetResponse -> CreateDatasetResponse -> Bool)
-> Eq CreateDatasetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
$c/= :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
== :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
$c== :: CreateDatasetResponse -> CreateDatasetResponse -> Bool
Prelude.Eq, ReadPrec [CreateDatasetResponse]
ReadPrec CreateDatasetResponse
Int -> ReadS CreateDatasetResponse
ReadS [CreateDatasetResponse]
(Int -> ReadS CreateDatasetResponse)
-> ReadS [CreateDatasetResponse]
-> ReadPrec CreateDatasetResponse
-> ReadPrec [CreateDatasetResponse]
-> Read CreateDatasetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDatasetResponse]
$creadListPrec :: ReadPrec [CreateDatasetResponse]
readPrec :: ReadPrec CreateDatasetResponse
$creadPrec :: ReadPrec CreateDatasetResponse
readList :: ReadS [CreateDatasetResponse]
$creadList :: ReadS [CreateDatasetResponse]
readsPrec :: Int -> ReadS CreateDatasetResponse
$creadsPrec :: Int -> ReadS CreateDatasetResponse
Prelude.Read, Int -> CreateDatasetResponse -> ShowS
[CreateDatasetResponse] -> ShowS
CreateDatasetResponse -> String
(Int -> CreateDatasetResponse -> ShowS)
-> (CreateDatasetResponse -> String)
-> ([CreateDatasetResponse] -> ShowS)
-> Show CreateDatasetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDatasetResponse] -> ShowS
$cshowList :: [CreateDatasetResponse] -> ShowS
show :: CreateDatasetResponse -> String
$cshow :: CreateDatasetResponse -> String
showsPrec :: Int -> CreateDatasetResponse -> ShowS
$cshowsPrec :: Int -> CreateDatasetResponse -> ShowS
Prelude.Show, (forall x. CreateDatasetResponse -> Rep CreateDatasetResponse x)
-> (forall x. Rep CreateDatasetResponse x -> CreateDatasetResponse)
-> Generic CreateDatasetResponse
forall x. Rep CreateDatasetResponse x -> CreateDatasetResponse
forall x. CreateDatasetResponse -> Rep CreateDatasetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDatasetResponse x -> CreateDatasetResponse
$cfrom :: forall x. CreateDatasetResponse -> Rep CreateDatasetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDatasetResponse' 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:
--
-- 'datasetMetadata', 'createDatasetResponse_datasetMetadata' - Information about the dataset.
--
-- 'httpStatus', 'createDatasetResponse_httpStatus' - The response's http status code.
newCreateDatasetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDatasetResponse
newCreateDatasetResponse :: Int -> CreateDatasetResponse
newCreateDatasetResponse Int
pHttpStatus_ =
  CreateDatasetResponse' :: Maybe DatasetMetadata -> Int -> CreateDatasetResponse
CreateDatasetResponse'
    { $sel:datasetMetadata:CreateDatasetResponse' :: Maybe DatasetMetadata
datasetMetadata =
        Maybe DatasetMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDatasetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the dataset.
createDatasetResponse_datasetMetadata :: Lens.Lens' CreateDatasetResponse (Prelude.Maybe DatasetMetadata)
createDatasetResponse_datasetMetadata :: (Maybe DatasetMetadata -> f (Maybe DatasetMetadata))
-> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_datasetMetadata = (CreateDatasetResponse -> Maybe DatasetMetadata)
-> (CreateDatasetResponse
    -> Maybe DatasetMetadata -> CreateDatasetResponse)
-> Lens
     CreateDatasetResponse
     CreateDatasetResponse
     (Maybe DatasetMetadata)
     (Maybe DatasetMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Maybe DatasetMetadata
datasetMetadata :: Maybe DatasetMetadata
$sel:datasetMetadata:CreateDatasetResponse' :: CreateDatasetResponse -> Maybe DatasetMetadata
datasetMetadata} -> Maybe DatasetMetadata
datasetMetadata) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Maybe DatasetMetadata
a -> CreateDatasetResponse
s {$sel:datasetMetadata:CreateDatasetResponse' :: Maybe DatasetMetadata
datasetMetadata = Maybe DatasetMetadata
a} :: CreateDatasetResponse)

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

instance Prelude.NFData CreateDatasetResponse