{-# 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.FraudDetector.PutExternalModel
-- 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 or updates an Amazon SageMaker model endpoint. You can also use
-- this action to update the configuration of the model endpoint, including
-- the IAM role and\/or the mapped variables.
module Amazonka.FraudDetector.PutExternalModel
  ( -- * Creating a Request
    PutExternalModel (..),
    newPutExternalModel,

    -- * Request Lenses
    putExternalModel_tags,
    putExternalModel_modelEndpoint,
    putExternalModel_modelSource,
    putExternalModel_invokeModelEndpointRoleArn,
    putExternalModel_inputConfiguration,
    putExternalModel_outputConfiguration,
    putExternalModel_modelEndpointStatus,

    -- * Destructuring the Response
    PutExternalModelResponse (..),
    newPutExternalModelResponse,

    -- * Response Lenses
    putExternalModelResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.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:/ 'newPutExternalModel' smart constructor.
data PutExternalModel = PutExternalModel'
  { -- | A collection of key and value pairs.
    PutExternalModel -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The model endpoints name.
    PutExternalModel -> Text
modelEndpoint :: Prelude.Text,
    -- | The source of the model.
    PutExternalModel -> ModelSource
modelSource :: ModelSource,
    -- | The IAM role used to invoke the model endpoint.
    PutExternalModel -> Text
invokeModelEndpointRoleArn :: Prelude.Text,
    -- | The model endpoint input configuration.
    PutExternalModel -> ModelInputConfiguration
inputConfiguration :: ModelInputConfiguration,
    -- | The model endpoint output configuration.
    PutExternalModel -> ModelOutputConfiguration
outputConfiguration :: ModelOutputConfiguration,
    -- | The model endpoint’s status in Amazon Fraud Detector.
    PutExternalModel -> ModelEndpointStatus
modelEndpointStatus :: ModelEndpointStatus
  }
  deriving (PutExternalModel -> PutExternalModel -> Bool
(PutExternalModel -> PutExternalModel -> Bool)
-> (PutExternalModel -> PutExternalModel -> Bool)
-> Eq PutExternalModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutExternalModel -> PutExternalModel -> Bool
$c/= :: PutExternalModel -> PutExternalModel -> Bool
== :: PutExternalModel -> PutExternalModel -> Bool
$c== :: PutExternalModel -> PutExternalModel -> Bool
Prelude.Eq, ReadPrec [PutExternalModel]
ReadPrec PutExternalModel
Int -> ReadS PutExternalModel
ReadS [PutExternalModel]
(Int -> ReadS PutExternalModel)
-> ReadS [PutExternalModel]
-> ReadPrec PutExternalModel
-> ReadPrec [PutExternalModel]
-> Read PutExternalModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutExternalModel]
$creadListPrec :: ReadPrec [PutExternalModel]
readPrec :: ReadPrec PutExternalModel
$creadPrec :: ReadPrec PutExternalModel
readList :: ReadS [PutExternalModel]
$creadList :: ReadS [PutExternalModel]
readsPrec :: Int -> ReadS PutExternalModel
$creadsPrec :: Int -> ReadS PutExternalModel
Prelude.Read, Int -> PutExternalModel -> ShowS
[PutExternalModel] -> ShowS
PutExternalModel -> String
(Int -> PutExternalModel -> ShowS)
-> (PutExternalModel -> String)
-> ([PutExternalModel] -> ShowS)
-> Show PutExternalModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutExternalModel] -> ShowS
$cshowList :: [PutExternalModel] -> ShowS
show :: PutExternalModel -> String
$cshow :: PutExternalModel -> String
showsPrec :: Int -> PutExternalModel -> ShowS
$cshowsPrec :: Int -> PutExternalModel -> ShowS
Prelude.Show, (forall x. PutExternalModel -> Rep PutExternalModel x)
-> (forall x. Rep PutExternalModel x -> PutExternalModel)
-> Generic PutExternalModel
forall x. Rep PutExternalModel x -> PutExternalModel
forall x. PutExternalModel -> Rep PutExternalModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutExternalModel x -> PutExternalModel
$cfrom :: forall x. PutExternalModel -> Rep PutExternalModel x
Prelude.Generic)

