{-# 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.MachineLearning.CreateDataSourceFromS3
-- 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 @DataSource@ object. A @DataSource@ references data that can
-- be used to perform @CreateMLModel@, @CreateEvaluation@, or
-- @CreateBatchPrediction@ operations.
--
-- @CreateDataSourceFromS3@ is an asynchronous operation. In response to
-- @CreateDataSourceFromS3@, Amazon Machine Learning (Amazon ML)
-- immediately returns and sets the @DataSource@ status to @PENDING@. After
-- the @DataSource@ has been created and is ready for use, Amazon ML sets
-- the @Status@ parameter to @COMPLETED@. @DataSource@ in the @COMPLETED@
-- or @PENDING@ state can be used to perform only @CreateMLModel@,
-- @CreateEvaluation@ or @CreateBatchPrediction@ operations.
--
-- If Amazon ML can\'t accept the input source, it sets the @Status@
-- parameter to @FAILED@ and includes an error message in the @Message@
-- attribute of the @GetDataSource@ operation response.
--
-- The observation data used in a @DataSource@ should be ready to use; that
-- is, it should have a consistent structure, and missing data values
-- should be kept to a minimum. The observation data must reside in one or
-- more .csv files in an Amazon Simple Storage Service (Amazon S3)
-- location, along with a schema that describes the data items by name and
-- type. The same schema must be used for all of the data files referenced
-- by the @DataSource@.
--
-- After the @DataSource@ has been created, it\'s ready to use in
-- evaluations and batch predictions. If you plan to use the @DataSource@
-- to train an @MLModel@, the @DataSource@ also needs a recipe. A recipe
-- describes how each input variable will be used in training an @MLModel@.
-- Will the variable be included or excluded from training? Will the
-- variable be manipulated; for example, will it be combined with another
-- variable or will it be split apart into word combinations? The recipe
-- provides answers to these questions.
module Amazonka.MachineLearning.CreateDataSourceFromS3
  ( -- * Creating a Request
    CreateDataSourceFromS3 (..),
    newCreateDataSourceFromS3,

    -- * Request Lenses
    createDataSourceFromS3_dataSourceName,
    createDataSourceFromS3_computeStatistics,
    createDataSourceFromS3_dataSourceId,
    createDataSourceFromS3_dataSpec,

    -- * Destructuring the Response
    CreateDataSourceFromS3Response (..),
    newCreateDataSourceFromS3Response,

    -- * Response Lenses
    createDataSourceFromS3Response_dataSourceId,
    createDataSourceFromS3Response_httpStatus,
  )
where

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

-- | /See:/ 'newCreateDataSourceFromS3' smart constructor.
data CreateDataSourceFromS3 = CreateDataSourceFromS3'
  { -- | A user-supplied name or description of the @DataSource@.
    CreateDataSourceFromS3 -> Maybe Text
dataSourceName :: Prelude.Maybe Prelude.Text,
    -- | The compute statistics for a @DataSource@. The statistics are generated
    -- from the observation data referenced by a @DataSource@. Amazon ML uses
    -- the statistics internally during @MLModel@ training. This parameter must
    -- be set to @true@ if the @@DataSource@@ needs to be used for @MLModel@
    -- training.
    CreateDataSourceFromS3 -> Maybe Bool
computeStatistics :: Prelude.Maybe Prelude.Bool,
    -- | A user-supplied identifier that uniquely identifies the @DataSource@.
    CreateDataSourceFromS3 -> Text
dataSourceId :: Prelude.Text,
    -- | The data specification of a @DataSource@:
    --
    -- -   DataLocationS3 - The Amazon S3 location of the observation data.
    --
    -- -   DataSchemaLocationS3 - The Amazon S3 location of the @DataSchema@.
    --
    -- -   DataSchema - A JSON string representing the schema. This is not
    --     required if @DataSchemaUri@ is specified.
    --
    -- -   DataRearrangement - A JSON string that represents the splitting and
    --     rearrangement requirements for the @Datasource@.
    --
    --     Sample -
    --     @ \"{\\\"splitting\\\":{\\\"percentBegin\\\":10,\\\"percentEnd\\\":60}}\"@
    CreateDataSourceFromS3 -> S3DataSpec
dataSpec :: S3DataSpec
  }
  deriving (CreateDataSourceFromS3 -> CreateDataSourceFromS3 -> Bool
(CreateDataSourceFromS3 -> CreateDataSourceFromS3 -> Bool)
-> (CreateDataSourceFromS3 -> CreateDataSourceFromS3 -> Bool)
-> Eq CreateDataSourceFromS3
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataSourceFromS3 -> CreateDataSourceFromS3 -> Bool
$c/= :: CreateDataSourceFromS3 -> CreateDataSourceFromS3 -> Bool
== :: CreateDataSourceFromS3 -> CreateDataSourceFromS3 -> Bool
$c== :: CreateDataSourceFromS3 -> CreateDataSourceFromS3 -> Bool
Prelude.Eq, ReadPrec [CreateDataSourceFromS3]
ReadPrec CreateDataSourceFromS3
Int -> ReadS CreateDataSourceFromS3
ReadS [CreateDataSourceFromS3]
(Int -> ReadS CreateDataSourceFromS3)
-> ReadS [CreateDataSourceFromS3]
-> ReadPrec CreateDataSourceFromS3
-> ReadPrec [CreateDataSourceFromS3]
-> Read CreateDataSourceFromS3
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDataSourceFromS3]
$creadListPrec :: ReadPrec [CreateDataSourceFromS3]
readPrec :: ReadPrec CreateDataSourceFromS3
$creadPrec :: ReadPrec CreateDataSourceFromS3
readList :: ReadS [CreateDataSourceFromS3]
$creadList :: ReadS [CreateDataSourceFromS3]
readsPrec :: Int -> ReadS CreateDataSourceFromS3
$creadsPrec :: Int -> ReadS CreateDataSourceFromS3
Prelude.Read, Int -> CreateDataSourceFromS3 -> ShowS
[CreateDataSourceFromS3] -> ShowS
CreateDataSourceFromS3 -> String
(Int -> CreateDataSourceFromS3 -> ShowS)
-> (CreateDataSourceFromS3 -> String)
-> ([CreateDataSourceFromS3] -> ShowS)
-> Show CreateDataSourceFromS3
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataSourceFromS3] -> ShowS
$cshowList :: [CreateDataSourceFromS3] -> ShowS
show :: CreateDataSourceFromS3 -> String
$cshow :: CreateDataSourceFromS3 -> String
showsPrec :: Int -> CreateDataSourceFromS3 -> ShowS
$cshowsPrec :: Int -> CreateDataSourceFromS3 -> ShowS
Prelude.Show, (forall x. CreateDataSourceFromS3 -> Rep CreateDataSourceFromS3 x)
-> (forall x.
    Rep CreateDataSourceFromS3 x -> CreateDataSourceFromS3)
