{-# 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.IoTThingsGraph.UploadEntityDefinitions
-- 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)
--
-- Asynchronously uploads one or more entity definitions to the user\'s
-- namespace. The @document@ parameter is required if
-- @syncWithPublicNamespace@ and @deleteExistingEntites@ are false. If the
-- @syncWithPublicNamespace@ parameter is set to @true@, the user\'s
-- namespace will synchronize with the latest version of the public
-- namespace. If @deprecateExistingEntities@ is set to true, all entities
-- in the latest version will be deleted before the new
-- @DefinitionDocument@ is uploaded.
--
-- When a user uploads entity definitions for the first time, the service
-- creates a new namespace for the user. The new namespace tracks the
-- public namespace. Currently users can have only one namespace. The
-- namespace version increments whenever a user uploads entity definitions
-- that are backwards-incompatible and whenever a user sets the
-- @syncWithPublicNamespace@ parameter or the @deprecateExistingEntities@
-- parameter to @true@.
--
-- The IDs for all of the entities should be in URN format. Each entity
-- must be in the user\'s namespace. Users can\'t create entities in the
-- public namespace, but entity definitions can refer to entities in the
-- public namespace.
--
-- Valid entities are @Device@, @DeviceModel@, @Service@, @Capability@,
-- @State@, @Action@, @Event@, @Property@, @Mapping@, @Enum@.
module Amazonka.IoTThingsGraph.UploadEntityDefinitions
  ( -- * Creating a Request
    UploadEntityDefinitions (..),
    newUploadEntityDefinitions,

    -- * Request Lenses
    uploadEntityDefinitions_syncWithPublicNamespace,
    uploadEntityDefinitions_deprecateExistingEntities,
    uploadEntityDefinitions_document,

    -- * Destructuring the Response
    UploadEntityDefinitionsResponse (..),
    newUploadEntityDefinitionsResponse,

    -- * Response Lenses
    uploadEntityDefinitionsResponse_httpStatus,
    uploadEntityDefinitionsResponse_uploadId,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTThingsGraph.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:/ 'newUploadEntityDefinitions' smart constructor.
data UploadEntityDefinitions = UploadEntityDefinitions'
  { -- | A Boolean that specifies whether to synchronize with the latest version
    -- of the public namespace. If set to @true@, the upload will create a new
    -- namespace version.
    UploadEntityDefinitions -> Maybe Bool
syncWithPublicNamespace :: Prelude.Maybe Prelude.Bool,
    -- | A Boolean that specifies whether to deprecate all entities in the latest
    -- version before uploading the new @DefinitionDocument@. If set to @true@,
    -- the upload will create a new namespace version.
    UploadEntityDefinitions -> Maybe Bool
deprecateExistingEntities :: Prelude.Maybe Prelude.Bool,
    -- | The @DefinitionDocument@ that defines the updated entities.
    UploadEntityDefinitions -> Maybe DefinitionDocument
document :: Prelude.Maybe DefinitionDocument
  }
  deriving (UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
(UploadEntityDefinitions -> UploadEntityDefinitions -> Bool)
-> (UploadEntityDefinitions -> UploadEntityDefinitions -> Bool)
-> Eq UploadEntityDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
$c/= :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
== :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
$c== :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
Prelude.Eq, ReadPrec [UploadEntityDefinitions]
ReadPrec UploadEntityDefinitions
Int -> ReadS UploadEntityDefinitions
ReadS [UploadEntityDefinitions]
(Int -> ReadS UploadEntityDefinitions)
-> ReadS [UploadEntityDefinitions]
-> ReadPrec UploadEntityDefinitions
-> ReadPrec [UploadEntityDefinitions]
-> Read UploadEntityDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadEntityDefinitions]
$creadListPrec :: ReadPrec [UploadEntityDefinitions]
readPrec :: ReadPrec UploadEntityDefinitions
$creadPrec :: ReadPrec UploadEntityDefinitions
readList :: ReadS [UploadEntityDefinitions]
$creadList :: ReadS [UploadEntityDefinitions]
readsPrec :: Int -> ReadS UploadEntityDefinitions
$creadsPrec :: Int -> ReadS UploadEntityDefinitions
Prelude.Read, Int -> UploadEntityDefinitions -> ShowS
[UploadEntityDefinitions] -> ShowS
UploadEntityDefinitions -> String
(Int -> UploadEntityDefinitions -> ShowS)
-> (UploadEntityDefinitions -> String)
-> ([UploadEntityDefinitions] -> ShowS)
-> Show UploadEntityDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadEntityDefinitions] -> ShowS
$cshowList :: [UploadEntityDefinitions] -> ShowS
show :: UploadEntityDefinitions -> String
$cshow :: UploadEntityDefinitions -> String
showsPrec :: Int -> UploadEntityDefinitions -> ShowS
$cshowsPrec :: Int -> UploadEntityDefinitions -> ShowS
Prelude.Show, (forall x.
 UploadEntityDefinitions -> Rep UploadEntityDefinitions x)
