# Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 18.6.0


from . import AWSObject
from . import AWSProperty
from troposphere import Tags
from .validators import boolean
from .validators import double


class AmplitudeConnectorProfileCredentials(AWSProperty):
    props = {
        'ApiKey': (basestring, True),
        'SecretKey': (basestring, True),
    }


class DatadogConnectorProfileCredentials(AWSProperty):
    props = {
        'ApiKey': (basestring, True),
        'ApplicationKey': (basestring, True),
    }


class DynatraceConnectorProfileCredentials(AWSProperty):
    props = {
        'ApiToken': (basestring, True),
    }


class ConnectorOAuthRequest(AWSProperty):
    props = {
        'AuthCode': (basestring, False),
        'RedirectUri': (basestring, False),
    }


class GoogleAnalyticsConnectorProfileCredentials(AWSProperty):
    props = {
        'AccessToken': (basestring, False),
        'ClientId': (basestring, True),
        'ClientSecret': (basestring, True),
        'ConnectorOAuthRequest': (ConnectorOAuthRequest, False),
        'RefreshToken': (basestring, False),
    }


class InforNexusConnectorProfileCredentials(AWSProperty):
    props = {
        'AccessKeyId': (basestring, True),
        'Datakey': (basestring, True),
        'SecretAccessKey': (basestring, True),
        'UserId': (basestring, True),
    }


class MarketoConnectorProfileCredentials(AWSProperty):
    props = {
        'AccessToken': (basestring, False),
        'ClientId': (basestring, True),
        'ClientSecret': (basestring, True),
        'ConnectorOAuthRequest': (ConnectorOAuthRequest, False),
    }


class RedshiftConnectorProfileCredentials(AWSProperty):
    props = {
        'Password': (basestring, True),
        'Username': (basestring, True),
    }


class SalesforceConnectorProfileCredentials(AWSProperty):
    props = {
        'AccessToken': (basestring, False),
        'ConnectorOAuthRequest': (ConnectorOAuthRequest, False),
        'RefreshToken': (basestring, False),
    }


class ServiceNowConnectorProfileCredentials(AWSProperty):
    props = {
        'Password': (basestring, True),
        'Username': (basestring, True),
    }


class SingularConnectorProfileCredentials(AWSProperty):
    props = {
        'ApiKey': (basestring, True),
    }


class SlackConnectorProfileCredentials(AWSProperty):
    props = {
        'AccessToken': (basestring, False),
        'ClientId': (basestring, True),
        'ClientSecret': (basestring, True),
        'ConnectorOAuthRequest': (ConnectorOAuthRequest, False),
    }


class SnowflakeConnectorProfileCredentials(AWSProperty):
    props = {
        'Password': (basestring, True),
        'Username': (basestring, True),
    }


class TrendmicroConnectorProfileCredentials(AWSProperty):
    props = {
        'ApiSecretKey': (basestring, True),
    }


class VeevaConnectorProfileCredentials(AWSProperty):
    props = {
        'Password': (basestring, True),
        'Username': (basestring, True),
    }


class ZendeskConnectorProfileCredentials(AWSProperty):
    props = {
        'AccessToken': (basestring, False),
        'ClientId': (basestring, True),
        'ClientSecret': (basestring, True),
        'ConnectorOAuthRequest': (ConnectorOAuthRequest, False),
    }


class ConnectorProfileCredentials(AWSProperty):
    props = {
        'Amplitude': (AmplitudeConnectorProfileCredentials, False),
        'Datadog': (DatadogConnectorProfileCredentials, False),
        'Dynatrace': (DynatraceConnectorProfileCredentials, False),
        'GoogleAnalytics':
            (GoogleAnalyticsConnectorProfileCredentials, False),
        'InforNexus': (InforNexusConnectorProfileCredentials, False),
        'Marketo': (MarketoConnectorProfileCredentials, False),
        'Redshift': (RedshiftConnectorProfileCredentials, False),
        'Salesforce': (SalesforceConnectorProfileCredentials, False),
        'ServiceNow': (ServiceNowConnectorProfileCredentials, False),
        'Singular': (SingularConnectorProfileCredentials, False),
        'Slack': (SlackConnectorProfileCredentials, False),
        'Snowflake': (SnowflakeConnectorProfileCredentials, False),
        'Trendmicro': (TrendmicroConnectorProfileCredentials, False),
        'Veeva': (VeevaConnectorProfileCredentials, False),
        'Zendesk': (ZendeskConnectorProfileCredentials, False),
    }


class DatadogConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class DynatraceConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class InforNexusConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class MarketoConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class RedshiftConnectorProfileProperties(AWSProperty):
    props = {
        'BucketName': (basestring, True),
        'BucketPrefix': (basestring, False),
        'DatabaseUrl': (basestring, True),
        'RoleArn': (basestring, True),
    }


class SalesforceConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, False),
        'isSandboxEnvironment': (boolean, False),
    }


class ServiceNowConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class SlackConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class SnowflakeConnectorProfileProperties(AWSProperty):
    props = {
        'AccountName': (basestring, False),
        'BucketName': (basestring, True),
        'BucketPrefix': (basestring, False),
        'PrivateLinkServiceName': (basestring, False),
        'Region': (basestring, False),
        'Stage': (basestring, True),
        'Warehouse': (basestring, True),
    }


class VeevaConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class ZendeskConnectorProfileProperties(AWSProperty):
    props = {
        'InstanceUrl': (basestring, True),
    }


class ConnectorProfileProperties(AWSProperty):
    props = {
        'Datadog': (DatadogConnectorProfileProperties, False),
        'Dynatrace': (DynatraceConnectorProfileProperties, False),
        'InforNexus': (InforNexusConnectorProfileProperties, False),
        'Marketo': (MarketoConnectorProfileProperties, False),
        'Redshift': (RedshiftConnectorProfileProperties, False),
        'Salesforce': (SalesforceConnectorProfileProperties, False),
        'ServiceNow': (ServiceNowConnectorProfileProperties, False),
        'Slack': (SlackConnectorProfileProperties, False),
        'Snowflake': (SnowflakeConnectorProfileProperties, False),
        'Veeva': (VeevaConnectorProfileProperties, False),
        'Zendesk': (ZendeskConnectorProfileProperties, False),
    }


class ConnectorProfileConfig(AWSProperty):
    props = {
        'ConnectorProfileCredentials': (ConnectorProfileCredentials, True),
        'ConnectorProfileProperties': (ConnectorProfileProperties, False),
    }


class ConnectorProfile(AWSObject):
    resource_type = "AWS::AppFlow::ConnectorProfile"

    props = {
        'ConnectionMode': (basestring, True),
        'ConnectorProfileConfig': (ConnectorProfileConfig, False),
        'ConnectorProfileName': (basestring, True),
        'ConnectorType': (basestring, True),
        'KMSArn': (basestring, False),
    }


class ErrorHandlingConfig(AWSProperty):
    props = {
        'BucketName': (basestring, False),
        'BucketPrefix': (basestring, False),
        'FailOnFirstError': (boolean, False),
    }


class EventBridgeDestinationProperties(AWSProperty):
    props = {
        'ErrorHandlingConfig': (ErrorHandlingConfig, False),
        'Object': (basestring, True),
    }


class RedshiftDestinationProperties(AWSProperty):
    props = {
        'BucketPrefix': (basestring, False),
        'ErrorHandlingConfig': (ErrorHandlingConfig, False),
        'IntermediateBucketName': (basestring, True),
        'Object': (basestring, True),
    }


class AggregationConfig(AWSProperty):
    props = {
        'AggregationType': (basestring, False),
    }


class PrefixConfig(AWSProperty):
    props = {
        'PrefixFormat': (basestring, False),
        'PrefixType': (basestring, False),
    }


class S3OutputFormatConfig(AWSProperty):
    props = {
        'AggregationConfig': (AggregationConfig, False),
        'FileType': (basestring, False),
        'PrefixConfig': (PrefixConfig, False),
    }


class S3DestinationProperties(AWSProperty):
    props = {
        'BucketName': (basestring, True),
        'BucketPrefix': (basestring, False),
        'S3OutputFormatConfig': (S3OutputFormatConfig, False),
    }


class SalesforceDestinationProperties(AWSProperty):
    props = {
        'ErrorHandlingConfig': (ErrorHandlingConfig, False),
        'Object': (basestring, True),
    }


class SnowflakeDestinationProperties(AWSProperty):
    props = {
        'BucketPrefix': (basestring, False),
        'ErrorHandlingConfig': (ErrorHandlingConfig, False),
        'IntermediateBucketName': (basestring, True),
        'Object': (basestring, True),
    }