-> Generic CreateDataSourceFromS3
forall x. Rep CreateDataSourceFromS3 x -> CreateDataSourceFromS3
forall x. CreateDataSourceFromS3 -> Rep CreateDataSourceFromS3 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDataSourceFromS3 x -> CreateDataSourceFromS3
$cfrom :: forall x. CreateDataSourceFromS3 -> Rep CreateDataSourceFromS3 x
Prelude.Generic)

-- |
-- Create a value of 'CreateDataSourceFromS3' 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:
--
-- 'dataSourceName', 'createDataSourceFromS3_dataSourceName' - A user-supplied name or description of the @DataSource@.
--
-- 'computeStatistics', 'createDataSourceFromS3_computeStatistics' - The compute statistics for a @DataSource@. The statistics are generated
-- from the observation data referenced by a @DataSource@. Amazon ML uses
-- the statistics internally during @MLModel@ training. This parameter must
-- be set to @true@ if the @@DataSource@@ needs to be used for @MLModel@
-- training.
--
-- 'dataSourceId', 'createDataSourceFromS3_dataSourceId' - A user-supplied identifier that uniquely identifies the @DataSource@.
--
-- 'dataSpec', 'createDataSourceFromS3_dataSpec' - The data specification of a @DataSource@:
--
-- -   DataLocationS3 - The Amazon S3 location of the observation data.
--
-- -   DataSchemaLocationS3 - The Amazon S3 location of the @DataSchema@.
--
-- -   DataSchema - A JSON string representing the schema. This is not
--     required if @DataSchemaUri@ is specified.
--
-- -   DataRearrangement - A JSON string that represents the splitting and
--     rearrangement requirements for the @Datasource@.
--
--     Sample -
--     @ \"{\\\"splitting\\\":{\\\"percentBegin\\\":10,\\\"percentEnd\\\":60}}\"@
newCreateDataSourceFromS3 ::
  -- | 'dataSourceId'
  Prelude.Text ->
  -- | 'dataSpec'
  S3DataSpec ->
  CreateDataSourceFromS3
