{-# 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.LexModels.GetImport
-- 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)
--
-- Gets information about an import job started with the @StartImport@
-- operation.
module Amazonka.LexModels.GetImport
  ( -- * Creating a Request
    GetImport (..),
    newGetImport,

    -- * Request Lenses
    getImport_importId,

    -- * Destructuring the Response
    GetImportResponse (..),
    newGetImportResponse,

    -- * Response Lenses
    getImportResponse_failureReason,
    getImportResponse_resourceType,
    getImportResponse_importId,
    getImportResponse_createdDate,
    getImportResponse_name,
    getImportResponse_mergeStrategy,
    getImportResponse_importStatus,
    getImportResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetImport' smart constructor.
data GetImport = GetImport'
  { -- | The identifier of the import job information to return.
    GetImport -> Text
importId :: Prelude.Text
  }
  deriving (GetImport -> GetImport -> Bool
(GetImport -> GetImport -> Bool)
-> (GetImport -> GetImport -> Bool) -> Eq GetImport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetImport -> GetImport -> Bool
$c/= :: GetImport -> GetImport -> Bool
== :: GetImport -> GetImport -> Bool
$c== :: GetImport -> GetImport -> Bool
Prelude.Eq, ReadPrec [GetImport]
ReadPrec GetImport
Int -> ReadS GetImport
ReadS [GetImport]
(Int -> ReadS GetImport)
-> ReadS [GetImport]
-> ReadPrec GetImport
-> ReadPrec [GetImport]
-> Read GetImport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetImport]
$creadListPrec :: ReadPrec [GetImport]
readPrec :: ReadPrec GetImport
$creadPrec :: ReadPrec GetImport
readList :: ReadS [GetImport]
$creadList :: ReadS [GetImport]
readsPrec :: Int -> ReadS GetImport
$creadsPrec :: Int -> ReadS GetImport
Prelude.Read, Int -> GetImport -> ShowS
[GetImport] -> ShowS
GetImport -> String
(Int -> GetImport -> ShowS)
-> (GetImport -> String)
-> ([GetImport] -> ShowS)
-> Show GetImport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetImport] -> ShowS
$cshowList :: [GetImport] -> ShowS
show :: GetImport -> String
$cshow :: GetImport -> String
showsPrec :: Int -> GetImport -> ShowS
$cshowsPrec :: Int -> GetImport -> ShowS
Prelude.Show, (forall x. GetImport -> Rep GetImport x)
-> (forall x. Rep GetImport x -> GetImport) -> Generic GetImport
forall x. Rep GetImport x -> GetImport
forall x. GetImport -> Rep GetImport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetImport x -> GetImport
$cfrom :: forall x. GetImport -> Rep GetImport x
Prelude.Generic)

-- |
-- Create a value of 'GetImport' 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:
--
-- 'importId', 'getImport_importId' - The identifier of the import job information to return.
newGetImport ::
  -- | 'importId'
  Prelude.Text ->
  GetImport
newGetImport :: Text -> GetImport
newGetImport Text
pImportId_ =
  GetImport' :: Text -> GetImport
GetImport' {$sel:importId:GetImport' :: Text
importId = Text
pImportId_}

-- | The identifier of the import job information to return.
getImport_importId :: Lens.Lens' GetImport Prelude.Text
getImport_importId :: (Text -> f Text) -> GetImport -> f GetImport
getImport_importId = (GetImport -> Text)
-> (GetImport -> Text -> GetImport)
-> Lens GetImport GetImport Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImport' {Text
importId :: Text
$sel:importId:GetImport' :: GetImport -> Text
importId} -> Text
importId) (\s :: GetImport
s@GetImport' {} Text
a -> GetImport
s {$sel:importId:GetImport' :: Text
importId = Text
a} :: GetImport)

instance Core.AWSRequest GetImport where
  type AWSResponse GetImport = GetImportResponse
  request :: GetImport -> Request GetImport
request = Service -> GetImport -> Request GetImport
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetImport
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetImport)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetImport))
-> Logger
-> Service
-> Proxy GetImport
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetImport)))
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]
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe MergeStrategy
-> Maybe ImportStatus
-> Int
-> GetImportResponse
GetImportResponse'
            (Maybe [Text]
 -> Maybe ResourceType
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe MergeStrategy
 -> Maybe ImportStatus
 -> Int
 -> GetImportResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe ResourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe MergeStrategy
      -> Maybe ImportStatus
      -> Int
      -> GetImportResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failureReason" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe ResourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe MergeStrategy
   -> Maybe ImportStatus
   -> Int
   -> GetImportResponse)