-- |
-- Create a value of 'PutExternalModel' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'tags', 'putExternalModel_tags' - A collection of key and value pairs.
--
-- 'modelEndpoint', 'putExternalModel_modelEndpoint' - The model endpoints name.
--
-- 'modelSource', 'putExternalModel_modelSource' - The source of the model.
--
-- 'invokeModelEndpointRoleArn', 'putExternalModel_invokeModelEndpointRoleArn' - The IAM role used to invoke the model endpoint.
--
-- 'inputConfiguration', 'putExternalModel_inputConfiguration' - The model endpoint input configuration.
--
-- 'outputConfiguration', 'putExternalModel_outputConfiguration' - The model endpoint output configuration.
--
-- 'modelEndpointStatus', 'putExternalModel_modelEndpointStatus' - The model endpoint’s status in Amazon Fraud Detector.
newPutExternalModel ::
  -- | 'modelEndpoint'
  Prelude.Text ->
  -- | 'modelSource'
  ModelSource ->
  -- | 'invokeModelEndpointRoleArn'
  Prelude.Text ->
  -- | 'inputConfiguration'
  ModelInputConfiguration ->
  -- | 'outputConfiguration'
  ModelOutputConfiguration ->
  -- | 'modelEndpointStatus'
  ModelEndpointStatus ->
  PutExternalModel
newPutExternalModel :: Text
-> ModelSource
-> Text
-> ModelInputConfiguration
-> ModelOutputConfiguration
-> ModelEndpointStatus
-> PutExternalModel
newPutExternalModel
  Text
pModelEndpoint_
  ModelSource
pModelSource_
  Text
pInvokeModelEndpointRoleArn_
  ModelInputConfiguration
pInputConfiguration_
  ModelOutputConfiguration
pOutputConfiguration_
  ModelEndpointStatus
pModelEndpointStatus_ =
    PutExternalModel' :: Maybe [Tag]
-> Text
-> ModelSource
-> Text
-> ModelInputConfiguration
-> ModelOutputConfiguration
-> ModelEndpointStatus
-> PutExternalModel
PutExternalModel'
      { $sel:tags:PutExternalModel' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:modelEndpoint:PutExternalModel' :: Text
modelEndpoint = Text
pModelEndpoint_,
        $sel:modelSource:PutExternalModel' :: ModelSource
modelSource = ModelSource
pModelSource_,
        $sel:invokeModelEndpointRoleArn:PutExternalModel' :: Text
invokeModelEndpointRoleArn =
          Text
pInvokeModelEndpointRoleArn_,
        $sel:inputConfiguration:PutExternalModel' :: ModelInputConfiguration
inputConfiguration = ModelInputConfiguration
pInputConfiguration_,
        $sel:outputConfiguration:PutExternalModel' :: ModelOutputConfiguration
outputConfiguration = ModelOutputConfiguration
pOutputConfiguration_,
        $sel:modelEndpointStatus:PutExternalModel' :: ModelEndpointStatus
modelEndpointStatus = ModelEndpointStatus
pModelEndpointStatus_
      }

-- | A collection of key and value pairs.
putExternalModel_tags :: Lens.Lens' PutExternalModel (Prelude.Maybe [Tag])
putExternalModel_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> PutExternalModel -> f PutExternalModel
putExternalModel_tags = (PutExternalModel -> Maybe [Tag])
-> (PutExternalModel -> Maybe [Tag] -> PutExternalModel)
-> Lens
     PutExternalModel PutExternalModel (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutExternalModel' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:PutExternalModel' :: PutExternalModel -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: PutExternalModel
s@PutExternalModel' {} Maybe [Tag]
a -> PutExternalModel
s {$sel:tags:PutExternalModel' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: PutExternalModel) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> PutExternalModel -> f PutExternalModel)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> PutExternalModel
-> f PutExternalModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The model endpoints name.
putExternalModel_modelEndpoint :: Lens.Lens' PutExternalModel Prelude.Text
putExternalModel_modelEndpoint :: (Text -> f Text) -> PutExternalModel -> f PutExternalModel
putExternalModel_modelEndpoint = (PutExternalModel -> Text)
-> (PutExternalModel -> Text -> PutExternalModel)
-> Lens PutExternalModel PutExternalModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutExternalModel' {Text
modelEndpoint :: Text
$sel:modelEndpoint:PutExternalModel' :: PutExternalModel -> Text
modelEndpoint} -> Text
modelEndpoint) (\s :: PutExternalModel
s@PutExternalModel' {} Text
a -> PutExternalModel
s {$sel:modelEndpoint:PutExternalModel' :: Text
modelEndpoint = Text
a} :: PutExternalModel)