newCreateDataSourceFromS3 :: Text -> S3DataSpec -> CreateDataSourceFromS3
newCreateDataSourceFromS3 Text
pDataSourceId_ S3DataSpec
pDataSpec_ =
  CreateDataSourceFromS3' :: Maybe Text
-> Maybe Bool -> Text -> S3DataSpec -> CreateDataSourceFromS3
CreateDataSourceFromS3'
    { $sel:dataSourceName:CreateDataSourceFromS3' :: Maybe Text
dataSourceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:computeStatistics:CreateDataSourceFromS3' :: Maybe Bool
computeStatistics = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceId:CreateDataSourceFromS3' :: Text
dataSourceId = Text
pDataSourceId_,
      $sel:dataSpec:CreateDataSourceFromS3' :: S3DataSpec
dataSpec = S3DataSpec
pDataSpec_
    }

-- | A user-supplied name or description of the @DataSource@.
createDataSourceFromS3_dataSourceName :: Lens.Lens' CreateDataSourceFromS3 (Prelude.Maybe Prelude.Text)
createDataSourceFromS3_dataSourceName :: (Maybe Text -> f (Maybe Text))
-> CreateDataSourceFromS3 -> f CreateDataSourceFromS3
createDataSourceFromS3_dataSourceName = (CreateDataSourceFromS3 -> Maybe Text)
-> (CreateDataSourceFromS3 -> Maybe Text -> CreateDataSourceFromS3)
-> Lens
     CreateDataSourceFromS3
     CreateDataSourceFromS3
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSourceFromS3' {Maybe Text
dataSourceName :: Maybe Text
$sel:dataSourceName:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> Maybe Text
dataSourceName} -> Maybe Text
dataSourceName) (\s :: CreateDataSourceFromS3
s@CreateDataSourceFromS3' {} Maybe Text
a -> CreateDataSourceFromS3
s {$sel:dataSourceName:CreateDataSourceFromS3' :: Maybe Text
dataSourceName = Maybe Text
a} :: CreateDataSourceFromS3)

-- | The compute statistics for a @DataSource@. The statistics are generated
-- from the observation data referenced by a @DataSource@. Amazon ML uses
-- the statistics internally during @MLModel@ training. This parameter must
-- be set to @true@ if the @@DataSource@@ needs to be used for @MLModel@
-- training.
createDataSourceFromS3_computeStatistics :: Lens.Lens' CreateDataSourceFromS3 (Prelude.Maybe Prelude.Bool)
createDataSourceFromS3_computeStatistics :: (Maybe Bool -> f (Maybe Bool))
-> CreateDataSourceFromS3 -> f CreateDataSourceFromS3
createDataSourceFromS3_computeStatistics = (CreateDataSourceFromS3 -> Maybe Bool)
-> (CreateDataSourceFromS3 -> Maybe Bool -> CreateDataSourceFromS3)
-> Lens
     CreateDataSourceFromS3
     CreateDataSourceFromS3
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSourceFromS3' {Maybe Bool
computeStatistics :: Maybe Bool
$sel:computeStatistics:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> Maybe Bool
computeStatistics} -> Maybe Bool
computeStatistics) (\s :: CreateDataSourceFromS3
s@CreateDataSourceFromS3' {} Maybe Bool
a -> CreateDataSourceFromS3
s {$sel:computeStatistics:CreateDataSourceFromS3' :: Maybe Bool
computeStatistics = Maybe Bool
a} :: CreateDataSourceFromS3)

-- | A user-supplied identifier that uniquely identifies the @DataSource@.
createDataSourceFromS3_dataSourceId :: Lens.Lens' CreateDataSourceFromS3 Prelude.Text
createDataSourceFromS3_dataSourceId :: (Text -> f Text)
-> CreateDataSourceFromS3 -> f CreateDataSourceFromS3
createDataSourceFromS3_dataSourceId = (CreateDataSourceFromS3 -> Text)
-> (CreateDataSourceFromS3 -> Text -> CreateDataSourceFromS3)
-> Lens CreateDataSourceFromS3 CreateDataSourceFromS3 Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSourceFromS3' {Text
dataSourceId :: Text
$sel:dataSourceId:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> Text
dataSourceId} -> Text
dataSourceId) (\s :: CreateDataSourceFromS3
s@CreateDataSourceFromS3' {} Text
a -> CreateDataSourceFromS3
s {$sel:dataSourceId:CreateDataSourceFromS3' :: Text
dataSourceId = Text
a} :: CreateDataSourceFromS3)