-> Either String (Maybe ResourceType)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe MergeStrategy
      -> Maybe ImportStatus
      -> Int
      -> GetImportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"resourceType")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe MergeStrategy
   -> Maybe ImportStatus
   -> Int
   -> GetImportResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe MergeStrategy
      -> Maybe ImportStatus
      -> Int
      -> GetImportResponse)
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
"importId")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe MergeStrategy
   -> Maybe ImportStatus
   -> Int
   -> GetImportResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe MergeStrategy
      -> Maybe ImportStatus
      -> Int
      -> GetImportResponse)
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
"createdDate")
            Either
  String
  (Maybe Text
   -> Maybe MergeStrategy
   -> Maybe ImportStatus
   -> Int
   -> GetImportResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe MergeStrategy
      -> Maybe ImportStatus -> Int -> GetImportResponse)
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
"name")
            Either
  String
  (Maybe MergeStrategy
   -> Maybe ImportStatus -> Int -> GetImportResponse)
-> Either String (Maybe MergeStrategy)
-> Either String (Maybe ImportStatus -> Int -> GetImportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe MergeStrategy)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"mergeStrategy")
            Either String (Maybe ImportStatus -> Int -> GetImportResponse)
-> Either String (Maybe ImportStatus)
-> Either String (Int -> GetImportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ImportStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"importStatus")
            Either String (Int -> GetImportResponse)
-> Either String Int -> Either String GetImportResponse
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 GetImport

instance Prelude.NFData GetImport

instance Core.ToHeaders GetImport where
  toHeaders :: GetImport -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetImport -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath GetImport where
  toPath :: GetImport -> ByteString
toPath GetImport' {Text
importId :: Text
$sel:importId:GetImport' :: GetImport -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/imports/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
importId]

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