-- | The source of the model.
putExternalModel_modelSource :: Lens.Lens' PutExternalModel ModelSource
putExternalModel_modelSource :: (ModelSource -> f ModelSource)
-> PutExternalModel -> f PutExternalModel
putExternalModel_modelSource = (PutExternalModel -> ModelSource)
-> (PutExternalModel -> ModelSource -> PutExternalModel)
-> Lens PutExternalModel PutExternalModel ModelSource ModelSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutExternalModel' {ModelSource
modelSource :: ModelSource
$sel:modelSource:PutExternalModel' :: PutExternalModel -> ModelSource
modelSource} -> ModelSource
modelSource) (\s :: PutExternalModel
s@PutExternalModel' {} ModelSource
a -> PutExternalModel
s {$sel:modelSource:PutExternalModel' :: ModelSource
modelSource = ModelSource
a} :: PutExternalModel)

-- | The IAM role used to invoke the model endpoint.
putExternalModel_invokeModelEndpointRoleArn :: Lens.Lens' PutExternalModel Prelude.Text
putExternalModel_invokeModelEndpointRoleArn :: (Text -> f Text) -> PutExternalModel -> f PutExternalModel
putExternalModel_invokeModelEndpointRoleArn = (PutExternalModel -> Text)
-> (PutExternalModel -> Text -> PutExternalModel)
-> Lens PutExternalModel PutExternalModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutExternalModel' {Text
invokeModelEndpointRoleArn :: Text
$sel:invokeModelEndpointRoleArn:PutExternalModel' :: PutExternalModel -> Text
invokeModelEndpointRoleArn} -> Text
invokeModelEndpointRoleArn) (\s :: PutExternalModel
s@PutExternalModel' {} Text
a -> PutExternalModel
s {$sel:invokeModelEndpointRoleArn:PutExternalModel' :: Text
invokeModelEndpointRoleArn = Text
a} :: PutExternalModel)

-- | The model endpoint input configuration.
putExternalModel_inputConfiguration :: Lens.Lens' PutExternalModel ModelInputConfiguration
putExternalModel_inputConfiguration :: (ModelInputConfiguration -> f ModelInputConfiguration)
-> PutExternalModel -> f PutExternalModel
putExternalModel_inputConfiguration = (PutExternalModel -> ModelInputConfiguration)
-> (PutExternalModel
    -> ModelInputConfiguration -> PutExternalModel)
-> Lens
     PutExternalModel
     PutExternalModel
     ModelInputConfiguration
     ModelInputConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutExternalModel' {ModelInputConfiguration
inputConfiguration :: ModelInputConfiguration
$sel:inputConfiguration:PutExternalModel' :: PutExternalModel -> ModelInputConfiguration
inputConfiguration} -> ModelInputConfiguration
inputConfiguration) (\s :: PutExternalModel
s@PutExternalModel' {} ModelInputConfiguration
a -> PutExternalModel
s {$sel:inputConfiguration:PutExternalModel' :: ModelInputConfiguration
inputConfiguration = ModelInputConfiguration
a} :: PutExternalModel)

-- | The model endpoint output configuration.
putExternalModel_outputConfiguration :: Lens.Lens' PutExternalModel ModelOutputConfiguration
putExternalModel_outputConfiguration :: (ModelOutputConfiguration -> f ModelOutputConfiguration)
-> PutExternalModel -> f PutExternalModel
putExternalModel_outputConfiguration = (PutExternalModel -> ModelOutputConfiguration)
-> (PutExternalModel
    -> ModelOutputConfiguration -> PutExternalModel)