-> (forall x.
    Rep UploadEntityDefinitions x -> UploadEntityDefinitions)
-> Generic UploadEntityDefinitions
forall x. Rep UploadEntityDefinitions x -> UploadEntityDefinitions
forall x. UploadEntityDefinitions -> Rep UploadEntityDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadEntityDefinitions x -> UploadEntityDefinitions
$cfrom :: forall x. UploadEntityDefinitions -> Rep UploadEntityDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'UploadEntityDefinitions' 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:
--
-- 'syncWithPublicNamespace', 'uploadEntityDefinitions_syncWithPublicNamespace' - A Boolean that specifies whether to synchronize with the latest version
-- of the public namespace. If set to @true@, the upload will create a new
-- namespace version.
--
-- 'deprecateExistingEntities', 'uploadEntityDefinitions_deprecateExistingEntities' - A Boolean that specifies whether to deprecate all entities in the latest
-- version before uploading the new @DefinitionDocument@. If set to @true@,
-- the upload will create a new namespace version.
--
-- 'document', 'uploadEntityDefinitions_document' - The @DefinitionDocument@ that defines the updated entities.
newUploadEntityDefinitions ::
  UploadEntityDefinitions
newUploadEntityDefinitions :: UploadEntityDefinitions
newUploadEntityDefinitions =
  UploadEntityDefinitions' :: Maybe Bool
-> Maybe Bool
-> Maybe DefinitionDocument
-> UploadEntityDefinitions
UploadEntityDefinitions'
    { $sel:syncWithPublicNamespace:UploadEntityDefinitions' :: Maybe Bool
syncWithPublicNamespace =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:deprecateExistingEntities:UploadEntityDefinitions' :: Maybe Bool
deprecateExistingEntities = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:document:UploadEntityDefinitions' :: Maybe DefinitionDocument
document = Maybe DefinitionDocument
forall a. Maybe a
Prelude.Nothing
    }

-- | A Boolean that specifies whether to synchronize with the latest version
-- of the public namespace. If set to @true@, the upload will create a new
-- namespace version.
uploadEntityDefinitions_syncWithPublicNamespace :: Lens.Lens' UploadEntityDefinitions (Prelude.Maybe Prelude.Bool)
uploadEntityDefinitions_syncWithPublicNamespace :: (Maybe Bool -> f (Maybe Bool))
-> UploadEntityDefinitions -> f UploadEntityDefinitions
uploadEntityDefinitions_syncWithPublicNamespace = (UploadEntityDefinitions -> Maybe Bool)
-> (UploadEntityDefinitions
    -> Maybe Bool -> UploadEntityDefinitions)
-> Lens
     UploadEntityDefinitions
     UploadEntityDefinitions
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitions' {Maybe Bool
syncWithPublicNamespace :: Maybe Bool
$sel:syncWithPublicNamespace:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
syncWithPublicNamespace} -> Maybe Bool
syncWithPublicNamespace) (\s :: UploadEntityDefinitions
s@UploadEntityDefinitions' {} Maybe Bool
a -> UploadEntityDefinitions
s {$sel:syncWithPublicNamespace:UploadEntityDefinitions' :: Maybe Bool
syncWithPublicNamespace = Maybe Bool
a} :: UploadEntityDefinitions)

-- | A Boolean that specifies whether to deprecate all entities in the latest
-- version before uploading the new @DefinitionDocument@. If set to @true@,
-- the upload will create a new namespace version.
uploadEntityDefinitions_deprecateExistingEntities :: Lens.Lens' UploadEntityDefinitions (Prelude.Maybe Prelude.Bool)
uploadEntityDefinitions_deprecateExistingEntities :: (Maybe Bool -> f (Maybe Bool))
-> UploadEntityDefinitions -> f UploadEntityDefinitions
uploadEntityDefinitions_deprecateExistingEntities = (UploadEntityDefinitions -> Maybe Bool)
-> (UploadEntityDefinitions
    -> Maybe Bool -> UploadEntityDefinitions)
