{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Greengrass.Types.SageMakerMachineLearningModelResourceData
-- 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)
module Amazonka.Greengrass.Types.SageMakerMachineLearningModelResourceData where

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types.ResourceDownloadOwnerSetting
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Attributes that define an Amazon SageMaker machine learning resource.
--
-- /See:/ 'newSageMakerMachineLearningModelResourceData' smart constructor.
data SageMakerMachineLearningModelResourceData = SageMakerMachineLearningModelResourceData'
  { SageMakerMachineLearningModelResourceData
-> Maybe ResourceDownloadOwnerSetting
ownerSetting :: Prelude.Maybe ResourceDownloadOwnerSetting,
    -- | The ARN of the Amazon SageMaker training job that represents the source
    -- model.
    SageMakerMachineLearningModelResourceData -> Maybe Text
sageMakerJobArn :: Prelude.Maybe Prelude.Text,
    -- | The absolute local path of the resource inside the Lambda environment.
    SageMakerMachineLearningModelResourceData -> Maybe Text
destinationPath :: Prelude.Maybe Prelude.Text
  }
  deriving (SageMakerMachineLearningModelResourceData
-> SageMakerMachineLearningModelResourceData -> Bool
(SageMakerMachineLearningModelResourceData
 -> SageMakerMachineLearningModelResourceData -> Bool)
-> (SageMakerMachineLearningModelResourceData
    -> SageMakerMachineLearningModelResourceData -> Bool)
-> Eq SageMakerMachineLearningModelResourceData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SageMakerMachineLearningModelResourceData
-> SageMakerMachineLearningModelResourceData -> Bool
$c/= :: SageMakerMachineLearningModelResourceData
-> SageMakerMachineLearningModelResourceData -> Bool
== :: SageMakerMachineLearningModelResourceData
-> SageMakerMachineLearningModelResourceData -> Bool
$c== :: SageMakerMachineLearningModelResourceData
-> SageMakerMachineLearningModelResourceData -> Bool
Prelude.Eq, ReadPrec [SageMakerMachineLearningModelResourceData]
ReadPrec SageMakerMachineLearningModelResourceData
Int -> ReadS SageMakerMachineLearningModelResourceData
ReadS [SageMakerMachineLearningModelResourceData]
(Int -> ReadS SageMakerMachineLearningModelResourceData)
-> ReadS [SageMakerMachineLearningModelResourceData]
-> ReadPrec SageMakerMachineLearningModelResourceData
-> ReadPrec [SageMakerMachineLearningModelResourceData]
-> Read SageMakerMachineLearningModelResourceData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SageMakerMachineLearningModelResourceData]
$creadListPrec :: ReadPrec [SageMakerMachineLearningModelResourceData]
readPrec :: ReadPrec SageMakerMachineLearningModelResourceData
$creadPrec :: ReadPrec SageMakerMachineLearningModelResourceData
readList :: ReadS [SageMakerMachineLearningModelResourceData]
$creadList :: ReadS [SageMakerMachineLearningModelResourceData]
readsPrec :: Int -> ReadS SageMakerMachineLearningModelResourceData
$creadsPrec :: Int -> ReadS SageMakerMachineLearningModelResourceData
Prelude.Read, Int -> SageMakerMachineLearningModelResourceData -> ShowS
[SageMakerMachineLearningModelResourceData] -> ShowS
SageMakerMachineLearningModelResourceData -> String
(Int -> SageMakerMachineLearningModelResourceData -> ShowS)
-> (SageMakerMachineLearningModelResourceData -> String)
-> ([SageMakerMachineLearningModelResourceData] -> ShowS)
-> Show SageMakerMachineLearningModelResourceData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SageMakerMachineLearningModelResourceData] -> ShowS
$cshowList :: [SageMakerMachineLearningModelResourceData] -> ShowS
show :: SageMakerMachineLearningModelResourceData -> String
$cshow :: SageMakerMachineLearningModelResourceData -> String
showsPrec :: Int -> SageMakerMachineLearningModelResourceData -> ShowS
$cshowsPrec :: Int -> SageMakerMachineLearningModelResourceData -> ShowS
Prelude.Show, (forall x.
 SageMakerMachineLearningModelResourceData
 -> Rep SageMakerMachineLearningModelResourceData x)
-> (forall x.
    Rep SageMakerMachineLearningModelResourceData x
    -> SageMakerMachineLearningModelResourceData)
-> Generic SageMakerMachineLearningModelResourceData
forall x.
Rep SageMakerMachineLearningModelResourceData x
-> SageMakerMachineLearningModelResourceData
forall x.
SageMakerMachineLearningModelResourceData
-> Rep SageMakerMachineLearningModelResourceData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SageMakerMachineLearningModelResourceData x
-> SageMakerMachineLearningModelResourceData
$cfrom :: forall x.
SageMakerMachineLearningModelResourceData
-> Rep SageMakerMachineLearningModelResourceData x
Prelude.Generic)

