{-# 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.CustomerProfiles.Types.AppflowIntegrationWorkflowAttributes
-- 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.CustomerProfiles.Types.AppflowIntegrationWorkflowAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CustomerProfiles.Types.SourceConnectorType
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Structure holding all @APPFLOW_INTEGRATION@ specific workflow
-- attributes.
--
-- /See:/ 'newAppflowIntegrationWorkflowAttributes' smart constructor.
data AppflowIntegrationWorkflowAttributes = AppflowIntegrationWorkflowAttributes'
  { -- | The Amazon Resource Name (ARN) of the IAM role. Customer Profiles
    -- assumes this role to create resources on your behalf as part of workflow
    -- execution.
    AppflowIntegrationWorkflowAttributes -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | Specifies the source connector type, such as Salesforce, ServiceNow, and
    -- Marketo. Indicates source of ingestion.
    AppflowIntegrationWorkflowAttributes -> SourceConnectorType
sourceConnectorType :: SourceConnectorType,
    -- | The name of the AppFlow connector profile used for ingestion.
    AppflowIntegrationWorkflowAttributes -> Text
connectorProfileName :: Prelude.Text
  }
  deriving (AppflowIntegrationWorkflowAttributes
-> AppflowIntegrationWorkflowAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppflowIntegrationWorkflowAttributes
-> AppflowIntegrationWorkflowAttributes -> Bool
$c/= :: AppflowIntegrationWorkflowAttributes
-> AppflowIntegrationWorkflowAttributes -> Bool
== :: AppflowIntegrationWorkflowAttributes
-> AppflowIntegrationWorkflowAttributes -> Bool
$c== :: AppflowIntegrationWorkflowAttributes
-> AppflowIntegrationWorkflowAttributes -> Bool
Prelude.Eq, ReadPrec [AppflowIntegrationWorkflowAttributes]
ReadPrec AppflowIntegrationWorkflowAttributes
Int -> ReadS AppflowIntegrationWorkflowAttributes
ReadS [AppflowIntegrationWorkflowAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppflowIntegrationWorkflowAttributes]
$creadListPrec :: ReadPrec [AppflowIntegrationWorkflowAttributes]
readPrec :: ReadPrec AppflowIntegrationWorkflowAttributes
$creadPrec :: ReadPrec AppflowIntegrationWorkflowAttributes
readList :: ReadS [AppflowIntegrationWorkflowAttributes]
$creadList :: ReadS [AppflowIntegrationWorkflowAttributes]
readsPrec :: Int -> ReadS AppflowIntegrationWorkflowAttributes
$creadsPrec :: Int -> ReadS AppflowIntegrationWorkflowAttributes
Prelude.Read, Int -> AppflowIntegrationWorkflowAttributes -> ShowS
[AppflowIntegrationWorkflowAttributes] -> ShowS
AppflowIntegrationWorkflowAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppflowIntegrationWorkflowAttributes] -> ShowS
$cshowList :: [AppflowIntegrationWorkflowAttributes] -> ShowS
show :: AppflowIntegrationWorkflowAttributes -> String
$cshow :: AppflowIntegrationWorkflowAttributes -> String
showsPrec :: Int -> AppflowIntegrationWorkflowAttributes -> ShowS
$cshowsPrec :: Int -> AppflowIntegrationWorkflowAttributes -> ShowS
Prelude.Show, forall x.
Rep AppflowIntegrationWorkflowAttributes x
-> AppflowIntegrationWorkflowAttributes
forall x.
AppflowIntegrationWorkflowAttributes
-> Rep AppflowIntegrationWorkflowAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AppflowIntegrationWorkflowAttributes x
-> AppflowIntegrationWorkflowAttributes
$cfrom :: forall x.
AppflowIntegrationWorkflowAttributes
-> Rep AppflowIntegrationWorkflowAttributes x
Prelude.Generic)

-- |
-- Create a value of 'AppflowIntegrationWorkflowAttributes' 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:
--
-- 'roleArn', 'appflowIntegrationWorkflowAttributes_roleArn' - The Amazon Resource Name (ARN) of the IAM role. Customer Profiles
-- assumes this role to create resources on your behalf as part of workflow
-- execution.
--
-- 'sourceConnectorType', 'appflowIntegrationWorkflowAttributes_sourceConnectorType' - Specifies the source connector type, such as Salesforce, ServiceNow, and
-- Marketo. Indicates source of ingestion.
--
-- 'connectorProfileName', 'appflowIntegrationWorkflowAttributes_connectorProfileName' - The name of the AppFlow connector profile used for ingestion.
newAppflowIntegrationWorkflowAttributes ::
  -- | 'sourceConnectorType'
  SourceConnectorType ->
  -- | 'connectorProfileName'
  Prelude.Text ->
  AppflowIntegrationWorkflowAttributes
newAppflowIntegrationWorkflowAttributes :: SourceConnectorType -> Text -> AppflowIntegrationWorkflowAttributes
newAppflowIntegrationWorkflowAttributes
  SourceConnectorType
pSourceConnectorType_
  Text
