{-# 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.Forecast.DescribeDataset
-- 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)
--
-- Describes an Amazon Forecast dataset created using the CreateDataset
-- operation.
--
-- In addition to listing the parameters specified in the @CreateDataset@
-- request, this operation includes the following dataset properties:
--
-- -   @CreationTime@
--
-- -   @LastModificationTime@
--
-- -   @Status@
module Amazonka.Forecast.DescribeDataset
  ( -- * Creating a Request
    DescribeDataset (..),
    newDescribeDataset,

    -- * Request Lenses
    describeDataset_datasetArn,

    -- * Destructuring the Response
    DescribeDatasetResponse (..),
    newDescribeDatasetResponse,

    -- * Response Lenses
    describeDatasetResponse_creationTime,
    describeDatasetResponse_status,
    describeDatasetResponse_dataFrequency,
    describeDatasetResponse_datasetArn,
    describeDatasetResponse_domain,
    describeDatasetResponse_schema,
    describeDatasetResponse_datasetType,
    describeDatasetResponse_datasetName,
    describeDatasetResponse_encryptionConfig,
    describeDatasetResponse_lastModificationTime,
    describeDatasetResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeDataset' smart constructor.
data DescribeDataset = DescribeDataset'
  { -- | The Amazon Resource Name (ARN) of the dataset.
    DescribeDataset -> Text
datasetArn :: Prelude.Text
  }
  deriving (DescribeDataset -> DescribeDataset -> Bool
(DescribeDataset -> DescribeDataset -> Bool)
-> (DescribeDataset -> DescribeDataset -> Bool)
-> Eq DescribeDataset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDataset -> DescribeDataset -> Bool
$c/= :: DescribeDataset -> DescribeDataset -> Bool
== :: DescribeDataset -> DescribeDataset -> Bool
$c== :: DescribeDataset -> DescribeDataset -> Bool
Prelude.Eq, ReadPrec [DescribeDataset]
ReadPrec DescribeDataset
Int -> ReadS DescribeDataset
ReadS [DescribeDataset]
(Int -> ReadS DescribeDataset)
-> ReadS [DescribeDataset]
-> ReadPrec DescribeDataset
-> ReadPrec [DescribeDataset]
-> Read DescribeDataset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDataset]
$creadListPrec :: ReadPrec [DescribeDataset]
readPrec :: ReadPrec DescribeDataset
$creadPrec :: ReadPrec DescribeDataset
readList :: ReadS [DescribeDataset]
$creadList :: ReadS [DescribeDataset]
readsPrec :: Int -> ReadS DescribeDataset
$creadsPrec :: Int -> ReadS DescribeDataset
Prelude.Read, Int -> DescribeDataset -> ShowS
[DescribeDataset] -> ShowS
DescribeDataset -> String
(Int -> DescribeDataset -> ShowS)
-> (DescribeDataset -> String)
-> ([DescribeDataset] -> ShowS)
-> Show DescribeDataset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDataset] -> ShowS
$cshowList :: [DescribeDataset] -> ShowS
show :: DescribeDataset -> String
$cshow :: DescribeDataset -> String
showsPrec :: Int -> DescribeDataset -> ShowS
$cshowsPrec :: Int -> DescribeDataset -> ShowS
Prelude.Show, (forall x. DescribeDataset -> Rep DescribeDataset x)
-> (forall x. Rep DescribeDataset x -> DescribeDataset)
-> Generic DescribeDataset
forall x. Rep DescribeDataset x -> DescribeDataset
forall x. DescribeDataset -> Rep DescribeDataset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDataset x -> DescribeDataset
$cfrom :: forall x. DescribeDataset -> Rep DescribeDataset x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDataset' 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:
--
-- 'datasetArn', 'describeDataset_datasetArn' - The Amazon Resource Name (ARN) of the dataset.
newDescribeDataset ::
  -- | 'datasetArn'
  Prelude.Text ->
  DescribeDataset
newDescribeDataset :: Text -> DescribeDataset
newDescribeDataset Text
pDatasetArn_ =
  DescribeDataset' :: Text -> DescribeDataset
DescribeDataset' {$sel:datasetArn:DescribeDataset' :: Text
datasetArn = Text
pDatasetArn_}

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

instance Core.AWSRequest DescribeDataset where
  type
    AWSResponse DescribeDataset =
      DescribeDatasetResponse
  request :: DescribeDataset -> Request DescribeDataset