-> Lens
     PutExternalModel
     PutExternalModel
     ModelOutputConfiguration
     ModelOutputConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutExternalModel' {ModelOutputConfiguration
outputConfiguration :: ModelOutputConfiguration
$sel:outputConfiguration:PutExternalModel' :: PutExternalModel -> ModelOutputConfiguration
outputConfiguration} -> ModelOutputConfiguration
outputConfiguration) (\s :: PutExternalModel
s@PutExternalModel' {} ModelOutputConfiguration
a -> PutExternalModel
s {$sel:outputConfiguration:PutExternalModel' :: ModelOutputConfiguration
outputConfiguration = ModelOutputConfiguration
a} :: PutExternalModel)

-- | The model endpoint’s status in Amazon Fraud Detector.
putExternalModel_modelEndpointStatus :: Lens.Lens' PutExternalModel ModelEndpointStatus
putExternalModel_modelEndpointStatus :: (ModelEndpointStatus -> f ModelEndpointStatus)
-> PutExternalModel -> f PutExternalModel
putExternalModel_modelEndpointStatus = (PutExternalModel -> ModelEndpointStatus)
-> (PutExternalModel -> ModelEndpointStatus -> PutExternalModel)
-> Lens
     PutExternalModel
     PutExternalModel
     ModelEndpointStatus
     ModelEndpointStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutExternalModel' {ModelEndpointStatus
modelEndpointStatus :: ModelEndpointStatus
$sel:modelEndpointStatus:PutExternalModel' :: PutExternalModel -> ModelEndpointStatus
modelEndpointStatus} -> ModelEndpointStatus
modelEndpointStatus) (\s :: PutExternalModel
s@PutExternalModel' {} ModelEndpointStatus
a -> PutExternalModel
s {$sel:modelEndpointStatus:PutExternalModel' :: ModelEndpointStatus
modelEndpointStatus = ModelEndpointStatus
a} :: PutExternalModel)

instance Core.AWSRequest PutExternalModel where
  type
    AWSResponse PutExternalModel =
      PutExternalModelResponse
  request :: PutExternalModel -> Request PutExternalModel
request = Service -> PutExternalModel -> Request PutExternalModel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutExternalModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutExternalModel)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse PutExternalModel))
-> Logger
-> Service
-> Proxy PutExternalModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutExternalModel)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> PutExternalModelResponse
PutExternalModelResponse'
            (Int -> PutExternalModelResponse)
-> Either String Int -> Either String PutExternalModelResponse
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))
      )

instance Prelude.Hashable PutExternalModel

instance Prelude.NFData PutExternalModel

instance Core.ToHeaders PutExternalModel where
  toHeaders :: PutExternalModel -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutExternalModel -> 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
"AWSHawksNestServiceFacade.PutExternalModel" ::
                          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 PutExternalModel where
  toJSON :: PutExternalModel -> Value
toJSON PutExternalModel' {Maybe [Tag]
Text
ModelEndpointStatus
ModelInputConfiguration
ModelOutputConfiguration
ModelSource
modelEndpointStatus :: ModelEndpointStatus
outputConfiguration :: ModelOutputConfiguration
inputConfiguration :: ModelInputConfiguration
invokeModelEndpointRoleArn :: Text
modelSource :: ModelSource
modelEndpoint :: Text
tags :: Maybe [Tag]
$sel:modelEndpointStatus:PutExternalModel' :: PutExternalModel -> ModelEndpointStatus
$sel:outputConfiguration:PutExternalModel' :: PutExternalModel -> ModelOutputConfiguration
$sel:inputConfiguration:PutExternalModel' :: PutExternalModel -> ModelInputConfiguration
$sel:invokeModelEndpointRoleArn:PutExternalModel' :: PutExternalModel -> Text
$sel:modelSource:PutExternalModel' :: PutExternalModel -> ModelSource
$sel:modelEndpoint:PutExternalModel' :: PutExternalModel -> Text
$sel:tags:PutExternalModel' :: PutExternalModel -> Maybe [Tag]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"modelEndpoint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelEndpoint),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"modelSource" Text -> ModelSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ModelSource
modelSource),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"invokeModelEndpointRoleArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
invokeModelEndpointRoleArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"inputConfiguration" Text -> ModelInputConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ModelInputConfiguration
inputConfiguration),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"outputConfiguration" Text -> ModelOutputConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ModelOutputConfiguration
outputConfiguration),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"modelEndpointStatus" Text -> ModelEndpointStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ModelEndpointStatus
modelEndpointStatus)
          ]
      )

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

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