-- | The data specification of a @DataSource@:
--
-- -   DataLocationS3 - The Amazon S3 location of the observation data.
--
-- -   DataSchemaLocationS3 - The Amazon S3 location of the @DataSchema@.
--
-- -   DataSchema - A JSON string representing the schema. This is not
--     required if @DataSchemaUri@ is specified.
--
-- -   DataRearrangement - A JSON string that represents the splitting and
--     rearrangement requirements for the @Datasource@.
--
--     Sample -
--     @ \"{\\\"splitting\\\":{\\\"percentBegin\\\":10,\\\"percentEnd\\\":60}}\"@
createDataSourceFromS3_dataSpec :: Lens.Lens' CreateDataSourceFromS3 S3DataSpec
createDataSourceFromS3_dataSpec :: (S3DataSpec -> f S3DataSpec)
-> CreateDataSourceFromS3 -> f CreateDataSourceFromS3
createDataSourceFromS3_dataSpec = (CreateDataSourceFromS3 -> S3DataSpec)
-> (CreateDataSourceFromS3 -> S3DataSpec -> CreateDataSourceFromS3)
-> Lens
     CreateDataSourceFromS3 CreateDataSourceFromS3 S3DataSpec S3DataSpec
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSourceFromS3' {S3DataSpec
dataSpec :: S3DataSpec
$sel:dataSpec:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> S3DataSpec
dataSpec} -> S3DataSpec
dataSpec) (\s :: CreateDataSourceFromS3
s@CreateDataSourceFromS3' {} S3DataSpec
a -> CreateDataSourceFromS3
s {$sel:dataSpec:CreateDataSourceFromS3' :: S3DataSpec
dataSpec = S3DataSpec
a} :: CreateDataSourceFromS3)

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

instance Prelude.NFData CreateDataSourceFromS3

instance Core.ToHeaders CreateDataSourceFromS3 where
  toHeaders :: CreateDataSourceFromS3 -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDataSourceFromS3 -> 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
"AmazonML_20141212.CreateDataSourceFromS3" ::
                          Prelude.ByteString
                      ),
            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 CreateDataSourceFromS3 where
  toJSON :: CreateDataSourceFromS3 -> Value
toJSON CreateDataSourceFromS3' {Maybe Bool
Maybe Text
Text
S3DataSpec
dataSpec :: S3DataSpec
dataSourceId :: Text
computeStatistics :: Maybe Bool
dataSourceName :: Maybe Text
$sel:dataSpec:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> S3DataSpec
$sel:dataSourceId:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> Text
$sel:computeStatistics:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> Maybe Bool
$sel:dataSourceName:CreateDataSourceFromS3' :: CreateDataSourceFromS3 -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DataSourceName" 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
dataSourceName,
            (Text
"ComputeStatistics" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
computeStatistics,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DataSourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataSourceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DataSpec" Text -> S3DataSpec -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3DataSpec
dataSpec)
          ]
      )

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

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

-- | Represents the output of a @CreateDataSourceFromS3@ operation, and is an
-- acknowledgement that Amazon ML received the request.
--
-- The @CreateDataSourceFromS3@ operation is asynchronous. You can poll for
-- updates by using the @GetBatchPrediction@ operation and checking the
-- @Status@ parameter.
--
-- /See:/ 'newCreateDataSourceFromS3Response' smart constructor.
data CreateDataSourceFromS3Response = CreateDataSourceFromS3Response'
  { -- | A user-supplied ID that uniquely identifies the @DataSource@. This value
    -- should be identical to the value of the @DataSourceID@ in the request.
    CreateDataSourceFromS3Response -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateDataSourceFromS3Response -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateDataSourceFromS3Response
-> CreateDataSourceFromS3Response -> Bool
(CreateDataSourceFromS3Response
 -> CreateDataSourceFromS3Response -> Bool)
-> (CreateDataSourceFromS3Response
    -> CreateDataSourceFromS3Response -> Bool)
-> Eq CreateDataSourceFromS3Response
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataSourceFromS3Response
-> CreateDataSourceFromS3Response -> Bool
$c/= :: CreateDataSourceFromS3Response
-> CreateDataSourceFromS3Response -> Bool
== :: CreateDataSourceFromS3Response
-> CreateDataSourceFromS3Response -> Bool
$c== :: CreateDataSourceFromS3Response
-> CreateDataSourceFromS3Response -> Bool
Prelude.Eq, ReadPrec [CreateDataSourceFromS3Response]
ReadPrec CreateDataSourceFromS3Response
Int -> ReadS CreateDataSourceFromS3Response
ReadS [CreateDataSourceFromS3Response]
(Int -> ReadS CreateDataSourceFromS3Response)
-> ReadS [CreateDataSourceFromS3Response]
-> ReadPrec CreateDataSourceFromS3Response
-> ReadPrec [CreateDataSourceFromS3Response]
-> Read CreateDataSourceFromS3Response
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDataSourceFromS3Response]
$creadListPrec :: ReadPrec [CreateDataSourceFromS3Response]
readPrec :: ReadPrec CreateDataSourceFromS3Response
$creadPrec :: ReadPrec CreateDataSourceFromS3Response
readList :: ReadS [CreateDataSourceFromS3Response]
$creadList :: ReadS [CreateDataSourceFromS3Response]
readsPrec :: Int -> ReadS CreateDataSourceFromS3Response
$creadsPrec :: Int -> ReadS CreateDataSourceFromS3Response
Prelude.Read, Int -> CreateDataSourceFromS3Response -> ShowS
[CreateDataSourceFromS3Response] -> ShowS
CreateDataSourceFromS3Response -> String
(Int -> CreateDataSourceFromS3Response -> ShowS)
-> (CreateDataSourceFromS3Response -> String)
-> ([CreateDataSourceFromS3Response] -> ShowS)
-> Show CreateDataSourceFromS3Response
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataSourceFromS3Response] -> ShowS
$cshowList :: [CreateDataSourceFromS3Response] -> ShowS
show :: CreateDataSourceFromS3Response -> String
$cshow :: CreateDataSourceFromS3Response -> String
showsPrec :: Int -> CreateDataSourceFromS3Response -> ShowS
$cshowsPrec :: Int -> CreateDataSourceFromS3Response -> ShowS
Prelude.Show, (forall x.
 CreateDataSourceFromS3Response
 -> Rep CreateDataSourceFromS3Response x)