request = Service -> DescribeDataset -> Request DescribeDataset
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDataset)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeDataset))
-> Logger
-> Service
-> Proxy DescribeDataset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeDataset)))
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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Domain
-> Maybe Schema
-> Maybe DatasetType
-> Maybe Text
-> Maybe EncryptionConfig
-> Maybe POSIX
-> Int
-> DescribeDatasetResponse
DescribeDatasetResponse'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Domain
 -> Maybe Schema
 -> Maybe DatasetType
 -> Maybe Text
 -> Maybe EncryptionConfig
 -> Maybe POSIX
 -> Int
 -> DescribeDatasetResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Domain
      -> Maybe Schema
      -> Maybe DatasetType
      -> Maybe Text
      -> Maybe EncryptionConfig
      -> Maybe POSIX
      -> Int
      -> DescribeDatasetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Domain
   -> Maybe Schema
   -> Maybe DatasetType
   -> Maybe Text
   -> Maybe EncryptionConfig
   -> Maybe POSIX
   -> Int
   -> DescribeDatasetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Domain
      -> Maybe Schema
      -> Maybe DatasetType
      -> Maybe Text
      -> Maybe EncryptionConfig
      -> Maybe POSIX
      -> Int
      -> DescribeDatasetResponse)
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
"Status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Domain
   -> Maybe Schema
   -> Maybe DatasetType
   -> Maybe Text
   -> Maybe EncryptionConfig
   -> Maybe POSIX
   -> Int
   -> DescribeDatasetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Domain
      -> Maybe Schema
      -> Maybe DatasetType
      -> Maybe Text
      -> Maybe EncryptionConfig
      -> Maybe POSIX
      -> Int
      -> DescribeDatasetResponse)
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
"DataFrequency")
            Either
  String
  (Maybe Text
   -> Maybe Domain
   -> Maybe Schema
   -> Maybe DatasetType
   -> Maybe Text
   -> Maybe EncryptionConfig
   -> Maybe POSIX
   -> Int
   -> DescribeDatasetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Domain
      -> Maybe Schema
      -> Maybe DatasetType
      -> Maybe Text
      -> Maybe EncryptionConfig
      -> Maybe POSIX
      -> Int
      -> DescribeDatasetResponse)
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 Domain
   -> Maybe Schema
   -> Maybe DatasetType
   -> Maybe Text
   -> Maybe EncryptionConfig
   -> Maybe POSIX
   -> Int
   -> DescribeDatasetResponse)
-> Either String (Maybe Domain)
-> Either
     String
     (Maybe Schema
      -> Maybe DatasetType
      -> Maybe Text
      -> Maybe EncryptionConfig
      -> Maybe POSIX
      -> Int
      -> DescribeDatasetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Domain)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Domain")
            Either
  String
  (Maybe Schema
   -> Maybe DatasetType
   -> Maybe Text
   -> Maybe EncryptionConfig
   -> Maybe POSIX
   -> Int
   -> DescribeDatasetResponse)
-> Either String (Maybe Schema)
-> Either
     String
     (Maybe DatasetType
      -> Maybe Text
      -> Maybe EncryptionConfig
      -> Maybe POSIX
      -> Int
      -> DescribeDatasetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Schema)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Schema")
            Either
  String
  (Maybe DatasetType
   -> Maybe Text
   -> Maybe EncryptionConfig
   -> Maybe POSIX
   -> Int
   -> DescribeDatasetResponse)