class DestinationConnectorProperties(AWSProperty):
    props = {
        'EventBridge': (EventBridgeDestinationProperties, False),
        'Redshift': (RedshiftDestinationProperties, False),
        'S3': (S3DestinationProperties, False),
        'Salesforce': (SalesforceDestinationProperties, False),
        'Snowflake': (SnowflakeDestinationProperties, False),
    }


class DestinationFlowConfig(AWSProperty):
    props = {
        'ConnectorProfileName': (basestring, False),
        'ConnectorType': (basestring, True),
        'DestinationConnectorProperties':
            (DestinationConnectorProperties, True),
    }


class AmplitudeSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class DatadogSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class DynatraceSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class GoogleAnalyticsSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class InforNexusSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class MarketoSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class S3SourceProperties(AWSProperty):
    props = {
        'BucketName': (basestring, True),
        'BucketPrefix': (basestring, True),
    }


class SalesforceSourceProperties(AWSProperty):
    props = {
        'EnableDynamicFieldUpdate': (boolean, False),
        'IncludeDeletedRecords': (boolean, False),
        'Object': (basestring, True),
    }


class ServiceNowSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class SingularSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class SlackSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class TrendmicroSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class VeevaSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class ZendeskSourceProperties(AWSProperty):
    props = {
        'Object': (basestring, True),
    }


class SourceConnectorProperties(AWSProperty):
    props = {
        'Amplitude': (AmplitudeSourceProperties, False),
        'Datadog': (DatadogSourceProperties, False),
        'Dynatrace': (DynatraceSourceProperties, False),
        'GoogleAnalytics': (GoogleAnalyticsSourceProperties, False),
        'InforNexus': (InforNexusSourceProperties, False),
        'Marketo': (MarketoSourceProperties, False),
        'S3': (S3SourceProperties, False),
        'Salesforce': (SalesforceSourceProperties, False),
        'ServiceNow': (ServiceNowSourceProperties, False),
        'Singular': (SingularSourceProperties, False),
        'Slack': (SlackSourceProperties, False),
        'Trendmicro': (TrendmicroSourceProperties, False),
        'Veeva': (VeevaSourceProperties, False),
        'Zendesk': (ZendeskSourceProperties, False),
    }


class SourceFlowConfig(AWSProperty):
    props = {
        'ConnectorProfileName': (basestring, False),
        'ConnectorType': (basestring, True),
        'SourceConnectorProperties': (SourceConnectorProperties, True),
    }


class ConnectorOperator(AWSProperty):
    props = {
        'Amplitude': (basestring, False),
        'Datadog': (basestring, False),
        'Dynatrace': (basestring, False),
        'GoogleAnalytics': (basestring, False),
        'InforNexus': (basestring, False),
        'Marketo': (basestring, False),
        'S3': (basestring, False),
        'Salesforce': (basestring, False),
        'ServiceNow': (basestring, False),
        'Singular': (basestring, False),
        'Slack': (basestring, False),
        'Trendmicro': (basestring, False),
        'Veeva': (basestring, False),
        'Zendesk': (basestring, False),
    }


class TaskPropertiesObject(AWSProperty):
    props = {
        'Key': (basestring, True),
        'Value': (basestring, True),
    }


class Task(AWSProperty):
    props = {
        'ConnectorOperator': (ConnectorOperator, False),
        'DestinationField': (basestring, False),
        'SourceFields': ([basestring], True),
        'TaskProperties': ([TaskPropertiesObject], False),
        'TaskType': (basestring, True),
    }


class ScheduledTriggerProperties(AWSProperty):
    props = {
        'DataPullMode': (basestring, False),
        'ScheduleEndTime': (double, False),
        'ScheduleExpression': (basestring, True),
        'ScheduleStartTime': (double, False),
        'TimeZone': (basestring, False),
    }


class TriggerConfig(AWSProperty):
    props = {
        'TriggerProperties': (ScheduledTriggerProperties, False),
        'TriggerType': (basestring, True),
    }


class Flow(AWSObject):
    resource_type = "AWS::AppFlow::Flow"

    props = {
        'Description': (basestring, False),
        'DestinationFlowConfigList': ([DestinationFlowConfig], True),
        'FlowName': (basestring, True),
        'KMSArn': (basestring, False),
        'SourceFlowConfig': (SourceFlowConfig, True),
        'Tags': (Tags, False),
        'Tasks': ([Task], True),
        'TriggerConfig': (TriggerConfig, True),
    }
