{-# 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.LookoutEquipment.Types.LabelsInputConfiguration
-- 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.LookoutEquipment.Types.LabelsInputConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutEquipment.Types.LabelsS3InputConfiguration
import qualified Amazonka.Prelude as Prelude

-- | Contains the configuration information for the S3 location being used to
-- hold label data.
--
-- /See:/ 'newLabelsInputConfiguration' smart constructor.
data LabelsInputConfiguration = LabelsInputConfiguration'
  { -- | The name of the label group to be used for label data.
    LabelsInputConfiguration -> Maybe Text
labelGroupName :: Prelude.Maybe Prelude.Text,
    -- | Contains location information for the S3 location being used for label
    -- data.
    LabelsInputConfiguration -> Maybe LabelsS3InputConfiguration
s3InputConfiguration :: Prelude.Maybe LabelsS3InputConfiguration
  }
  deriving (LabelsInputConfiguration -> LabelsInputConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelsInputConfiguration -> LabelsInputConfiguration -> Bool
$c/= :: LabelsInputConfiguration -> LabelsInputConfiguration -> Bool
== :: LabelsInputConfiguration -> LabelsInputConfiguration -> Bool
$c== :: LabelsInputConfiguration -> LabelsInputConfiguration -> Bool
Prelude.Eq, ReadPrec [LabelsInputConfiguration]
ReadPrec LabelsInputConfiguration
Int -> ReadS LabelsInputConfiguration
ReadS [LabelsInputConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelsInputConfiguration]
$creadListPrec :: ReadPrec [LabelsInputConfiguration]
readPrec :: ReadPrec LabelsInputConfiguration
$creadPrec :: ReadPrec LabelsInputConfiguration
readList :: ReadS [LabelsInputConfiguration]
$creadList :: ReadS [LabelsInputConfiguration]
readsPrec :: Int -> ReadS LabelsInputConfiguration
$creadsPrec :: Int -> ReadS LabelsInputConfiguration
Prelude.Read, Int -> LabelsInputConfiguration -> ShowS
[LabelsInputConfiguration] -> ShowS
LabelsInputConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelsInputConfiguration] -> ShowS
$cshowList :: [LabelsInputConfiguration] -> ShowS
show :: LabelsInputConfiguration -> String
$cshow :: LabelsInputConfiguration -> String
showsPrec :: Int -> LabelsInputConfiguration -> ShowS
$cshowsPrec :: Int -> LabelsInputConfiguration -> ShowS
Prelude.Show, forall x.
Rep LabelsInputConfiguration x -> LabelsInputConfiguration
forall x.
LabelsInputConfiguration -> Rep LabelsInputConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LabelsInputConfiguration x -> LabelsInputConfiguration
$cfrom :: forall x.
LabelsInputConfiguration -> Rep LabelsInputConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'LabelsInputConfiguration' 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:
--
-- 'labelGroupName', 'labelsInputConfiguration_labelGroupName' - The name of the label group to be used for label data.
--
-- 's3InputConfiguration', 'labelsInputConfiguration_s3InputConfiguration' - Contains location information for the S3 location being used for label
-- data.
newLabelsInputConfiguration ::
  LabelsInputConfiguration
newLabelsInputConfiguration :: LabelsInputConfiguration
newLabelsInputConfiguration =
  LabelsInputConfiguration'
    { $sel:labelGroupName:LabelsInputConfiguration' :: Maybe Text
labelGroupName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:s3InputConfiguration:LabelsInputConfiguration' :: Maybe LabelsS3InputConfiguration
s3InputConfiguration = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the label group to be used for label data.
labelsInputConfiguration_labelGroupName :: Lens.Lens' LabelsInputConfiguration (Prelude.Maybe Prelude.Text)
labelsInputConfiguration_labelGroupName :: Lens' LabelsInputConfiguration (Maybe Text)
labelsInputConfiguration_labelGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelsInputConfiguration' {Maybe Text
labelGroupName :: Maybe Text
$sel:labelGroupName:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe Text
labelGroupName} -> Maybe Text
labelGroupName) (\s :: LabelsInputConfiguration
s@LabelsInputConfiguration' {} Maybe Text
a -> LabelsInputConfiguration
s {$sel:labelGroupName:LabelsInputConfiguration' :: Maybe Text
labelGroupName = Maybe Text
a} :: LabelsInputConfiguration)

-- | Contains location information for the S3 location being used for label
-- data.
labelsInputConfiguration_s3InputConfiguration :: Lens.Lens' LabelsInputConfiguration (Prelude.Maybe LabelsS3InputConfiguration)
labelsInputConfiguration_s3InputConfiguration :: Lens' LabelsInputConfiguration (Maybe LabelsS3InputConfiguration)
labelsInputConfiguration_s3InputConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelsInputConfiguration' {Maybe LabelsS3InputConfiguration
s3InputConfiguration :: Maybe LabelsS3InputConfiguration
$sel:s3InputConfiguration:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe LabelsS3InputConfiguration
s3InputConfiguration} -> Maybe LabelsS3InputConfiguration
s3InputConfiguration) (\s :: LabelsInputConfiguration
s@LabelsInputConfiguration' {} Maybe LabelsS3InputConfiguration
a -> LabelsInputConfiguration
s {$sel:s3InputConfiguration:LabelsInputConfiguration' :: Maybe LabelsS3InputConfiguration
s3InputConfiguration = Maybe LabelsS3InputConfiguration
a} :: LabelsInputConfiguration)

instance Data.FromJSON LabelsInputConfiguration where
  parseJSON :: Value -> Parser LabelsInputConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LabelsInputConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe LabelsS3InputConfiguration -> LabelsInputConfiguration
LabelsInputConfiguration'
            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
"LabelGroupName")
            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
"S3InputConfiguration")
      )

instance Prelude.Hashable LabelsInputConfiguration where
  hashWithSalt :: Int -> LabelsInputConfiguration -> Int
hashWithSalt Int
_salt LabelsInputConfiguration' {Maybe Text
Maybe LabelsS3InputConfiguration
s3InputConfiguration :: Maybe LabelsS3InputConfiguration
labelGroupName :: Maybe Text
$sel:s3InputConfiguration:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe LabelsS3InputConfiguration
$sel:labelGroupName:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
labelGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LabelsS3InputConfiguration
s3InputConfiguration

instance Prelude.NFData LabelsInputConfiguration where
  rnf :: LabelsInputConfiguration -> ()
rnf LabelsInputConfiguration' {Maybe Text
Maybe LabelsS3InputConfiguration
s3InputConfiguration :: Maybe LabelsS3InputConfiguration
labelGroupName :: Maybe Text
$sel:s3InputConfiguration:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe LabelsS3InputConfiguration
$sel:labelGroupName:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
labelGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LabelsS3InputConfiguration
s3InputConfiguration

instance Data.ToJSON LabelsInputConfiguration where
  toJSON :: LabelsInputConfiguration -> Value
toJSON LabelsInputConfiguration' {Maybe Text
Maybe LabelsS3InputConfiguration
s3InputConfiguration :: Maybe LabelsS3InputConfiguration
labelGroupName :: Maybe Text
$sel:s3InputConfiguration:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe LabelsS3InputConfiguration
$sel:labelGroupName:LabelsInputConfiguration' :: LabelsInputConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"LabelGroupName" 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
labelGroupName,
            (Key
"S3InputConfiguration" 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 LabelsS3InputConfiguration
s3InputConfiguration
          ]
      )