-> (forall x.
    Rep CreateDataSourceFromS3Response x
    -> CreateDataSourceFromS3Response)
-> Generic CreateDataSourceFromS3Response
forall x.
Rep CreateDataSourceFromS3Response x
-> CreateDataSourceFromS3Response
forall x.
CreateDataSourceFromS3Response
-> Rep CreateDataSourceFromS3Response x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDataSourceFromS3Response x
-> CreateDataSourceFromS3Response
$cfrom :: forall x.
CreateDataSourceFromS3Response
-> Rep CreateDataSourceFromS3Response x
Prelude.Generic)

-- |
-- Create a value of 'CreateDataSourceFromS3Response' 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:
--
-- 'dataSourceId', 'createDataSourceFromS3Response_dataSourceId' - A user-supplied ID that uniquely identifies the @DataSource@. This value
-- should be identical to the value of the @DataSourceID@ in the request.
--
-- 'httpStatus', 'createDataSourceFromS3Response_httpStatus' - The response's http status code.
newCreateDataSourceFromS3Response ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDataSourceFromS3Response
newCreateDataSourceFromS3Response :: Int -> CreateDataSourceFromS3Response
newCreateDataSourceFromS3Response Int
pHttpStatus_ =
  CreateDataSourceFromS3Response' :: Maybe Text -> Int -> CreateDataSourceFromS3Response
CreateDataSourceFromS3Response'
    { $sel:dataSourceId:CreateDataSourceFromS3Response' :: Maybe Text
dataSourceId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDataSourceFromS3Response' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A user-supplied ID that uniquely identifies the @DataSource@. This value
-- should be identical to the value of the @DataSourceID@ in the request.
createDataSourceFromS3Response_dataSourceId :: Lens.Lens' CreateDataSourceFromS3Response (Prelude.Maybe Prelude.Text)
createDataSourceFromS3Response_dataSourceId :: (Maybe Text -> f (Maybe Text))
-> CreateDataSourceFromS3Response
-> f CreateDataSourceFromS3Response
createDataSourceFromS3Response_dataSourceId = (CreateDataSourceFromS3Response -> Maybe Text)
-> (CreateDataSourceFromS3Response
    -> Maybe Text -> CreateDataSourceFromS3Response)
-> Lens
     CreateDataSourceFromS3Response
     CreateDataSourceFromS3Response
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSourceFromS3Response' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:CreateDataSourceFromS3Response' :: CreateDataSourceFromS3Response -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: CreateDataSourceFromS3Response
s@CreateDataSourceFromS3Response' {} Maybe Text
a -> CreateDataSourceFromS3Response
s {$sel:dataSourceId:CreateDataSourceFromS3Response' :: Maybe Text
dataSourceId = Maybe Text
a} :: CreateDataSourceFromS3Response)

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

instance
  Prelude.NFData
    CreateDataSourceFromS3Response