{-# 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.LookoutEquipment.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 container for a collection of data being ingested for
-- analysis. The dataset contains the metadata describing where the data is
-- and what the data actually looks like. In other words, it contains the
-- location of the data source, the data schema, and other information. A
-- dataset also contains any tags associated with the ingested data.
module Amazonka.LookoutEquipment.CreateDataset
  ( -- * Creating a Request
    CreateDataset (..),
    newCreateDataset,

    -- * Request Lenses
    createDataset_tags,
    createDataset_serverSideKmsKeyId,
    createDataset_datasetName,
    createDataset_datasetSchema,
    createDataset_clientToken,

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

    -- * Response Lenses
    createDatasetResponse_status,
    createDatasetResponse_datasetArn,
    createDatasetResponse_datasetName,
    createDatasetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutEquipment.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'
  { -- | Any tags associated with the ingested data described in the dataset.
    CreateDataset -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Provides the identifier of the KMS key used to encrypt dataset data by
    -- Amazon Lookout for Equipment.
    CreateDataset -> Maybe Text
serverSideKmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The name of the dataset being created.
    CreateDataset -> Text
datasetName :: Prelude.Text,
    -- | A JSON description of the data that is in each time series dataset,
    -- including names, column names, and data types.
    CreateDataset -> DatasetSchema
datasetSchema :: DatasetSchema,
    -- | A unique identifier for the request. If you do not set the client
    -- request token, Amazon Lookout for Equipment generates one.
    CreateDataset -> Text
clientToken :: 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:
--
-- 'tags', 'createDataset_tags' - Any tags associated with the ingested data described in the dataset.
--
-- 'serverSideKmsKeyId', 'createDataset_serverSideKmsKeyId' - Provides the identifier of the KMS key used to encrypt dataset data by
-- Amazon Lookout for Equipment.
--
-- 'datasetName', 'createDataset_datasetName' - The name of the dataset being created.
--
-- 'datasetSchema', 'createDataset_datasetSchema' - A JSON description of the data that is in each time series dataset,
-- including names, column names, and data types.
--
-- 'clientToken', 'createDataset_clientToken' - A unique identifier for the request. If you do not set the client
-- request token, Amazon Lookout for Equipment generates one.
newCreateDataset ::
  -- | 'datasetName'
  Prelude.Text ->
  -- | 'datasetSchema'
  DatasetSchema ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateDataset
newCreateDataset :: Text -> DatasetSchema -> Text -> CreateDataset
newCreateDataset
  Text
pDatasetName_
  DatasetSchema
pDatasetSchema_
  Text
pClientToken_ =
    CreateDataset' :: Maybe [Tag]
-> Maybe Text -> Text -> DatasetSchema -> Text -> CreateDataset
CreateDataset'
      { $sel:tags:CreateDataset' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:serverSideKmsKeyId:CreateDataset' :: Maybe Text
serverSideKmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:datasetName:CreateDataset' :: Text
datasetName = Text
pDatasetName_,
        $sel:datasetSchema:CreateDataset' :: DatasetSchema
datasetSchema = DatasetSchema
pDatasetSchema_,
        $sel:clientToken:CreateDataset' :: Text
clientToken = Text
pClientToken_
      }

-- | Any tags associated with the ingested data described in the dataset.
createDataset_tags :: Lens.Lens' CreateDataset (Prelude.Maybe [Tag])
createDataset_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDataset -> f CreateDataset
createDataset_tags = (CreateDataset -> Maybe [Tag])
-> (CreateDataset -> Maybe [Tag] -> CreateDataset)
-> Lens CreateDataset CreateDataset (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDataset' :: CreateDataset -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDataset
s@CreateDataset' {} Maybe [Tag]
a -> CreateDataset
s {$sel:tags:CreateDataset' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDataset) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateDataset -> f CreateDataset)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDataset
-> f CreateDataset
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Provides the identifier of the KMS key used to encrypt dataset data by
-- Amazon Lookout for Equipment.
createDataset_serverSideKmsKeyId :: Lens.Lens' CreateDataset (Prelude.Maybe Prelude.Text)
createDataset_serverSideKmsKeyId :: (Maybe Text -> f (Maybe Text)) -> CreateDataset -> f CreateDataset
createDataset_serverSideKmsKeyId = (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
serverSideKmsKeyId :: Maybe Text
$sel:serverSideKmsKeyId:CreateDataset' :: CreateDataset -> Maybe Text
serverSideKmsKeyId} -> Maybe Text
serverSideKmsKeyId) (\s :: CreateDataset
s@CreateDataset' {} Maybe Text
a -> CreateDataset
s {$sel:serverSideKmsKeyId:CreateDataset' :: Maybe Text
serverSideKmsKeyId = Maybe Text
a} :: CreateDataset)

-- | The name of the dataset being created.
createDataset_datasetName :: Lens.Lens' CreateDataset Prelude.Text
createDataset_datasetName :: (Text -> f Text) -> CreateDataset -> f CreateDataset
createDataset_datasetName = (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
datasetName :: Text
$sel:datasetName:CreateDataset' :: CreateDataset -> Text
datasetName} -> Text
datasetName) (\s :: CreateDataset
s@CreateDataset' {} Text
a -> CreateDataset
s {$sel:datasetName:CreateDataset' :: Text
datasetName = Text
a} :: CreateDataset)

-- | A JSON description of the data that is in each time series dataset,
-- including names, column names, and data types.
createDataset_datasetSchema :: Lens.Lens' CreateDataset DatasetSchema
createDataset_datasetSchema :: (DatasetSchema -> f DatasetSchema)
-> CreateDataset -> f CreateDataset
createDataset_datasetSchema = (CreateDataset -> DatasetSchema)
-> (CreateDataset -> DatasetSchema -> CreateDataset)
-> Lens CreateDataset CreateDataset DatasetSchema DatasetSchema
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataset' {DatasetSchema
datasetSchema :: DatasetSchema
$sel:datasetSchema:CreateDataset' :: CreateDataset -> DatasetSchema
datasetSchema} -> DatasetSchema
datasetSchema) (\s :: CreateDataset
s@CreateDataset' {} DatasetSchema
a -> CreateDataset
s {$sel:datasetSchema:CreateDataset' :: DatasetSchema
datasetSchema = DatasetSchema
a} :: CreateDataset)

-- | A unique identifier for the request. If you do not set the client
-- request token, Amazon Lookout for Equipment generates one.
createDataset_clientToken :: Lens.Lens' CreateDataset Prelude.Text
createDataset_clientToken :: (Text -> f Text) -> CreateDataset -> f CreateDataset
createDataset_clientToken = (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
clientToken :: Text
$sel:clientToken:CreateDataset' :: CreateDataset -> Text
clientToken} -> Text
clientToken) (\s :: CreateDataset
s@CreateDataset' {} Text
a -> CreateDataset
s {$sel:clientToken:CreateDataset' :: Text
clientToken = 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 DatasetStatus
-> Maybe Text -> Maybe Text -> Int -> CreateDatasetResponse
CreateDatasetResponse'
            (Maybe DatasetStatus
 -> Maybe Text -> Maybe Text -> Int -> CreateDatasetResponse)
-> Either String (Maybe DatasetStatus)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> CreateDatasetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DatasetStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String (Maybe Text -> Maybe Text -> Int -> CreateDatasetResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateDatasetResponse)
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
"DatasetArn")
            Either String (Maybe Text -> Int -> CreateDatasetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDatasetResponse)
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
"DatasetName")
            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 =
    ResponseHeaders -> CreateDataset -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSLookoutEquipmentFrontendService.CreateDataset" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateDataset where
  toJSON :: CreateDataset -> Value