-> Lens
     UploadEntityDefinitions
     UploadEntityDefinitions
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitions' {Maybe Bool
deprecateExistingEntities :: Maybe Bool
$sel:deprecateExistingEntities:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
deprecateExistingEntities} -> Maybe Bool
deprecateExistingEntities) (\s :: UploadEntityDefinitions
s@UploadEntityDefinitions' {} Maybe Bool
a -> UploadEntityDefinitions
s {$sel:deprecateExistingEntities:UploadEntityDefinitions' :: Maybe Bool
deprecateExistingEntities = Maybe Bool
a} :: UploadEntityDefinitions)

-- | The @DefinitionDocument@ that defines the updated entities.
uploadEntityDefinitions_document :: Lens.Lens' UploadEntityDefinitions (Prelude.Maybe DefinitionDocument)
uploadEntityDefinitions_document :: (Maybe DefinitionDocument -> f (Maybe DefinitionDocument))
-> UploadEntityDefinitions -> f UploadEntityDefinitions
uploadEntityDefinitions_document = (UploadEntityDefinitions -> Maybe DefinitionDocument)
-> (UploadEntityDefinitions
    -> Maybe DefinitionDocument -> UploadEntityDefinitions)
-> Lens
     UploadEntityDefinitions
     UploadEntityDefinitions
     (Maybe DefinitionDocument)
     (Maybe DefinitionDocument)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitions' {Maybe DefinitionDocument
document :: Maybe DefinitionDocument
$sel:document:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe DefinitionDocument
document} -> Maybe DefinitionDocument
document) (\s :: UploadEntityDefinitions
s@UploadEntityDefinitions' {} Maybe DefinitionDocument
a -> UploadEntityDefinitions
s {$sel:document:UploadEntityDefinitions' :: Maybe DefinitionDocument
document = Maybe DefinitionDocument
a} :: UploadEntityDefinitions)

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

instance Prelude.Hashable UploadEntityDefinitions

instance Prelude.NFData UploadEntityDefinitions

instance Core.ToHeaders UploadEntityDefinitions where
  toHeaders :: UploadEntityDefinitions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UploadEntityDefinitions -> 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
"IotThingsGraphFrontEndService.UploadEntityDefinitions" ::
                          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 UploadEntityDefinitions where
  toJSON :: UploadEntityDefinitions -> Value
toJSON UploadEntityDefinitions' {Maybe Bool
Maybe DefinitionDocument
document :: Maybe DefinitionDocument
deprecateExistingEntities :: Maybe Bool
syncWithPublicNamespace :: Maybe Bool
$sel:document:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe DefinitionDocument
$sel:deprecateExistingEntities:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
$sel:syncWithPublicNamespace:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"syncWithPublicNamespace" 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
syncWithPublicNamespace,
            (Text
"deprecateExistingEntities" 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
deprecateExistingEntities,
            (Text
"document" Text -> DefinitionDocument -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DefinitionDocument -> Pair)
-> Maybe DefinitionDocument -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DefinitionDocument
document
          ]
      )

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

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

