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

import qualified Amazonka.Core as Core
import Amazonka.CustomerProfiles.Types.MarketoConnectorOperator
import Amazonka.CustomerProfiles.Types.S3ConnectorOperator
import Amazonka.CustomerProfiles.Types.SalesforceConnectorOperator
import Amazonka.CustomerProfiles.Types.ServiceNowConnectorOperator
import Amazonka.CustomerProfiles.Types.ZendeskConnectorOperator
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The operation to be performed on the provided source fields.
--
-- /See:/ 'newConnectorOperator' smart constructor.
data ConnectorOperator = ConnectorOperator'
  { -- | The operation to be performed on the provided ServiceNow source fields.
    ConnectorOperator -> Maybe ServiceNowConnectorOperator
serviceNow :: Prelude.Maybe ServiceNowConnectorOperator,
    -- | The operation to be performed on the provided Marketo source fields.
    ConnectorOperator -> Maybe MarketoConnectorOperator
marketo :: Prelude.Maybe MarketoConnectorOperator,
    -- | The operation to be performed on the provided Salesforce source fields.
    ConnectorOperator -> Maybe SalesforceConnectorOperator
salesforce :: Prelude.Maybe SalesforceConnectorOperator,
    -- | The operation to be performed on the provided Zendesk source fields.
    ConnectorOperator -> Maybe ZendeskConnectorOperator
zendesk :: Prelude.Maybe ZendeskConnectorOperator,
    -- | The operation to be performed on the provided Amazon S3 source fields.
    ConnectorOperator -> Maybe S3ConnectorOperator
s3 :: Prelude.Maybe S3ConnectorOperator
  }
  deriving (ConnectorOperator -> ConnectorOperator -> Bool
(ConnectorOperator -> ConnectorOperator -> Bool)
-> (ConnectorOperator -> ConnectorOperator -> Bool)
-> Eq ConnectorOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectorOperator -> ConnectorOperator -> Bool
$c/= :: ConnectorOperator -> ConnectorOperator -> Bool
== :: ConnectorOperator -> ConnectorOperator -> Bool
$c== :: ConnectorOperator -> ConnectorOperator -> Bool
Prelude.Eq, ReadPrec [ConnectorOperator]
ReadPrec ConnectorOperator
Int -> ReadS ConnectorOperator
ReadS [ConnectorOperator]
(Int -> ReadS ConnectorOperator)
-> ReadS [ConnectorOperator]
-> ReadPrec ConnectorOperator
-> ReadPrec [ConnectorOperator]
-> Read ConnectorOperator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectorOperator]
$creadListPrec :: ReadPrec [ConnectorOperator]
readPrec :: ReadPrec ConnectorOperator
$creadPrec :: ReadPrec ConnectorOperator
readList :: ReadS [ConnectorOperator]
$creadList :: ReadS [ConnectorOperator]
readsPrec :: Int -> ReadS ConnectorOperator
$creadsPrec :: Int -> ReadS ConnectorOperator
Prelude.Read, Int -> ConnectorOperator -> ShowS
[ConnectorOperator] -> ShowS
ConnectorOperator -> String
(Int -> ConnectorOperator -> ShowS)
-> (ConnectorOperator -> String)
-> ([ConnectorOperator] -> ShowS)
-> Show ConnectorOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectorOperator] -> ShowS
$cshowList :: [ConnectorOperator] -> ShowS
show :: ConnectorOperator -> String
$cshow :: ConnectorOperator -> String
showsPrec :: Int -> ConnectorOperator -> ShowS
$cshowsPrec :: Int -> ConnectorOperator -> ShowS
Prelude.Show, (forall x. ConnectorOperator -> Rep ConnectorOperator x)
-> (forall x. Rep ConnectorOperator x -> ConnectorOperator)
-> Generic ConnectorOperator
forall x. Rep ConnectorOperator x -> ConnectorOperator
forall x. ConnectorOperator -> Rep ConnectorOperator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectorOperator x -> ConnectorOperator
$cfrom :: forall x. ConnectorOperator -> Rep ConnectorOperator x
Prelude.Generic)

-- |
-- Create a value of 'ConnectorOperator' 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:
--
-- 'serviceNow', 'connectorOperator_serviceNow' - The operation to be performed on the provided ServiceNow source fields.
--
-- 'marketo', 'connectorOperator_marketo' - The operation to be performed on the provided Marketo source fields.
--
-- 'salesforce', 'connectorOperator_salesforce' - The operation to be performed on the provided Salesforce source fields.
--
-- 'zendesk', 'connectorOperator_zendesk' - The operation to be performed on the provided Zendesk source fields.
--
-- 's3', 'connectorOperator_s3' - The operation to be performed on the provided Amazon S3 source fields.
newConnectorOperator ::
  ConnectorOperator
newConnectorOperator :: ConnectorOperator
newConnectorOperator =
  ConnectorOperator' :: Maybe ServiceNowConnectorOperator