toJSON CreateDataset' {Maybe [Tag]
Maybe Text
Text
DatasetSchema
clientToken :: Text
datasetSchema :: DatasetSchema
datasetName :: Text
serverSideKmsKeyId :: Maybe Text
tags :: Maybe [Tag]
$sel:clientToken:CreateDataset' :: CreateDataset -> Text
$sel:datasetSchema:CreateDataset' :: CreateDataset -> DatasetSchema
$sel:datasetName:CreateDataset' :: CreateDataset -> Text
$sel:serverSideKmsKeyId:CreateDataset' :: CreateDataset -> Maybe Text
$sel:tags:CreateDataset' :: CreateDataset -> Maybe [Tag]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Text
"ServerSideKmsKeyId" 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
serverSideKmsKeyId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatasetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatasetSchema" Text -> DatasetSchema -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DatasetSchema
datasetSchema),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

instance Core.ToPath CreateDataset where
  toPath :: CreateDataset -> ByteString
toPath = ByteString -> CreateDataset -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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'
  { -- | Indicates the status of the @CreateDataset@ operation.
    CreateDatasetResponse -> Maybe DatasetStatus
status :: Prelude.Maybe DatasetStatus,
    -- | The Amazon Resource Name (ARN) of the dataset being created.
    CreateDatasetResponse -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the dataset being created.
    CreateDatasetResponse -> Maybe Text
datasetName :: Prelude.Maybe Prelude.Text,
    -- | 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:
--
-- 'status', 'createDatasetResponse_status' - Indicates the status of the @CreateDataset@ operation.
--
-- 'datasetArn', 'createDatasetResponse_datasetArn' - The Amazon Resource Name (ARN) of the dataset being created.
--
-- 'datasetName', 'createDatasetResponse_datasetName' - The name of the dataset being created.
--
-- 'httpStatus', 'createDatasetResponse_httpStatus' - The response's http status code.
newCreateDatasetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDatasetResponse
newCreateDatasetResponse :: Int -> CreateDatasetResponse
newCreateDatasetResponse Int
pHttpStatus_ =
  CreateDatasetResponse' :: Maybe DatasetStatus
-> Maybe Text -> Maybe Text -> Int -> CreateDatasetResponse
CreateDatasetResponse'
    { $sel:status:CreateDatasetResponse' :: Maybe DatasetStatus
status = Maybe DatasetStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetArn:CreateDatasetResponse' :: Maybe Text
datasetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetName:CreateDatasetResponse' :: Maybe Text
datasetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDatasetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Indicates the status of the @CreateDataset@ operation.
createDatasetResponse_status :: Lens.Lens' CreateDatasetResponse (Prelude.Maybe DatasetStatus)
createDatasetResponse_status :: (Maybe DatasetStatus -> f (Maybe DatasetStatus))
-> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_status = (CreateDatasetResponse -> Maybe DatasetStatus)
-> (CreateDatasetResponse
    -> Maybe DatasetStatus -> CreateDatasetResponse)
-> Lens
     CreateDatasetResponse
     CreateDatasetResponse
     (Maybe DatasetStatus)
     (Maybe DatasetStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Maybe DatasetStatus
status :: Maybe DatasetStatus
$sel:status:CreateDatasetResponse' :: CreateDatasetResponse -> Maybe DatasetStatus
status} -> Maybe DatasetStatus
status) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Maybe DatasetStatus
a -> CreateDatasetResponse
s {$sel:status:CreateDatasetResponse' :: Maybe DatasetStatus
status = Maybe DatasetStatus
a} :: CreateDatasetResponse)