-- | /See:/ 'newPutExternalModelResponse' smart constructor.
data PutExternalModelResponse = PutExternalModelResponse'
  { -- | The response's http status code.
    PutExternalModelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutExternalModelResponse -> PutExternalModelResponse -> Bool
(PutExternalModelResponse -> PutExternalModelResponse -> Bool)
-> (PutExternalModelResponse -> PutExternalModelResponse -> Bool)
-> Eq PutExternalModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutExternalModelResponse -> PutExternalModelResponse -> Bool
$c/= :: PutExternalModelResponse -> PutExternalModelResponse -> Bool
== :: PutExternalModelResponse -> PutExternalModelResponse -> Bool
$c== :: PutExternalModelResponse -> PutExternalModelResponse -> Bool
Prelude.Eq, ReadPrec [PutExternalModelResponse]
ReadPrec PutExternalModelResponse
Int -> ReadS PutExternalModelResponse
ReadS [PutExternalModelResponse]
(Int -> ReadS PutExternalModelResponse)
-> ReadS [PutExternalModelResponse]
-> ReadPrec PutExternalModelResponse
-> ReadPrec [PutExternalModelResponse]
-> Read PutExternalModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutExternalModelResponse]
$creadListPrec :: ReadPrec [PutExternalModelResponse]
readPrec :: ReadPrec PutExternalModelResponse
$creadPrec :: ReadPrec PutExternalModelResponse
readList :: ReadS [PutExternalModelResponse]
$creadList :: ReadS [PutExternalModelResponse]
readsPrec :: Int -> ReadS PutExternalModelResponse
$creadsPrec :: Int -> ReadS PutExternalModelResponse
Prelude.Read, Int -> PutExternalModelResponse -> ShowS
[PutExternalModelResponse] -> ShowS
PutExternalModelResponse -> String
(Int -> PutExternalModelResponse -> ShowS)
-> (PutExternalModelResponse -> String)
-> ([PutExternalModelResponse] -> ShowS)
-> Show PutExternalModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutExternalModelResponse] -> ShowS
$cshowList :: [PutExternalModelResponse] -> ShowS
show :: PutExternalModelResponse -> String
$cshow :: PutExternalModelResponse -> String
showsPrec :: Int -> PutExternalModelResponse -> ShowS
$cshowsPrec :: Int -> PutExternalModelResponse -> ShowS
Prelude.Show, (forall x.
 PutExternalModelResponse -> Rep PutExternalModelResponse x)
-> (forall x.
    Rep PutExternalModelResponse x -> PutExternalModelResponse)
-> Generic PutExternalModelResponse
forall x.
Rep PutExternalModelResponse x -> PutExternalModelResponse
forall x.
PutExternalModelResponse -> Rep PutExternalModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutExternalModelResponse x -> PutExternalModelResponse
$cfrom :: forall x.
PutExternalModelResponse -> Rep PutExternalModelResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutExternalModelResponse' 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', 'putExternalModelResponse_httpStatus' - The response's http status code.
newPutExternalModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutExternalModelResponse
newPutExternalModelResponse :: Int -> PutExternalModelResponse
newPutExternalModelResponse Int
pHttpStatus_ =
  PutExternalModelResponse' :: Int -> PutExternalModelResponse
PutExternalModelResponse'
    { $sel:httpStatus:PutExternalModelResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData PutExternalModelResponse