-> Either String (Maybe DatasetType)
-> Either
     String
     (Maybe Text
      -> Maybe EncryptionConfig
      -> Maybe POSIX
      -> Int
      -> DescribeDatasetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DatasetType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DatasetType")
            Either
  String
  (Maybe Text
   -> Maybe EncryptionConfig
   -> Maybe POSIX
   -> Int
   -> DescribeDatasetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe EncryptionConfig
      -> Maybe POSIX -> Int -> DescribeDatasetResponse)
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
  (Maybe EncryptionConfig
   -> Maybe POSIX -> Int -> DescribeDatasetResponse)
-> Either String (Maybe EncryptionConfig)
-> Either String (Maybe POSIX -> Int -> DescribeDatasetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe EncryptionConfig)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EncryptionConfig")
            Either String (Maybe POSIX -> Int -> DescribeDatasetResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> DescribeDatasetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModificationTime")
            Either String (Int -> DescribeDatasetResponse)
-> Either String Int -> Either String DescribeDatasetResponse
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 DescribeDataset

instance Prelude.NFData DescribeDataset

instance Core.ToHeaders DescribeDataset where
  toHeaders :: DescribeDataset -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeDataset -> 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
"AmazonForecast.DescribeDataset" ::
                          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 DescribeDataset where
  toJSON :: DescribeDataset -> Value
toJSON DescribeDataset' {Text
datasetArn :: Text
$sel:datasetArn:DescribeDataset' :: DescribeDataset -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatasetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetArn)]
      )

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

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

-- | /See:/ 'newDescribeDatasetResponse' smart constructor.
data DescribeDatasetResponse = DescribeDatasetResponse'
  { -- | When the dataset was created.
    DescribeDatasetResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the dataset. States include:
    --
    -- -   @ACTIVE@
    --
    -- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
    --
    -- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
    --
    -- -   @UPDATE_PENDING@, @UPDATE_IN_PROGRESS@, @UPDATE_FAILED@
    --
    -- The @UPDATE@ states apply while data is imported to the dataset from a
    -- call to the CreateDatasetImportJob operation and reflect the status of
    -- the dataset import job. For example, when the import job status is
    -- @CREATE_IN_PROGRESS@, the status of the dataset is @UPDATE_IN_PROGRESS@.
    --
    -- The @Status@ of the dataset must be @ACTIVE@ before you can import
    -- training data.
    DescribeDatasetResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The frequency of data collection.
    --
    -- Valid intervals are Y (Year), M (Month), W (Week), D (Day), H (Hour),
    -- 30min (30 minutes), 15min (15 minutes), 10min (10 minutes), 5min (5
    -- minutes), and 1min (1 minute). For example, \"M\" indicates every month
    -- and \"30min\" indicates every 30 minutes.
    DescribeDatasetResponse -> Maybe Text
dataFrequency :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the dataset.
    DescribeDatasetResponse -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
    -- | The domain associated with the dataset.
    DescribeDatasetResponse -> Maybe Domain
domain :: Prelude.Maybe Domain,
    -- | An array of @SchemaAttribute@ objects that specify the dataset fields.
    -- Each @SchemaAttribute@ specifies the name and data type of a field.
    DescribeDatasetResponse -> Maybe Schema
schema :: Prelude.Maybe Schema,
    -- | The dataset type.
    DescribeDatasetResponse -> Maybe DatasetType
datasetType :: Prelude.Maybe DatasetType,
    -- | The name of the dataset.
    DescribeDatasetResponse -> Maybe Text
datasetName :: Prelude.Maybe Prelude.Text,
    -- | The AWS Key Management Service (KMS) key and the AWS Identity and Access
    -- Management (IAM) role that Amazon Forecast can assume to access the key.
    DescribeDatasetResponse -> Maybe EncryptionConfig
encryptionConfig :: Prelude.Maybe EncryptionConfig,
    -- | When you create a dataset, @LastModificationTime@ is the same as
    -- @CreationTime@. While data is being imported to the dataset,
    -- @LastModificationTime@ is the current time of the @DescribeDataset@
    -- call. After a CreateDatasetImportJob operation has finished,
    -- @LastModificationTime@ is when the import job completed or failed.
    DescribeDatasetResponse -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    DescribeDatasetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
(DescribeDatasetResponse -> DescribeDatasetResponse -> Bool)
-> (DescribeDatasetResponse -> DescribeDatasetResponse -> Bool)
-> Eq DescribeDatasetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
$c/= :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
== :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
$c== :: DescribeDatasetResponse -> DescribeDatasetResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDatasetResponse]
ReadPrec DescribeDatasetResponse
Int -> ReadS DescribeDatasetResponse
ReadS [DescribeDatasetResponse]
(Int -> ReadS DescribeDatasetResponse)
-> ReadS [DescribeDatasetResponse]
-> ReadPrec DescribeDatasetResponse
-> ReadPrec [DescribeDatasetResponse]
-> Read DescribeDatasetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDatasetResponse]
$creadListPrec :: ReadPrec [DescribeDatasetResponse]
readPrec :: ReadPrec DescribeDatasetResponse
$creadPrec :: ReadPrec DescribeDatasetResponse
readList :: ReadS [DescribeDatasetResponse]
$creadList :: ReadS [DescribeDatasetResponse]
readsPrec :: Int -> ReadS DescribeDatasetResponse
$creadsPrec :: Int -> ReadS DescribeDatasetResponse
Prelude.Read, Int -> DescribeDatasetResponse -> ShowS
[DescribeDatasetResponse] -> ShowS
DescribeDatasetResponse -> String
(Int -> DescribeDatasetResponse -> ShowS)
-> (DescribeDatasetResponse -> String)
-> ([DescribeDatasetResponse] -> ShowS)
-> Show DescribeDatasetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDatasetResponse] -> ShowS
$cshowList :: [DescribeDatasetResponse] -> ShowS
show :: DescribeDatasetResponse -> String
$cshow :: DescribeDatasetResponse -> String
showsPrec :: Int -> DescribeDatasetResponse -> ShowS
$cshowsPrec :: Int -> DescribeDatasetResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDatasetResponse -> Rep DescribeDatasetResponse x)
-> (forall x.
    Rep DescribeDatasetResponse x -> DescribeDatasetResponse)