-- | The Amazon Resource Name (ARN) of the dataset being created.
createDatasetResponse_datasetArn :: Lens.Lens' CreateDatasetResponse (Prelude.Maybe Prelude.Text)
createDatasetResponse_datasetArn :: (Maybe Text -> f (Maybe Text))
-> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_datasetArn = (CreateDatasetResponse -> Maybe Text)
-> (CreateDatasetResponse -> Maybe Text -> CreateDatasetResponse)
-> Lens
     CreateDatasetResponse
     CreateDatasetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Maybe Text
datasetArn :: Maybe Text
$sel:datasetArn:CreateDatasetResponse' :: CreateDatasetResponse -> Maybe Text
datasetArn} -> Maybe Text
datasetArn) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Maybe Text
a -> CreateDatasetResponse
s {$sel:datasetArn:CreateDatasetResponse' :: Maybe Text
datasetArn = Maybe Text
a} :: CreateDatasetResponse)

-- | The name of the dataset being created.
createDatasetResponse_datasetName :: Lens.Lens' CreateDatasetResponse (Prelude.Maybe Prelude.Text)
createDatasetResponse_datasetName :: (Maybe Text -> f (Maybe Text))
-> CreateDatasetResponse -> f CreateDatasetResponse
createDatasetResponse_datasetName = (CreateDatasetResponse -> Maybe Text)
-> (CreateDatasetResponse -> Maybe Text -> CreateDatasetResponse)
-> Lens
     CreateDatasetResponse
     CreateDatasetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDatasetResponse' {Maybe Text
datasetName :: Maybe Text
$sel:datasetName:CreateDatasetResponse' :: CreateDatasetResponse -> Maybe Text
datasetName} -> Maybe Text
datasetName) (\s :: CreateDatasetResponse
s@CreateDatasetResponse' {} Maybe Text
a -> CreateDatasetResponse
s {$sel:datasetName:CreateDatasetResponse' :: Maybe Text
datasetName = Maybe Text
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