{-# 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.LookoutVision.Types.OutputS3Object
-- 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.LookoutVision.Types.OutputS3Object where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The S3 location where Amazon Lookout for Vision saves training output.
--
-- /See:/ 'newOutputS3Object' smart constructor.
data OutputS3Object = OutputS3Object'
  { -- | The bucket that contains the training output.
    OutputS3Object -> Text
bucket :: Prelude.Text,
    -- | The location of the training output in the bucket.
    OutputS3Object -> Text
key :: Prelude.Text
  }
  deriving (OutputS3Object -> OutputS3Object -> Bool
(OutputS3Object -> OutputS3Object -> Bool)
-> (OutputS3Object -> OutputS3Object -> Bool) -> Eq OutputS3Object
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputS3Object -> OutputS3Object -> Bool
$c/= :: OutputS3Object -> OutputS3Object -> Bool
== :: OutputS3Object -> OutputS3Object -> Bool
$c== :: OutputS3Object -> OutputS3Object -> Bool
Prelude.Eq, ReadPrec [OutputS3Object]
ReadPrec OutputS3Object
Int -> ReadS OutputS3Object
ReadS [OutputS3Object]
(Int -> ReadS OutputS3Object)
-> ReadS [OutputS3Object]
-> ReadPrec OutputS3Object
-> ReadPrec [OutputS3Object]
-> Read OutputS3Object
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutputS3Object]
$creadListPrec :: ReadPrec [OutputS3Object]
readPrec :: ReadPrec OutputS3Object
$creadPrec :: ReadPrec OutputS3Object
readList :: ReadS [OutputS3Object]
$creadList :: ReadS [OutputS3Object]
readsPrec :: Int -> ReadS OutputS3Object
$creadsPrec :: Int -> ReadS OutputS3Object
Prelude.Read, Int -> OutputS3Object -> ShowS
[OutputS3Object] -> ShowS
OutputS3Object -> String
(Int -> OutputS3Object -> ShowS)
-> (OutputS3Object -> String)
-> ([OutputS3Object] -> ShowS)
-> Show OutputS3Object
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputS3Object] -> ShowS
$cshowList :: [OutputS3Object] -> ShowS
show :: OutputS3Object -> String
$cshow :: OutputS3Object -> String
showsPrec :: Int -> OutputS3Object -> ShowS
$cshowsPrec :: Int -> OutputS3Object -> ShowS
Prelude.Show, (forall x. OutputS3Object -> Rep OutputS3Object x)
-> (forall x. Rep OutputS3Object x -> OutputS3Object)
-> Generic OutputS3Object
forall x. Rep OutputS3Object x -> OutputS3Object
forall x. OutputS3Object -> Rep OutputS3Object x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputS3Object x -> OutputS3Object
$cfrom :: forall x. OutputS3Object -> Rep OutputS3Object x
Prelude.Generic)

-- |
-- Create a value of 'OutputS3Object' 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:
--
-- 'bucket', 'outputS3Object_bucket' - The bucket that contains the training output.
--
-- 'key', 'outputS3Object_key' - The location of the training output in the bucket.
newOutputS3Object ::
  -- | 'bucket'
  Prelude.Text ->
  -- | 'key'
  Prelude.Text ->
  OutputS3Object
newOutputS3Object :: Text -> Text -> OutputS3Object
newOutputS3Object Text
pBucket_ Text
pKey_ =
  OutputS3Object' :: Text -> Text -> OutputS3Object
OutputS3Object' {$sel:bucket:OutputS3Object' :: Text
bucket = Text
pBucket_, $sel:key:OutputS3Object' :: Text
key = Text
pKey_}

-- | The bucket that contains the training output.
outputS3Object_bucket :: Lens.Lens' OutputS3Object Prelude.Text
outputS3Object_bucket :: (Text -> f Text) -> OutputS3Object -> f OutputS3Object
outputS3Object_bucket = (OutputS3Object -> Text)
-> (OutputS3Object -> Text -> OutputS3Object)
-> Lens OutputS3Object OutputS3Object Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputS3Object' {Text
bucket :: Text
$sel:bucket:OutputS3Object' :: OutputS3Object -> Text
bucket} -> Text
bucket) (\s :: OutputS3Object
s@OutputS3Object' {} Text
a -> OutputS3Object
s {$sel:bucket:OutputS3Object' :: Text
bucket = Text
a} :: OutputS3Object)

-- | The location of the training output in the bucket.
outputS3Object_key :: Lens.Lens' OutputS3Object Prelude.Text
outputS3Object_key :: (Text -> f Text) -> OutputS3Object -> f OutputS3Object
outputS3Object_key = (OutputS3Object -> Text)
-> (OutputS3Object -> Text -> OutputS3Object)
-> Lens OutputS3Object OutputS3Object Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputS3Object' {Text
key :: Text
$sel:key:OutputS3Object' :: OutputS3Object -> Text
key} -> Text
key) (\s :: OutputS3Object
s@OutputS3Object' {} Text
a -> OutputS3Object
s {$sel:key:OutputS3Object' :: Text
key = Text
a} :: OutputS3Object)

instance Core.FromJSON OutputS3Object where
  parseJSON :: Value -> Parser OutputS3Object
parseJSON =
    String
-> (Object -> Parser OutputS3Object)
-> Value
-> Parser OutputS3Object
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OutputS3Object"
      ( \Object
x ->
          Text -> Text -> OutputS3Object
OutputS3Object'
            (Text -> Text -> OutputS3Object)
-> Parser Text -> Parser (Text -> OutputS3Object)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Bucket") Parser (Text -> OutputS3Object)
-> Parser Text -> Parser OutputS3Object
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Key")
      )

instance Prelude.Hashable OutputS3Object

instance Prelude.NFData OutputS3Object