-> Maybe MarketoConnectorOperator
-> Maybe SalesforceConnectorOperator
-> Maybe ZendeskConnectorOperator
-> Maybe S3ConnectorOperator
-> ConnectorOperator
ConnectorOperator'
    { $sel:serviceNow:ConnectorOperator' :: Maybe ServiceNowConnectorOperator
serviceNow = Maybe ServiceNowConnectorOperator
forall a. Maybe a
Prelude.Nothing,
      $sel:marketo:ConnectorOperator' :: Maybe MarketoConnectorOperator
marketo = Maybe MarketoConnectorOperator
forall a. Maybe a
Prelude.Nothing,
      $sel:salesforce:ConnectorOperator' :: Maybe SalesforceConnectorOperator
salesforce = Maybe SalesforceConnectorOperator
forall a. Maybe a
Prelude.Nothing,
      $sel:zendesk:ConnectorOperator' :: Maybe ZendeskConnectorOperator
zendesk = Maybe ZendeskConnectorOperator
forall a. Maybe a
Prelude.Nothing,
      $sel:s3:ConnectorOperator' :: Maybe S3ConnectorOperator
s3 = Maybe S3ConnectorOperator
forall a. Maybe a
Prelude.Nothing
    }

-- | The operation to be performed on the provided ServiceNow source fields.
connectorOperator_serviceNow :: Lens.Lens' ConnectorOperator (Prelude.Maybe ServiceNowConnectorOperator)
connectorOperator_serviceNow :: (Maybe ServiceNowConnectorOperator
 -> f (Maybe ServiceNowConnectorOperator))
-> ConnectorOperator -> f ConnectorOperator
connectorOperator_serviceNow = (ConnectorOperator -> Maybe ServiceNowConnectorOperator)
-> (ConnectorOperator
    -> Maybe ServiceNowConnectorOperator -> ConnectorOperator)
-> Lens
     ConnectorOperator
     ConnectorOperator
     (Maybe ServiceNowConnectorOperator)
     (Maybe ServiceNowConnectorOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorOperator' {Maybe ServiceNowConnectorOperator
serviceNow :: Maybe ServiceNowConnectorOperator
$sel:serviceNow:ConnectorOperator' :: ConnectorOperator -> Maybe ServiceNowConnectorOperator
serviceNow} -> Maybe ServiceNowConnectorOperator
serviceNow) (\s :: ConnectorOperator
s@ConnectorOperator' {} Maybe ServiceNowConnectorOperator
a -> ConnectorOperator
s {$sel:serviceNow:ConnectorOperator' :: Maybe ServiceNowConnectorOperator
serviceNow = Maybe ServiceNowConnectorOperator
a} :: ConnectorOperator)

-- | The operation to be performed on the provided Marketo source fields.
connectorOperator_marketo :: Lens.Lens' ConnectorOperator (Prelude.Maybe MarketoConnectorOperator)
connectorOperator_marketo :: (Maybe MarketoConnectorOperator
 -> f (Maybe MarketoConnectorOperator))
-> ConnectorOperator -> f ConnectorOperator
connectorOperator_marketo = (ConnectorOperator -> Maybe MarketoConnectorOperator)
-> (ConnectorOperator
    -> Maybe MarketoConnectorOperator -> ConnectorOperator)
-> Lens
     ConnectorOperator
     ConnectorOperator
     (Maybe MarketoConnectorOperator)
     (Maybe MarketoConnectorOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorOperator' {Maybe MarketoConnectorOperator
marketo :: Maybe MarketoConnectorOperator
$sel:marketo:ConnectorOperator' :: ConnectorOperator -> Maybe MarketoConnectorOperator
marketo} -> Maybe MarketoConnectorOperator
marketo) (\s :: ConnectorOperator
s@ConnectorOperator' {} Maybe MarketoConnectorOperator
a -> ConnectorOperator
s {$sel:marketo:ConnectorOperator' :: Maybe MarketoConnectorOperator
marketo = Maybe MarketoConnectorOperator
a} :: ConnectorOperator)

-- | The operation to be performed on the provided Salesforce source fields.
connectorOperator_salesforce :: Lens.Lens' ConnectorOperator (Prelude.Maybe SalesforceConnectorOperator)
connectorOperator_salesforce :: (Maybe SalesforceConnectorOperator
 -> f (Maybe SalesforceConnectorOperator))
-> ConnectorOperator -> f ConnectorOperator
connectorOperator_salesforce = (ConnectorOperator -> Maybe SalesforceConnectorOperator)
-> (ConnectorOperator
    -> Maybe SalesforceConnectorOperator -> ConnectorOperator)
-> Lens
     ConnectorOperator
     ConnectorOperator
     (Maybe SalesforceConnectorOperator)
     (Maybe SalesforceConnectorOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorOperator' {Maybe SalesforceConnectorOperator
salesforce :: Maybe SalesforceConnectorOperator
$sel:salesforce:ConnectorOperator' :: ConnectorOperator -> Maybe SalesforceConnectorOperator
salesforce} -> Maybe SalesforceConnectorOperator
salesforce) (\s :: ConnectorOperator
s@ConnectorOperator' {} Maybe SalesforceConnectorOperator
a -> ConnectorOperator
s {$sel:salesforce:ConnectorOperator' :: Maybe SalesforceConnectorOperator
salesforce = Maybe SalesforceConnectorOperator
a} :: ConnectorOperator)

-- | The operation to be performed on the provided Zendesk source fields.
connectorOperator_zendesk :: Lens.Lens' ConnectorOperator (Prelude.Maybe ZendeskConnectorOperator)
connectorOperator_zendesk :: (Maybe ZendeskConnectorOperator
 -> f (Maybe ZendeskConnectorOperator))
-> ConnectorOperator -> f ConnectorOperator
connectorOperator_zendesk = (ConnectorOperator -> Maybe ZendeskConnectorOperator)
-> (ConnectorOperator
    -> Maybe ZendeskConnectorOperator -> ConnectorOperator)
-> Lens
     ConnectorOperator
     ConnectorOperator
     (Maybe ZendeskConnectorOperator)
     (Maybe ZendeskConnectorOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorOperator' {Maybe ZendeskConnectorOperator
zendesk :: Maybe ZendeskConnectorOperator
$sel:zendesk:ConnectorOperator' :: ConnectorOperator -> Maybe ZendeskConnectorOperator
zendesk} -> Maybe ZendeskConnectorOperator
zendesk) (\s :: ConnectorOperator
s@ConnectorOperator' {} Maybe ZendeskConnectorOperator
a -> ConnectorOperator
s {$sel:zendesk:ConnectorOperator' :: Maybe ZendeskConnectorOperator
zendesk = Maybe ZendeskConnectorOperator
a} :: ConnectorOperator)

-- | The operation to be performed on the provided Amazon S3 source fields.
connectorOperator_s3 :: Lens.Lens' ConnectorOperator (Prelude.Maybe S3ConnectorOperator)
connectorOperator_s3 :: (Maybe S3ConnectorOperator -> f (Maybe S3ConnectorOperator))
-> ConnectorOperator -> f ConnectorOperator
connectorOperator_s3 = (ConnectorOperator -> Maybe S3ConnectorOperator)
-> (ConnectorOperator
    -> Maybe S3ConnectorOperator -> ConnectorOperator)
-> Lens
     ConnectorOperator
     ConnectorOperator
     (Maybe S3ConnectorOperator)
     (Maybe S3ConnectorOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorOperator' {Maybe S3ConnectorOperator
s3 :: Maybe S3ConnectorOperator
$sel:s3:ConnectorOperator' :: ConnectorOperator -> Maybe S3ConnectorOperator
s3} -> Maybe S3ConnectorOperator
s3) (\s :: ConnectorOperator
s@ConnectorOperator' {} Maybe S3ConnectorOperator
a -> ConnectorOperator
s {$sel:s3:ConnectorOperator' :: Maybe S3ConnectorOperator
s3 = Maybe S3ConnectorOperator
a} :: ConnectorOperator)

instance Prelude.Hashable ConnectorOperator

instance Prelude.NFData ConnectorOperator

instance Core.ToJSON ConnectorOperator where
  toJSON :: ConnectorOperator -> Value
toJSON ConnectorOperator' {Maybe MarketoConnectorOperator
Maybe S3ConnectorOperator
Maybe SalesforceConnectorOperator
Maybe ServiceNowConnectorOperator
Maybe ZendeskConnectorOperator
s3 :: Maybe S3ConnectorOperator
zendesk :: Maybe ZendeskConnectorOperator
salesforce :: Maybe SalesforceConnectorOperator
marketo :: Maybe MarketoConnectorOperator
serviceNow :: Maybe ServiceNowConnectorOperator
$sel:s3:ConnectorOperator' :: ConnectorOperator -> Maybe S3ConnectorOperator
$sel:zendesk:ConnectorOperator' :: ConnectorOperator -> Maybe ZendeskConnectorOperator
$sel:salesforce:ConnectorOperator' :: ConnectorOperator -> Maybe SalesforceConnectorOperator
$sel:marketo:ConnectorOperator' :: ConnectorOperator -> Maybe MarketoConnectorOperator
$sel:serviceNow:ConnectorOperator' :: ConnectorOperator -> Maybe ServiceNowConnectorOperator
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ServiceNow" Text -> ServiceNowConnectorOperator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ServiceNowConnectorOperator -> Pair)
-> Maybe ServiceNowConnectorOperator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceNowConnectorOperator
serviceNow,
            (Text
"Marketo" Text -> MarketoConnectorOperator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MarketoConnectorOperator -> Pair)
-> Maybe MarketoConnectorOperator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MarketoConnectorOperator
marketo,
            (Text
"Salesforce" Text -> SalesforceConnectorOperator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SalesforceConnectorOperator -> Pair)
-> Maybe SalesforceConnectorOperator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SalesforceConnectorOperator
salesforce,
            (Text
"Zendesk" Text -> ZendeskConnectorOperator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ZendeskConnectorOperator -> Pair)
-> Maybe ZendeskConnectorOperator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ZendeskConnectorOperator
zendesk,
            (Text
"S3" Text -> S3ConnectorOperator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3ConnectorOperator -> Pair)
-> Maybe S3ConnectorOperator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3ConnectorOperator
s3
          ]
      )