-- | /See:/ 'newUploadEntityDefinitionsResponse' smart constructor.
data UploadEntityDefinitionsResponse = UploadEntityDefinitionsResponse'
  { -- | The response's http status code.
    UploadEntityDefinitionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID that specifies the upload action. You can use this to track the
    -- status of the upload.
    UploadEntityDefinitionsResponse -> Text
uploadId :: Prelude.Text
  }
  deriving (UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
(UploadEntityDefinitionsResponse
 -> UploadEntityDefinitionsResponse -> Bool)
-> (UploadEntityDefinitionsResponse
    -> UploadEntityDefinitionsResponse -> Bool)
-> Eq UploadEntityDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
$c/= :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
== :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
$c== :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [UploadEntityDefinitionsResponse]
ReadPrec UploadEntityDefinitionsResponse
Int -> ReadS UploadEntityDefinitionsResponse
ReadS [UploadEntityDefinitionsResponse]
(Int -> ReadS UploadEntityDefinitionsResponse)
-> ReadS [UploadEntityDefinitionsResponse]
-> ReadPrec UploadEntityDefinitionsResponse
-> ReadPrec [UploadEntityDefinitionsResponse]
-> Read UploadEntityDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadEntityDefinitionsResponse]
$creadListPrec :: ReadPrec [UploadEntityDefinitionsResponse]
readPrec :: ReadPrec UploadEntityDefinitionsResponse
$creadPrec :: ReadPrec UploadEntityDefinitionsResponse
readList :: ReadS [UploadEntityDefinitionsResponse]
$creadList :: ReadS [UploadEntityDefinitionsResponse]
readsPrec :: Int -> ReadS UploadEntityDefinitionsResponse
$creadsPrec :: Int -> ReadS UploadEntityDefinitionsResponse
Prelude.Read, Int -> UploadEntityDefinitionsResponse -> ShowS
[UploadEntityDefinitionsResponse] -> ShowS
UploadEntityDefinitionsResponse -> String
(Int -> UploadEntityDefinitionsResponse -> ShowS)
-> (UploadEntityDefinitionsResponse -> String)
-> ([UploadEntityDefinitionsResponse] -> ShowS)
-> Show UploadEntityDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadEntityDefinitionsResponse] -> ShowS
$cshowList :: [UploadEntityDefinitionsResponse] -> ShowS
show :: UploadEntityDefinitionsResponse -> String
$cshow :: UploadEntityDefinitionsResponse -> String
showsPrec :: Int -> UploadEntityDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> UploadEntityDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
 UploadEntityDefinitionsResponse
 -> Rep UploadEntityDefinitionsResponse x)
-> (forall x.
    Rep UploadEntityDefinitionsResponse x
    -> UploadEntityDefinitionsResponse)
-> Generic UploadEntityDefinitionsResponse
forall x.
Rep UploadEntityDefinitionsResponse x
-> UploadEntityDefinitionsResponse
forall x.
UploadEntityDefinitionsResponse
-> Rep UploadEntityDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UploadEntityDefinitionsResponse x
-> UploadEntityDefinitionsResponse
$cfrom :: forall x.
UploadEntityDefinitionsResponse
-> Rep UploadEntityDefinitionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'UploadEntityDefinitionsResponse' 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:
--
-- 'httpStatus', 'uploadEntityDefinitionsResponse_httpStatus' - The response's http status code.
--
-- 'uploadId', 'uploadEntityDefinitionsResponse_uploadId' - The ID that specifies the upload action. You can use this to track the
-- status of the upload.
newUploadEntityDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'uploadId'
  Prelude.Text ->
  UploadEntityDefinitionsResponse
newUploadEntityDefinitionsResponse :: Int -> Text -> UploadEntityDefinitionsResponse
newUploadEntityDefinitionsResponse
  Int
pHttpStatus_
  Text
pUploadId_ =
    UploadEntityDefinitionsResponse' :: Int -> Text -> UploadEntityDefinitionsResponse
UploadEntityDefinitionsResponse'
      { $sel:httpStatus:UploadEntityDefinitionsResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:uploadId:UploadEntityDefinitionsResponse' :: Text
uploadId = Text
pUploadId_
      }

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

-- | The ID that specifies the upload action. You can use this to track the
-- status of the upload.
uploadEntityDefinitionsResponse_uploadId :: Lens.Lens' UploadEntityDefinitionsResponse Prelude.Text
uploadEntityDefinitionsResponse_uploadId :: (Text -> f Text)
-> UploadEntityDefinitionsResponse
-> f UploadEntityDefinitionsResponse
uploadEntityDefinitionsResponse_uploadId = (UploadEntityDefinitionsResponse -> Text)
-> (UploadEntityDefinitionsResponse
    -> Text -> UploadEntityDefinitionsResponse)
-> Lens
     UploadEntityDefinitionsResponse
     UploadEntityDefinitionsResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitionsResponse' {Text
uploadId :: Text
$sel:uploadId:UploadEntityDefinitionsResponse' :: UploadEntityDefinitionsResponse -> Text
uploadId} -> Text
uploadId) (\s :: UploadEntityDefinitionsResponse
s@UploadEntityDefinitionsResponse' {} Text
a -> UploadEntityDefinitionsResponse
s {$sel:uploadId:UploadEntityDefinitionsResponse' :: Text
uploadId = Text
a} :: UploadEntityDefinitionsResponse)

instance
  Prelude.NFData
    UploadEntityDefinitionsResponse