-- |
-- Create a value of 'SageMakerMachineLearningModelResourceData' 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:
--
-- 'ownerSetting', 'sageMakerMachineLearningModelResourceData_ownerSetting' - Undocumented member.
--
-- 'sageMakerJobArn', 'sageMakerMachineLearningModelResourceData_sageMakerJobArn' - The ARN of the Amazon SageMaker training job that represents the source
-- model.
--
-- 'destinationPath', 'sageMakerMachineLearningModelResourceData_destinationPath' - The absolute local path of the resource inside the Lambda environment.
newSageMakerMachineLearningModelResourceData ::
  SageMakerMachineLearningModelResourceData
newSageMakerMachineLearningModelResourceData :: SageMakerMachineLearningModelResourceData
newSageMakerMachineLearningModelResourceData =
  SageMakerMachineLearningModelResourceData' :: Maybe ResourceDownloadOwnerSetting
-> Maybe Text
-> Maybe Text
-> SageMakerMachineLearningModelResourceData
SageMakerMachineLearningModelResourceData'
    { $sel:ownerSetting:SageMakerMachineLearningModelResourceData' :: Maybe ResourceDownloadOwnerSetting
ownerSetting =
        Maybe ResourceDownloadOwnerSetting
forall a. Maybe a
Prelude.Nothing,
      $sel:sageMakerJobArn:SageMakerMachineLearningModelResourceData' :: Maybe Text
sageMakerJobArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationPath:SageMakerMachineLearningModelResourceData' :: Maybe Text
destinationPath =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
sageMakerMachineLearningModelResourceData_ownerSetting :: Lens.Lens' SageMakerMachineLearningModelResourceData (Prelude.Maybe ResourceDownloadOwnerSetting)
sageMakerMachineLearningModelResourceData_ownerSetting :: (Maybe ResourceDownloadOwnerSetting
 -> f (Maybe ResourceDownloadOwnerSetting))
-> SageMakerMachineLearningModelResourceData
-> f SageMakerMachineLearningModelResourceData
sageMakerMachineLearningModelResourceData_ownerSetting = (SageMakerMachineLearningModelResourceData
 -> Maybe ResourceDownloadOwnerSetting)
-> (SageMakerMachineLearningModelResourceData
    -> Maybe ResourceDownloadOwnerSetting
    -> SageMakerMachineLearningModelResourceData)
-> Lens
     SageMakerMachineLearningModelResourceData
     SageMakerMachineLearningModelResourceData
     (Maybe ResourceDownloadOwnerSetting)
     (Maybe ResourceDownloadOwnerSetting)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SageMakerMachineLearningModelResourceData' {Maybe ResourceDownloadOwnerSetting
ownerSetting :: Maybe ResourceDownloadOwnerSetting
$sel:ownerSetting:SageMakerMachineLearningModelResourceData' :: SageMakerMachineLearningModelResourceData
-> Maybe ResourceDownloadOwnerSetting
ownerSetting} -> Maybe ResourceDownloadOwnerSetting
ownerSetting) (\s :: SageMakerMachineLearningModelResourceData
s@SageMakerMachineLearningModelResourceData' {} Maybe ResourceDownloadOwnerSetting
a -> SageMakerMachineLearningModelResourceData
s {$sel:ownerSetting:SageMakerMachineLearningModelResourceData' :: Maybe ResourceDownloadOwnerSetting
ownerSetting = Maybe ResourceDownloadOwnerSetting
a} :: SageMakerMachineLearningModelResourceData)

-- | The ARN of the Amazon SageMaker training job that represents the source
-- model.
sageMakerMachineLearningModelResourceData_sageMakerJobArn :: Lens.Lens' SageMakerMachineLearningModelResourceData (Prelude.Maybe Prelude.Text)
sageMakerMachineLearningModelResourceData_sageMakerJobArn :: (Maybe Text -> f (Maybe Text))
-> SageMakerMachineLearningModelResourceData
-> f SageMakerMachineLearningModelResourceData
sageMakerMachineLearningModelResourceData_sageMakerJobArn = (SageMakerMachineLearningModelResourceData -> Maybe Text)
-> (SageMakerMachineLearningModelResourceData
    -> Maybe Text -> SageMakerMachineLearningModelResourceData)