-- | /See:/ 'newGetImportResponse' smart constructor.
data GetImportResponse = GetImportResponse'
  { -- | A string that describes why an import job failed to complete.
    GetImportResponse -> Maybe [Text]
failureReason :: Prelude.Maybe [Prelude.Text],
    -- | The type of resource imported.
    GetImportResponse -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | The identifier for the specific import job.
    GetImportResponse -> Maybe Text
importId :: Prelude.Maybe Prelude.Text,
    -- | A timestamp for the date and time that the import job was created.
    GetImportResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name given to the import job.
    GetImportResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The action taken when there was a conflict between an existing resource
    -- and a resource in the import file.
    GetImportResponse -> Maybe MergeStrategy
mergeStrategy :: Prelude.Maybe MergeStrategy,
    -- | The status of the import job. If the status is @FAILED@, you can get the
    -- reason for the failure from the @failureReason@ field.
    GetImportResponse -> Maybe ImportStatus
importStatus :: Prelude.Maybe ImportStatus,
    -- | The response's http status code.
    GetImportResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetImportResponse -> GetImportResponse -> Bool
(GetImportResponse -> GetImportResponse -> Bool)
-> (GetImportResponse -> GetImportResponse -> Bool)
-> Eq GetImportResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetImportResponse -> GetImportResponse -> Bool
$c/= :: GetImportResponse -> GetImportResponse -> Bool
== :: GetImportResponse -> GetImportResponse -> Bool
$c== :: GetImportResponse -> GetImportResponse -> Bool
Prelude.Eq, ReadPrec [GetImportResponse]
ReadPrec GetImportResponse
Int -> ReadS GetImportResponse
ReadS [GetImportResponse]
(Int -> ReadS GetImportResponse)
-> ReadS [GetImportResponse]
-> ReadPrec GetImportResponse
-> ReadPrec [GetImportResponse]
-> Read GetImportResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetImportResponse]
$creadListPrec :: ReadPrec [GetImportResponse]
readPrec :: ReadPrec GetImportResponse
$creadPrec :: ReadPrec GetImportResponse
readList :: ReadS [GetImportResponse]
$creadList :: ReadS [GetImportResponse]
readsPrec :: Int -> ReadS GetImportResponse
$creadsPrec :: Int -> ReadS GetImportResponse
Prelude.Read, Int -> GetImportResponse -> ShowS
[GetImportResponse] -> ShowS
GetImportResponse -> String
(Int -> GetImportResponse -> ShowS)
-> (GetImportResponse -> String)
-> ([GetImportResponse] -> ShowS)
-> Show GetImportResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetImportResponse] -> ShowS
$cshowList :: [GetImportResponse] -> ShowS
show :: GetImportResponse -> String
$cshow :: GetImportResponse -> String
showsPrec :: Int -> GetImportResponse -> ShowS
$cshowsPrec :: Int -> GetImportResponse -> ShowS
Prelude.Show, (forall x. GetImportResponse -> Rep GetImportResponse x)
-> (forall x. Rep GetImportResponse x -> GetImportResponse)
-> Generic GetImportResponse
forall x. Rep GetImportResponse x -> GetImportResponse
forall x. GetImportResponse -> Rep GetImportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetImportResponse x -> GetImportResponse
$cfrom :: forall x. GetImportResponse -> Rep GetImportResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetImportResponse' 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:
--
-- 'failureReason', 'getImportResponse_failureReason' - A string that describes why an import job failed to complete.
--
-- 'resourceType', 'getImportResponse_resourceType' - The type of resource imported.
--
-- 'importId', 'getImportResponse_importId' - The identifier for the specific import job.
--
-- 'createdDate', 'getImportResponse_createdDate' - A timestamp for the date and time that the import job was created.
--
-- 'name', 'getImportResponse_name' - The name given to the import job.
--
-- 'mergeStrategy', 'getImportResponse_mergeStrategy' - The action taken when there was a conflict between an existing resource
-- and a resource in the import file.
--
-- 'importStatus', 'getImportResponse_importStatus' - The status of the import job. If the status is @FAILED@, you can get the
-- reason for the failure from the @failureReason@ field.
--
-- 'httpStatus', 'getImportResponse_httpStatus' - The response's http status code.
newGetImportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetImportResponse
newGetImportResponse :: Int -> GetImportResponse
newGetImportResponse Int
pHttpStatus_ =
  GetImportResponse' :: Maybe [Text]
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe MergeStrategy
-> Maybe ImportStatus
-> Int
-> GetImportResponse
GetImportResponse'
    { $sel:failureReason:GetImportResponse' :: Maybe [Text]
failureReason = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:GetImportResponse' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:importId:GetImportResponse' :: Maybe Text
importId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:GetImportResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetImportResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mergeStrategy:GetImportResponse' :: Maybe MergeStrategy
mergeStrategy = Maybe MergeStrategy
forall a. Maybe a
Prelude.Nothing,
      $sel:importStatus:GetImportResponse' :: Maybe ImportStatus
importStatus = Maybe ImportStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetImportResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A string that describes why an import job failed to complete.
getImportResponse_failureReason :: Lens.Lens' GetImportResponse (Prelude.Maybe [Prelude.Text])
getImportResponse_failureReason :: (Maybe [Text] -> f (Maybe [Text]))
-> GetImportResponse -> f GetImportResponse
getImportResponse_failureReason = (GetImportResponse -> Maybe [Text])
-> (GetImportResponse -> Maybe [Text] -> GetImportResponse)
-> Lens
     GetImportResponse GetImportResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportResponse' {Maybe [Text]
failureReason :: Maybe [Text]
$sel:failureReason:GetImportResponse' :: GetImportResponse -> Maybe [Text]
failureReason} -> Maybe [Text]
failureReason) (\s :: GetImportResponse
s@GetImportResponse' {} Maybe [Text]
a -> GetImportResponse
s {$sel:failureReason:GetImportResponse' :: Maybe [Text]
failureReason = Maybe [Text]
a} :: GetImportResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetImportResponse -> f GetImportResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetImportResponse
-> f GetImportResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of resource imported.
getImportResponse_resourceType :: Lens.Lens' GetImportResponse (Prelude.Maybe ResourceType)
getImportResponse_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> GetImportResponse -> f GetImportResponse
getImportResponse_resourceType = (GetImportResponse -> Maybe ResourceType)
-> (GetImportResponse -> Maybe ResourceType -> GetImportResponse)
-> Lens
     GetImportResponse
     GetImportResponse
     (Maybe ResourceType)
     (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportResponse' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:GetImportResponse' :: GetImportResponse -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: GetImportResponse
s@GetImportResponse' {} Maybe ResourceType
a -> GetImportResponse
s {$sel:resourceType:GetImportResponse' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: GetImportResponse)

-- | The identifier for the specific import job.
getImportResponse_importId :: Lens.Lens' GetImportResponse (Prelude.Maybe Prelude.Text)
getImportResponse_importId :: (Maybe Text -> f (Maybe Text))
-> GetImportResponse -> f GetImportResponse
getImportResponse_importId = (GetImportResponse -> Maybe Text)
-> (GetImportResponse -> Maybe Text -> GetImportResponse)
-> Lens
     GetImportResponse GetImportResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportResponse' {Maybe Text
importId :: Maybe Text
$sel:importId:GetImportResponse' :: GetImportResponse -> Maybe Text
importId} -> Maybe Text
importId) (\s :: GetImportResponse
s@GetImportResponse' {} Maybe Text
a -> GetImportResponse
s {$sel:importId:GetImportResponse' :: Maybe Text
importId = Maybe Text
a} :: GetImportResponse)

-- | A timestamp for the date and time that the import job was created.
getImportResponse_createdDate :: Lens.Lens' GetImportResponse (Prelude.Maybe Prelude.UTCTime)
getImportResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetImportResponse -> f GetImportResponse
getImportResponse_createdDate = (GetImportResponse -> Maybe POSIX)
-> (GetImportResponse -> Maybe POSIX -> GetImportResponse)
-> Lens
     GetImportResponse GetImportResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:GetImportResponse' :: GetImportResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: GetImportResponse
s@GetImportResponse' {} Maybe POSIX
a -> GetImportResponse
s {$sel:createdDate:GetImportResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: GetImportResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetImportResponse -> f GetImportResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetImportResponse
-> f GetImportResponse
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 name given to the import job.
getImportResponse_name :: Lens.Lens' GetImportResponse (Prelude.Maybe Prelude.Text)
getImportResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetImportResponse -> f GetImportResponse
getImportResponse_name = (GetImportResponse -> Maybe Text)
-> (GetImportResponse -> Maybe Text -> GetImportResponse)
-> Lens
     GetImportResponse GetImportResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetImportResponse' :: GetImportResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetImportResponse
s@GetImportResponse' {} Maybe Text
a -> GetImportResponse
s {$sel:name:GetImportResponse' :: Maybe Text
name = Maybe Text
a} :: GetImportResponse)

-- | The action taken when there was a conflict between an existing resource
-- and a resource in the import file.
getImportResponse_mergeStrategy :: Lens.Lens' GetImportResponse (Prelude.Maybe MergeStrategy)
getImportResponse_mergeStrategy :: (Maybe MergeStrategy -> f (Maybe MergeStrategy))
-> GetImportResponse -> f GetImportResponse
getImportResponse_mergeStrategy = (GetImportResponse -> Maybe MergeStrategy)
-> (GetImportResponse -> Maybe MergeStrategy -> GetImportResponse)
-> Lens
     GetImportResponse
     GetImportResponse
     (Maybe MergeStrategy)
     (Maybe MergeStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportResponse' {Maybe MergeStrategy
mergeStrategy :: Maybe MergeStrategy
$sel:mergeStrategy:GetImportResponse' :: GetImportResponse -> Maybe MergeStrategy
mergeStrategy} -> Maybe MergeStrategy
mergeStrategy) (\s :: GetImportResponse
s@GetImportResponse' {} Maybe MergeStrategy
a -> GetImportResponse
s {$sel:mergeStrategy:GetImportResponse' :: Maybe MergeStrategy
mergeStrategy = Maybe MergeStrategy
a} :: GetImportResponse)

-- | The status of the import job. If the status is @FAILED@, you can get the
-- reason for the failure from the @failureReason@ field.
getImportResponse_importStatus :: Lens.Lens' GetImportResponse (Prelude.Maybe ImportStatus)
getImportResponse_importStatus :: (Maybe ImportStatus -> f (Maybe ImportStatus))
-> GetImportResponse -> f GetImportResponse
getImportResponse_importStatus = (GetImportResponse -> Maybe ImportStatus)
-> (GetImportResponse -> Maybe ImportStatus -> GetImportResponse)
-> Lens
     GetImportResponse
     GetImportResponse
     (Maybe ImportStatus)
     (Maybe ImportStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetImportResponse' {Maybe ImportStatus
importStatus :: Maybe ImportStatus
$sel:importStatus:GetImportResponse' :: GetImportResponse -> Maybe ImportStatus
importStatus} -> Maybe ImportStatus
importStatus) (\s :: GetImportResponse
s@GetImportResponse' {} Maybe ImportStatus
a -> GetImportResponse
s {$sel:importStatus:GetImportResponse' :: Maybe ImportStatus
importStatus = Maybe ImportStatus
a} :: GetImportResponse)

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

instance Prelude.NFData GetImportResponse