pConnectorProfileName_ =
    AppflowIntegrationWorkflowAttributes'
      { $sel:roleArn:AppflowIntegrationWorkflowAttributes' :: Maybe Text
roleArn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:sourceConnectorType:AppflowIntegrationWorkflowAttributes' :: SourceConnectorType
sourceConnectorType =
          SourceConnectorType
pSourceConnectorType_,
        $sel:connectorProfileName:AppflowIntegrationWorkflowAttributes' :: Text
connectorProfileName =
          Text
pConnectorProfileName_
      }

-- | The Amazon Resource Name (ARN) of the IAM role. Customer Profiles
-- assumes this role to create resources on your behalf as part of workflow
-- execution.
appflowIntegrationWorkflowAttributes_roleArn :: Lens.Lens' AppflowIntegrationWorkflowAttributes (Prelude.Maybe Prelude.Text)
appflowIntegrationWorkflowAttributes_roleArn :: Lens' AppflowIntegrationWorkflowAttributes (Maybe Text)
appflowIntegrationWorkflowAttributes_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppflowIntegrationWorkflowAttributes' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: AppflowIntegrationWorkflowAttributes
s@AppflowIntegrationWorkflowAttributes' {} Maybe Text
a -> AppflowIntegrationWorkflowAttributes
s {$sel:roleArn:AppflowIntegrationWorkflowAttributes' :: Maybe Text
roleArn = Maybe Text
a} :: AppflowIntegrationWorkflowAttributes)

-- | Specifies the source connector type, such as Salesforce, ServiceNow, and
-- Marketo. Indicates source of ingestion.
appflowIntegrationWorkflowAttributes_sourceConnectorType :: Lens.Lens' AppflowIntegrationWorkflowAttributes SourceConnectorType
appflowIntegrationWorkflowAttributes_sourceConnectorType :: Lens' AppflowIntegrationWorkflowAttributes SourceConnectorType
appflowIntegrationWorkflowAttributes_sourceConnectorType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppflowIntegrationWorkflowAttributes' {SourceConnectorType
sourceConnectorType :: SourceConnectorType
$sel:sourceConnectorType:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> SourceConnectorType
sourceConnectorType} -> SourceConnectorType
sourceConnectorType) (\s :: AppflowIntegrationWorkflowAttributes
s@AppflowIntegrationWorkflowAttributes' {} SourceConnectorType
a -> AppflowIntegrationWorkflowAttributes
s {$sel:sourceConnectorType:AppflowIntegrationWorkflowAttributes' :: SourceConnectorType
sourceConnectorType = SourceConnectorType
a} :: AppflowIntegrationWorkflowAttributes)

-- | The name of the AppFlow connector profile used for ingestion.
appflowIntegrationWorkflowAttributes_connectorProfileName :: Lens.Lens' AppflowIntegrationWorkflowAttributes Prelude.Text
appflowIntegrationWorkflowAttributes_connectorProfileName :: Lens' AppflowIntegrationWorkflowAttributes Text
appflowIntegrationWorkflowAttributes_connectorProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppflowIntegrationWorkflowAttributes' {Text
connectorProfileName :: Text
$sel:connectorProfileName:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> Text
connectorProfileName} -> Text
connectorProfileName) (\s :: AppflowIntegrationWorkflowAttributes
s@AppflowIntegrationWorkflowAttributes' {} Text
a -> AppflowIntegrationWorkflowAttributes
s {$sel:connectorProfileName:AppflowIntegrationWorkflowAttributes' :: Text
connectorProfileName = Text
a} :: AppflowIntegrationWorkflowAttributes)

instance
  Data.FromJSON
    AppflowIntegrationWorkflowAttributes
  where
  parseJSON :: Value -> Parser AppflowIntegrationWorkflowAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AppflowIntegrationWorkflowAttributes"
      ( \Object
x ->
          Maybe Text
-> SourceConnectorType
-> Text
-> AppflowIntegrationWorkflowAttributes
AppflowIntegrationWorkflowAttributes'
            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
"RoleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SourceConnectorType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ConnectorProfileName")
      )

instance
  Prelude.Hashable
    AppflowIntegrationWorkflowAttributes
  where
  hashWithSalt :: Int -> AppflowIntegrationWorkflowAttributes -> Int
hashWithSalt
    Int
_salt
    AppflowIntegrationWorkflowAttributes' {Maybe Text
Text
SourceConnectorType
connectorProfileName :: Text
sourceConnectorType :: SourceConnectorType
roleArn :: Maybe Text
$sel:connectorProfileName:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> Text
$sel:sourceConnectorType:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> SourceConnectorType
$sel:roleArn:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SourceConnectorType
sourceConnectorType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectorProfileName

instance
  Prelude.NFData
    AppflowIntegrationWorkflowAttributes
  where
  rnf :: AppflowIntegrationWorkflowAttributes -> ()
rnf AppflowIntegrationWorkflowAttributes' {Maybe Text
Text
SourceConnectorType
connectorProfileName :: Text
sourceConnectorType :: SourceConnectorType
roleArn :: Maybe Text
$sel:connectorProfileName:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> Text
$sel:sourceConnectorType:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> SourceConnectorType
$sel:roleArn:AppflowIntegrationWorkflowAttributes' :: AppflowIntegrationWorkflowAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SourceConnectorType
sourceConnectorType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectorProfileName