{-# 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.S3MachineLearningModelResourceData
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Greengrass.Types.S3MachineLearningModelResourceData where

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

-- | Attributes that define an Amazon S3 machine learning resource.
--
-- /See:/ 'newS3MachineLearningModelResourceData' smart constructor.
data S3MachineLearningModelResourceData = S3MachineLearningModelResourceData'
  { -- | The absolute local path of the resource inside the Lambda environment.
    S3MachineLearningModelResourceData -> Maybe Text
destinationPath :: Prelude.Maybe Prelude.Text,
    S3MachineLearningModelResourceData
-> Maybe ResourceDownloadOwnerSetting
ownerSetting :: Prelude.Maybe ResourceDownloadOwnerSetting,
    -- | The URI of the source model in an S3 bucket. The model package must be
    -- in tar.gz or .zip format.
    S3MachineLearningModelResourceData -> Maybe Text
s3Uri :: Prelude.Maybe Prelude.Text
  }
  deriving (S3MachineLearningModelResourceData
-> S3MachineLearningModelResourceData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3MachineLearningModelResourceData
-> S3MachineLearningModelResourceData -> Bool
$c/= :: S3MachineLearningModelResourceData
-> S3MachineLearningModelResourceData -> Bool
== :: S3MachineLearningModelResourceData
-> S3MachineLearningModelResourceData -> Bool
$c== :: S3MachineLearningModelResourceData
-> S3MachineLearningModelResourceData -> Bool
Prelude.Eq, ReadPrec [S3MachineLearningModelResourceData]
ReadPrec S3MachineLearningModelResourceData
Int -> ReadS S3MachineLearningModelResourceData
ReadS [S3MachineLearningModelResourceData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3MachineLearningModelResourceData]
$creadListPrec :: ReadPrec [S3MachineLearningModelResourceData]
readPrec :: ReadPrec S3MachineLearningModelResourceData
$creadPrec :: ReadPrec S3MachineLearningModelResourceData
readList :: ReadS [S3MachineLearningModelResourceData]
$creadList :: ReadS [S3MachineLearningModelResourceData]
readsPrec :: Int -> ReadS S3MachineLearningModelResourceData
$creadsPrec :: Int -> ReadS S3MachineLearningModelResourceData
Prelude.Read, Int -> S3MachineLearningModelResourceData -> ShowS
[S3MachineLearningModelResourceData] -> ShowS
S3MachineLearningModelResourceData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3MachineLearningModelResourceData] -> ShowS
$cshowList :: [S3MachineLearningModelResourceData] -> ShowS
show :: S3MachineLearningModelResourceData -> String
$cshow :: S3MachineLearningModelResourceData -> String
showsPrec :: Int -> S3MachineLearningModelResourceData -> ShowS
$cshowsPrec :: Int -> S3MachineLearningModelResourceData -> ShowS
Prelude.Show, forall x.
Rep S3MachineLearningModelResourceData x
-> S3MachineLearningModelResourceData
forall x.
S3MachineLearningModelResourceData
-> Rep S3MachineLearningModelResourceData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3MachineLearningModelResourceData x
-> S3MachineLearningModelResourceData
$cfrom :: forall x.
S3MachineLearningModelResourceData
-> Rep S3MachineLearningModelResourceData x
Prelude.Generic)

-- |
-- Create a value of 'S3MachineLearningModelResourceData' 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:
--
-- 'destinationPath', 's3MachineLearningModelResourceData_destinationPath' - The absolute local path of the resource inside the Lambda environment.
--
-- 'ownerSetting', 's3MachineLearningModelResourceData_ownerSetting' - Undocumented member.
--
-- 's3Uri', 's3MachineLearningModelResourceData_s3Uri' - The URI of the source model in an S3 bucket. The model package must be
-- in tar.gz or .zip format.
newS3MachineLearningModelResourceData ::
  S3MachineLearningModelResourceData
newS3MachineLearningModelResourceData :: S3MachineLearningModelResourceData
newS3MachineLearningModelResourceData =
  S3MachineLearningModelResourceData'
    { $sel:destinationPath:S3MachineLearningModelResourceData' :: Maybe Text
destinationPath =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ownerSetting:S3MachineLearningModelResourceData' :: Maybe ResourceDownloadOwnerSetting
ownerSetting = forall a. Maybe a
Prelude.Nothing,
      $sel:s3Uri:S3MachineLearningModelResourceData' :: Maybe Text
s3Uri = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The URI of the source model in an S3 bucket. The model package must be
-- in tar.gz or .zip format.
s3MachineLearningModelResourceData_s3Uri :: Lens.Lens' S3MachineLearningModelResourceData (Prelude.Maybe Prelude.Text)
s3MachineLearningModelResourceData_s3Uri :: Lens' S3MachineLearningModelResourceData (Maybe Text)
s3MachineLearningModelResourceData_s3Uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3MachineLearningModelResourceData' {Maybe Text
s3Uri :: Maybe Text
$sel:s3Uri:S3MachineLearningModelResourceData' :: S3MachineLearningModelResourceData -> Maybe Text
s3Uri} -> Maybe Text
s3Uri) (\s :: S3MachineLearningModelResourceData
s@S3MachineLearningModelResourceData' {} Maybe Text
a -> S3MachineLearningModelResourceData
s {$sel:s3Uri:S3MachineLearningModelResourceData' :: Maybe Text
s3Uri = Maybe Text
a} :: S3MachineLearningModelResourceData)

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

instance
  Prelude.Hashable
    S3MachineLearningModelResourceData
  where
  hashWithSalt :: Int -> S3MachineLearningModelResourceData -> Int
hashWithSalt
    Int
_salt
    S3MachineLearningModelResourceData' {Maybe Text
Maybe ResourceDownloadOwnerSetting
s3Uri :: Maybe Text
ownerSetting :: Maybe ResourceDownloadOwnerSetting
destinationPath :: Maybe Text
$sel:s3Uri:S3MachineLearningModelResourceData' :: S3MachineLearningModelResourceData -> Maybe Text
$sel:ownerSetting:S3MachineLearningModelResourceData' :: S3MachineLearningModelResourceData
-> Maybe ResourceDownloadOwnerSetting
$sel:destinationPath:S3MachineLearningModelResourceData' :: S3MachineLearningModelResourceData -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationPath
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceDownloadOwnerSetting
ownerSetting
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Uri

instance
  Prelude.NFData
    S3MachineLearningModelResourceData
  where
  rnf :: S3MachineLearningModelResourceData -> ()
rnf S3MachineLearningModelResourceData' {Maybe Text
Maybe ResourceDownloadOwnerSetting
s3Uri :: Maybe Text
ownerSetting :: Maybe ResourceDownloadOwnerSetting
destinationPath :: Maybe Text
$sel:s3Uri:S3MachineLearningModelResourceData' :: S3MachineLearningModelResourceData -> Maybe Text
$sel:ownerSetting:S3MachineLearningModelResourceData' :: S3MachineLearningModelResourceData
-> Maybe ResourceDownloadOwnerSetting
$sel:destinationPath:S3MachineLearningModelResourceData' :: S3MachineLearningModelResourceData -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceDownloadOwnerSetting
ownerSetting
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Uri

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