-> Lens
     SageMakerMachineLearningModelResourceData
     SageMakerMachineLearningModelResourceData
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SageMakerMachineLearningModelResourceData' {Maybe Text
sageMakerJobArn :: Maybe Text
$sel:sageMakerJobArn:SageMakerMachineLearningModelResourceData' :: SageMakerMachineLearningModelResourceData -> Maybe Text
sageMakerJobArn} -> Maybe Text
sageMakerJobArn) (\s :: SageMakerMachineLearningModelResourceData
s@SageMakerMachineLearningModelResourceData' {} Maybe Text
a -> SageMakerMachineLearningModelResourceData
s {$sel:sageMakerJobArn:SageMakerMachineLearningModelResourceData' :: Maybe Text
sageMakerJobArn = Maybe Text
a} :: SageMakerMachineLearningModelResourceData)

-- | The absolute local path of the resource inside the Lambda environment.
sageMakerMachineLearningModelResourceData_destinationPath :: Lens.Lens' SageMakerMachineLearningModelResourceData (Prelude.Maybe Prelude.Text)
sageMakerMachineLearningModelResourceData_destinationPath :: (Maybe Text -> f (Maybe Text))
-> SageMakerMachineLearningModelResourceData
-> f SageMakerMachineLearningModelResourceData
sageMakerMachineLearningModelResourceData_destinationPath = (SageMakerMachineLearningModelResourceData -> Maybe Text)
-> (SageMakerMachineLearningModelResourceData
    -> Maybe Text -> SageMakerMachineLearningModelResourceData)
-> Lens
     SageMakerMachineLearningModelResourceData
     SageMakerMachineLearningModelResourceData
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SageMakerMachineLearningModelResourceData' {Maybe Text
destinationPath :: Maybe Text
$sel:destinationPath:SageMakerMachineLearningModelResourceData' :: SageMakerMachineLearningModelResourceData -> Maybe Text
destinationPath} -> Maybe Text
destinationPath) (\s :: SageMakerMachineLearningModelResourceData
s@SageMakerMachineLearningModelResourceData' {} Maybe Text
a -> SageMakerMachineLearningModelResourceData
s {$sel:destinationPath:SageMakerMachineLearningModelResourceData' :: Maybe Text
destinationPath = Maybe Text
a} :: SageMakerMachineLearningModelResourceData)

instance
  Core.FromJSON
    SageMakerMachineLearningModelResourceData
  where
  parseJSON :: Value -> Parser SageMakerMachineLearningModelResourceData
parseJSON =
    String
-> (Object -> Parser SageMakerMachineLearningModelResourceData)
-> Value
-> Parser SageMakerMachineLearningModelResourceData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SageMakerMachineLearningModelResourceData"
      ( \Object
x ->
          Maybe ResourceDownloadOwnerSetting
-> Maybe Text
-> Maybe Text
-> SageMakerMachineLearningModelResourceData
SageMakerMachineLearningModelResourceData'
            (Maybe ResourceDownloadOwnerSetting
 -> Maybe Text
 -> Maybe Text
 -> SageMakerMachineLearningModelResourceData)
-> Parser (Maybe ResourceDownloadOwnerSetting)
-> Parser
     (Maybe Text
      -> Maybe Text -> SageMakerMachineLearningModelResourceData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceDownloadOwnerSetting)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OwnerSetting")
              Parser
  (Maybe Text
   -> Maybe Text -> SageMakerMachineLearningModelResourceData)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SageMakerMachineLearningModelResourceData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SageMakerJobArn")
              Parser (Maybe Text -> SageMakerMachineLearningModelResourceData)
-> Parser (Maybe Text)
-> Parser SageMakerMachineLearningModelResourceData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DestinationPath")
      )

instance
  Prelude.Hashable
    SageMakerMachineLearningModelResourceData

instance
  Prelude.NFData
    SageMakerMachineLearningModelResourceData

instance
  Core.ToJSON
    SageMakerMachineLearningModelResourceData
  where
  toJSON :: SageMakerMachineLearningModelResourceData -> Value
toJSON SageMakerMachineLearningModelResourceData' {Maybe Text
Maybe ResourceDownloadOwnerSetting
destinationPath :: Maybe Text
sageMakerJobArn :: Maybe Text
ownerSetting :: Maybe ResourceDownloadOwnerSetting
$sel:destinationPath:SageMakerMachineLearningModelResourceData' :: SageMakerMachineLearningModelResourceData -> Maybe Text
$sel:sageMakerJobArn:SageMakerMachineLearningModelResourceData' :: SageMakerMachineLearningModelResourceData -> Maybe Text
$sel:ownerSetting:SageMakerMachineLearningModelResourceData' :: SageMakerMachineLearningModelResourceData
-> Maybe ResourceDownloadOwnerSetting
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"OwnerSetting" Text -> ResourceDownloadOwnerSetting -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ResourceDownloadOwnerSetting -> Pair)
-> Maybe ResourceDownloadOwnerSetting -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceDownloadOwnerSetting
ownerSetting,
            (Text
"SageMakerJobArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sageMakerJobArn,
            (Text
"DestinationPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
destinationPath
          ]
      )