-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding FlowDefinition to PutIntegration
- Loading branch information
1 parent
f1facf3
commit 424350c
Showing
22 changed files
with
1,638 additions
and
46 deletions.
There are no files selected for viewing
518 changes: 517 additions & 1 deletion
518
aws-customerprofiles-integration/aws-customerprofiles-integration.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...in/java/software/amazon/customerprofiles/integration/translators/ConnectorTranslator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package software.amazon.customerprofiles.integration.translators; | ||
|
||
import software.amazon.awssdk.services.customerprofiles.model.ConnectorOperator; | ||
import software.amazon.awssdk.services.customerprofiles.model.SourceFlowConfig; | ||
|
||
public interface ConnectorTranslator { | ||
SourceFlowConfig toServiceSourceFlowConfig(software.amazon.customerprofiles.integration.SourceFlowConfig model); | ||
ConnectorOperator toServiceConnectorOperator(software.amazon.customerprofiles.integration.ConnectorOperator model); | ||
} |
44 changes: 44 additions & 0 deletions
44
...main/java/software/amazon/customerprofiles/integration/translators/MarketoTranslator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package software.amazon.customerprofiles.integration.translators; | ||
|
||
import com.amazonaws.util.StringUtils; | ||
import software.amazon.awssdk.services.customerprofiles.model.ConnectorOperator; | ||
import software.amazon.awssdk.services.customerprofiles.model.IncrementalPullConfig; | ||
import software.amazon.awssdk.services.customerprofiles.model.MarketoSourceProperties; | ||
import software.amazon.awssdk.services.customerprofiles.model.SourceConnectorProperties; | ||
import software.amazon.awssdk.services.customerprofiles.model.SourceFlowConfig; | ||
import software.amazon.customerprofiles.integration.translators.ConnectorTranslator; | ||
|
||
public class MarketoTranslator implements ConnectorTranslator { | ||
|
||
@Override | ||
public SourceFlowConfig toServiceSourceFlowConfig(software.amazon.customerprofiles.integration.SourceFlowConfig model) { | ||
return SourceFlowConfig.builder() | ||
.connectorProfileName(StringUtils.isNullOrEmpty(model.getConnectorProfileName()) ? null : | ||
model.getConnectorProfileName()) | ||
.connectorType(model.getConnectorType()) | ||
.sourceConnectorProperties( | ||
SourceConnectorProperties.builder() | ||
.marketo(toServiceSourceProperties(model | ||
.getSourceConnectorProperties() | ||
.getMarketo())) | ||
.build() | ||
) | ||
.build(); | ||
} | ||
|
||
private MarketoSourceProperties toServiceSourceProperties(software.amazon.customerprofiles.integration.MarketoSourceProperties model) { | ||
return MarketoSourceProperties.builder() | ||
.object(model.getObject()) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ConnectorOperator toServiceConnectorOperator(software.amazon.customerprofiles.integration.ConnectorOperator model) { | ||
if (model == null) { | ||
return null; | ||
} | ||
return ConnectorOperator.builder() | ||
.marketo(model.getMarketo()) | ||
.build(); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
.../src/main/java/software/amazon/customerprofiles/integration/translators/S3Translator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package software.amazon.customerprofiles.integration.translators; | ||
|
||
import com.amazonaws.util.StringUtils; | ||
import software.amazon.awssdk.services.customerprofiles.model.ConnectorOperator; | ||
import software.amazon.awssdk.services.customerprofiles.model.IncrementalPullConfig; | ||
import software.amazon.awssdk.services.customerprofiles.model.S3SourceProperties; | ||
import software.amazon.awssdk.services.customerprofiles.model.SourceConnectorProperties; | ||
import software.amazon.awssdk.services.customerprofiles.model.SourceFlowConfig; | ||
import software.amazon.customerprofiles.integration.translators.ConnectorTranslator; | ||
|
||
public class S3Translator implements ConnectorTranslator { | ||
|
||
@Override | ||
public SourceFlowConfig toServiceSourceFlowConfig(software.amazon.customerprofiles.integration.SourceFlowConfig model) { | ||
return SourceFlowConfig.builder() | ||
.connectorProfileName(StringUtils.isNullOrEmpty(model.getConnectorProfileName()) ? null : | ||
model.getConnectorProfileName()) | ||
.connectorType(model.getConnectorType()) | ||
.sourceConnectorProperties( | ||
SourceConnectorProperties.builder() | ||
.s3(toServiceS3SourceProperties(model | ||
.getSourceConnectorProperties() | ||
.getS3())) | ||
.build() | ||
) | ||
.build(); | ||
} | ||
|
||
private S3SourceProperties toServiceS3SourceProperties(software.amazon.customerprofiles.integration.S3SourceProperties model) { | ||
return S3SourceProperties.builder() | ||
.bucketPrefix(model.getBucketPrefix()) | ||
.bucketName(model.getBucketName()) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ConnectorOperator toServiceConnectorOperator(software.amazon.customerprofiles.integration.ConnectorOperator model) { | ||
if (model == null) { | ||
return null; | ||
} | ||
return ConnectorOperator.builder() | ||
.s3(model.getS3()) | ||
.build(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...n/java/software/amazon/customerprofiles/integration/translators/SalesforceTranslator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package software.amazon.customerprofiles.integration.translators; | ||
|
||
import com.amazonaws.util.StringUtils; | ||
import software.amazon.awssdk.services.customerprofiles.model.ConnectorOperator; | ||
import software.amazon.awssdk.services.customerprofiles.model.IncrementalPullConfig; | ||
import software.amazon.awssdk.services.customerprofiles.model.SalesforceSourceProperties; | ||
import software.amazon.awssdk.services.customerprofiles.model.SourceConnectorProperties; | ||
import software.amazon.awssdk.services.customerprofiles.model.SourceFlowConfig; | ||
import software.amazon.customerprofiles.integration.translators.ConnectorTranslator; | ||
|
||
public class SalesforceTranslator implements ConnectorTranslator { | ||
|
||
@Override | ||
public SourceFlowConfig toServiceSourceFlowConfig(software.amazon.customerprofiles.integration.SourceFlowConfig model) { | ||
return SourceFlowConfig.builder() | ||
.connectorProfileName(StringUtils.isNullOrEmpty(model.getConnectorProfileName()) ? null : | ||
model.getConnectorProfileName()) | ||
.connectorType(model.getConnectorType()) | ||
.incrementalPullConfig(model.getIncrementalPullConfig() == null ? null : IncrementalPullConfig.builder() | ||
.datetimeTypeFieldName(model.getIncrementalPullConfig().getDatetimeTypeFieldName()) | ||
.build()) | ||
.sourceConnectorProperties( | ||
SourceConnectorProperties.builder() | ||
.salesforce(toServiceSourceProperties(model | ||
.getSourceConnectorProperties() | ||
.getSalesforce())) | ||
.build() | ||
) | ||
.build(); | ||
} | ||
|
||
private SalesforceSourceProperties toServiceSourceProperties(software.amazon.customerprofiles.integration.SalesforceSourceProperties model) { | ||
return SalesforceSourceProperties.builder() | ||
.enableDynamicFieldUpdate(model.getEnableDynamicFieldUpdate()) | ||
.includeDeletedRecords(model.getIncludeDeletedRecords()) | ||
.object(model.getObject()) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ConnectorOperator toServiceConnectorOperator(software.amazon.customerprofiles.integration.ConnectorOperator model) { | ||
if (model == null) { | ||
return null; | ||
} | ||
return ConnectorOperator.builder() | ||
.salesforce(model.getSalesforce()) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.