-> Generic DescribeDatasetResponse
forall x. Rep DescribeDatasetResponse x -> DescribeDatasetResponse
forall x. DescribeDatasetResponse -> Rep DescribeDatasetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDatasetResponse x -> DescribeDatasetResponse
$cfrom :: forall x. DescribeDatasetResponse -> Rep DescribeDatasetResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDatasetResponse' 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:
--
-- 'creationTime', 'describeDatasetResponse_creationTime' - When the dataset was created.
--
-- 'status', 'describeDatasetResponse_status' - The status of the dataset. States include:
--
-- -   @ACTIVE@
--
-- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
--
-- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
--
-- -   @UPDATE_PENDING@, @UPDATE_IN_PROGRESS@, @UPDATE_FAILED@
--
-- The @UPDATE@ states apply while data is imported to the dataset from a
-- call to the CreateDatasetImportJob operation and reflect the status of
-- the dataset import job. For example, when the import job status is
-- @CREATE_IN_PROGRESS@, the status of the dataset is @UPDATE_IN_PROGRESS@.
--
-- The @Status@ of the dataset must be @ACTIVE@ before you can import
-- training data.
--
-- 'dataFrequency', 'describeDatasetResponse_dataFrequency' - The frequency of data collection.
--
-- Valid intervals are Y (Year), M (Month), W (Week), D (Day), H (Hour),
-- 30min (30 minutes), 15min (15 minutes), 10min (10 minutes), 5min (5
-- minutes), and 1min (1 minute). For example, \"M\" indicates every month
-- and \"30min\" indicates every 30 minutes.
--
-- 'datasetArn', 'describeDatasetResponse_datasetArn' - The Amazon Resource Name (ARN) of the dataset.
--
-- 'domain', 'describeDatasetResponse_domain' - The domain associated with the dataset.
--
-- 'schema', 'describeDatasetResponse_schema' - An array of @SchemaAttribute@ objects that specify the dataset fields.
-- Each @SchemaAttribute@ specifies the name and data type of a field.
--
-- 'datasetType', 'describeDatasetResponse_datasetType' - The dataset type.
--
-- 'datasetName', 'describeDatasetResponse_datasetName' - The name of the dataset.
--
-- 'encryptionConfig', 'describeDatasetResponse_encryptionConfig' - The AWS Key Management Service (KMS) key and the AWS Identity and Access
-- Management (IAM) role that Amazon Forecast can assume to access the key.
--
-- 'lastModificationTime', 'describeDatasetResponse_lastModificationTime' - When you create a dataset, @LastModificationTime@ is the same as
-- @CreationTime@. While data is being imported to the dataset,
-- @LastModificationTime@ is the current time of the @DescribeDataset@
-- call. After a CreateDatasetImportJob operation has finished,
-- @LastModificationTime@ is when the import job completed or failed.
--
-- 'httpStatus', 'describeDatasetResponse_httpStatus' - The response's http status code.
newDescribeDatasetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDatasetResponse
newDescribeDatasetResponse :: Int -> DescribeDatasetResponse
newDescribeDatasetResponse Int
pHttpStatus_ =
  DescribeDatasetResponse' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Domain
-> Maybe Schema
-> Maybe DatasetType
-> Maybe Text
-> Maybe EncryptionConfig
-> Maybe POSIX
-> Int
-> DescribeDatasetResponse
DescribeDatasetResponse'
    { $sel:creationTime:DescribeDatasetResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeDatasetResponse' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataFrequency:DescribeDatasetResponse' :: Maybe Text
dataFrequency = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetArn:DescribeDatasetResponse' :: Maybe Text
datasetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domain:DescribeDatasetResponse' :: Maybe Domain
domain = Maybe Domain
forall a. Maybe a
Prelude.Nothing,
      $sel:schema:DescribeDatasetResponse' :: Maybe Schema
schema = Maybe Schema
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetType:DescribeDatasetResponse' :: Maybe DatasetType
datasetType = Maybe DatasetType
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetName:DescribeDatasetResponse' :: Maybe Text
datasetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionConfig:DescribeDatasetResponse' :: Maybe EncryptionConfig
encryptionConfig = Maybe EncryptionConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:DescribeDatasetResponse' :: Maybe POSIX
lastModificationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDatasetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | When the dataset was created.
describeDatasetResponse_creationTime :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe Prelude.UTCTime)
describeDatasetResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_creationTime = (DescribeDatasetResponse -> Maybe POSIX)
-> (DescribeDatasetResponse
    -> Maybe POSIX -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe POSIX
a -> DescribeDatasetResponse
s {$sel:creationTime:DescribeDatasetResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeDatasetResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeDatasetResponse -> f DescribeDatasetResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDatasetResponse
-> f DescribeDatasetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the dataset. States include:
--
-- -   @ACTIVE@
--
-- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
--
-- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
--
-- -   @UPDATE_PENDING@, @UPDATE_IN_PROGRESS@, @UPDATE_FAILED@
--
-- The @UPDATE@ states apply while data is imported to the dataset from a
-- call to the CreateDatasetImportJob operation and reflect the status of
-- the dataset import job. For example, when the import job status is
-- @CREATE_IN_PROGRESS@, the status of the dataset is @UPDATE_IN_PROGRESS@.
--
-- The @Status@ of the dataset must be @ACTIVE@ before you can import
-- training data.
describeDatasetResponse_status :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe Prelude.Text)
describeDatasetResponse_status :: (Maybe Text -> f (Maybe Text))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_status = (DescribeDatasetResponse -> Maybe Text)
-> (DescribeDatasetResponse
    -> Maybe Text -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe Text
status :: Maybe Text
$sel:status:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe Text
a -> DescribeDatasetResponse
s {$sel:status:DescribeDatasetResponse' :: Maybe Text
status = Maybe Text
a} :: DescribeDatasetResponse)

-- | The frequency of data collection.
--
-- Valid intervals are Y (Year), M (Month), W (Week), D (Day), H (Hour),
-- 30min (30 minutes), 15min (15 minutes), 10min (10 minutes), 5min (5
-- minutes), and 1min (1 minute). For example, \"M\" indicates every month
-- and \"30min\" indicates every 30 minutes.
describeDatasetResponse_dataFrequency :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe Prelude.Text)
describeDatasetResponse_dataFrequency :: (Maybe Text -> f (Maybe Text))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_dataFrequency = (DescribeDatasetResponse -> Maybe Text)
-> (DescribeDatasetResponse
    -> Maybe Text -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe Text
dataFrequency :: Maybe Text
$sel:dataFrequency:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe Text
dataFrequency} -> Maybe Text
dataFrequency) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe Text
a -> DescribeDatasetResponse
s {$sel:dataFrequency:DescribeDatasetResponse' :: Maybe Text
dataFrequency = Maybe Text
a} :: DescribeDatasetResponse)

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

-- | The domain associated with the dataset.
describeDatasetResponse_domain :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe Domain)
describeDatasetResponse_domain :: (Maybe Domain -> f (Maybe Domain))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_domain = (DescribeDatasetResponse -> Maybe Domain)
-> (DescribeDatasetResponse
    -> Maybe Domain -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe Domain)
     (Maybe Domain)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe Domain
domain :: Maybe Domain
$sel:domain:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe Domain
domain} -> Maybe Domain
domain) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe Domain
a -> DescribeDatasetResponse
s {$sel:domain:DescribeDatasetResponse' :: Maybe Domain
domain = Maybe Domain
a} :: DescribeDatasetResponse)

-- | An array of @SchemaAttribute@ objects that specify the dataset fields.
-- Each @SchemaAttribute@ specifies the name and data type of a field.
describeDatasetResponse_schema :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe Schema)
describeDatasetResponse_schema :: (Maybe Schema -> f (Maybe Schema))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_schema = (DescribeDatasetResponse -> Maybe Schema)
-> (DescribeDatasetResponse
    -> Maybe Schema -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe Schema)
     (Maybe Schema)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe Schema
schema :: Maybe Schema
$sel:schema:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe Schema
schema} -> Maybe Schema
schema) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe Schema
a -> DescribeDatasetResponse
s {$sel:schema:DescribeDatasetResponse' :: Maybe Schema
schema = Maybe Schema
a} :: DescribeDatasetResponse)

-- | The dataset type.
describeDatasetResponse_datasetType :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe DatasetType)
describeDatasetResponse_datasetType :: (Maybe DatasetType -> f (Maybe DatasetType))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_datasetType = (DescribeDatasetResponse -> Maybe DatasetType)
-> (DescribeDatasetResponse
    -> Maybe DatasetType -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe DatasetType)
     (Maybe DatasetType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe DatasetType
datasetType :: Maybe DatasetType
$sel:datasetType:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe DatasetType
datasetType} -> Maybe DatasetType
datasetType) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe DatasetType
a -> DescribeDatasetResponse
s {$sel:datasetType:DescribeDatasetResponse' :: Maybe DatasetType
datasetType = Maybe DatasetType
a} :: DescribeDatasetResponse)

-- | The name of the dataset.
describeDatasetResponse_datasetName :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe Prelude.Text)
describeDatasetResponse_datasetName :: (Maybe Text -> f (Maybe Text))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_datasetName = (DescribeDatasetResponse -> Maybe Text)
-> (DescribeDatasetResponse
    -> Maybe Text -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe Text
datasetName :: Maybe Text
$sel:datasetName:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe Text
datasetName} -> Maybe Text
datasetName) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe Text
a -> DescribeDatasetResponse
s {$sel:datasetName:DescribeDatasetResponse' :: Maybe Text
datasetName = Maybe Text
a} :: DescribeDatasetResponse)

-- | The AWS Key Management Service (KMS) key and the AWS Identity and Access
-- Management (IAM) role that Amazon Forecast can assume to access the key.
describeDatasetResponse_encryptionConfig :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe EncryptionConfig)
describeDatasetResponse_encryptionConfig :: (Maybe EncryptionConfig -> f (Maybe EncryptionConfig))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_encryptionConfig = (DescribeDatasetResponse -> Maybe EncryptionConfig)
-> (DescribeDatasetResponse
    -> Maybe EncryptionConfig -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe EncryptionConfig)
     (Maybe EncryptionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe EncryptionConfig
encryptionConfig :: Maybe EncryptionConfig
$sel:encryptionConfig:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe EncryptionConfig
encryptionConfig} -> Maybe EncryptionConfig
encryptionConfig) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe EncryptionConfig
a -> DescribeDatasetResponse
s {$sel:encryptionConfig:DescribeDatasetResponse' :: Maybe EncryptionConfig
encryptionConfig = Maybe EncryptionConfig
a} :: DescribeDatasetResponse)

-- | When you create a dataset, @LastModificationTime@ is the same as
-- @CreationTime@. While data is being imported to the dataset,
-- @LastModificationTime@ is the current time of the @DescribeDataset@
-- call. After a CreateDatasetImportJob operation has finished,
-- @LastModificationTime@ is when the import job completed or failed.
describeDatasetResponse_lastModificationTime :: Lens.Lens' DescribeDatasetResponse (Prelude.Maybe Prelude.UTCTime)
describeDatasetResponse_lastModificationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDatasetResponse -> f DescribeDatasetResponse
describeDatasetResponse_lastModificationTime = (DescribeDatasetResponse -> Maybe POSIX)
-> (DescribeDatasetResponse
    -> Maybe POSIX -> DescribeDatasetResponse)
-> Lens
     DescribeDatasetResponse
     DescribeDatasetResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDatasetResponse' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:DescribeDatasetResponse' :: DescribeDatasetResponse -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: DescribeDatasetResponse
s@DescribeDatasetResponse' {} Maybe POSIX
a -> DescribeDatasetResponse
s {$sel:lastModificationTime:DescribeDatasetResponse' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: DescribeDatasetResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeDatasetResponse -> f DescribeDatasetResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDatasetResponse
-> f DescribeDatasetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Prelude.NFData DescribeDatasetResponse