From a8b25af65aafbf26a0edb1edd7f6882434159d5e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 12 Apr 2022 05:05:40 +0000 Subject: [PATCH] CodeGen from PR 18514 in Azure/azure-rest-api-specs [Azure Data Factory] Support rest-based connectors in ADF (#18514) * Updating Dataworld in custom words file * Updating Linkedservice details with Dataworld information * Update LinkedService.json * Asana Swagger changes * swagger changes for appfigures * Update LinkedService.json * Twilio linked service changes for datafactory * Synapse linked service changes for Twilio * Twilio custom-words.txt change * Resolving conflicts * removed extra comma Co-authored-by: Aravind Reddy Co-authored-by: Priyadarshi Ghosh Co-authored-by: mshrivastavamsft <103027908+mshrivastavamsft@users.noreply.github.com> --- .../CHANGELOG.md | 4 +- .../README.md | 2 +- .../datafactory/DataFactoryManager.java | 38 ++++- ...AppFiguresLinkedServiceTypeProperties.java | 124 ++++++++++++++ .../AsanaLinkedServiceTypeProperties.java | 88 ++++++++++ .../DataworldLinkedServiceTypeProperties.java | 88 ++++++++++ ...StoredProcedureActivityTypeProperties.java | 20 +-- .../TwilioLinkedServiceTypeProperties.java | 90 +++++++++++ .../DataFactoryManagementClientBuilder.java | 37 +++-- .../models/AppFiguresLinkedService.java | 152 ++++++++++++++++++ .../models/AsanaLinkedService.java | 131 +++++++++++++++ .../models/CredentialReference.java | 16 +- .../models/CredentialReferenceType.java | 31 ++++ .../datafactory/models/DataFlowReference.java | 16 +- .../models/DataFlowReferenceType.java | 31 ++++ .../models/DataworldLinkedService.java | 131 +++++++++++++++ .../models/ExecutePipelineActivity.java | 29 ++++ .../models/ExecutePipelineActivityPolicy.java | 88 ++++++++++ .../datafactory/models/LinkedService.java | 4 + .../ManagedVirtualNetworkReference.java | 17 +- .../ManagedVirtualNetworkReferenceType.java | 32 ++++ .../SqlServerStoredProcedureActivity.java | 6 +- .../datafactory/models/TriggerReference.java | 16 +- .../models/TriggerReferenceType.java | 31 ++++ .../models/TwilioLinkedService.java | 129 +++++++++++++++ 25 files changed, 1275 insertions(+), 76 deletions(-) create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AppFiguresLinkedServiceTypeProperties.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AsanaLinkedServiceTypeProperties.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/DataworldLinkedServiceTypeProperties.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/TwilioLinkedServiceTypeProperties.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AppFiguresLinkedService.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AsanaLinkedService.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReferenceType.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReferenceType.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataworldLinkedService.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivityPolicy.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReferenceType.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReferenceType.java create mode 100644 sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TwilioLinkedService.java diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md b/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md index bfbffeab35455..6ab783d61530b 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md +++ b/sdk/datafactory/azure-resourcemanager-datafactory/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.14 (Unreleased) +## 1.0.0-beta.1 (2022-04-12) + +- Azure Resource Manager DataFactory client library for Java. This package contains Microsoft Azure SDK for DataFactory Management SDK. The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services. Package tag package-2018-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/README.md b/sdk/datafactory/azure-resourcemanager-datafactory/README.md index 69baac9f46f11..eb89c0700dcb0 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/README.md +++ b/sdk/datafactory/azure-resourcemanager-datafactory/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-datafactory - 1.0.0-beta.13 + 1.0.0-beta.14 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java index 4c27c599b25f2..8289aab4b991b 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/DataFactoryManager.java @@ -10,11 +10,13 @@ import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -142,6 +144,19 @@ public static DataFactoryManager authenticate(TokenCredential credential, AzureP return configure().authenticate(credential, profile); } + /** + * Creates an instance of DataFactory service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the DataFactory service API instance. + */ + public static DataFactoryManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DataFactoryManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create DataFactoryManager with optional configuration. * @@ -160,6 +175,7 @@ public static final class Configurable { private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -220,6 +236,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -253,7 +282,7 @@ public DataFactoryManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.datafactory") .append("/") - .append("1.0.0-beta.13"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -271,10 +300,15 @@ public DataFactoryManager authenticate(TokenCredential credential, AzureProfile scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); policies .addAll( diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AppFiguresLinkedServiceTypeProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AppFiguresLinkedServiceTypeProperties.java new file mode 100644 index 0000000000000..e5dce52968765 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AppFiguresLinkedServiceTypeProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.models.SecretBase; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** AppFigures linked service type properties. */ +@Fluent +public final class AppFiguresLinkedServiceTypeProperties { + /* + * The username of the Appfigures source. + */ + @JsonProperty(value = "userName", required = true) + private Object username; + + /* + * The password of the AppFigures source. + */ + @JsonProperty(value = "password", required = true) + private SecretBase password; + + /* + * The client key for the AppFigures source. + */ + @JsonProperty(value = "clientKey", required = true) + private SecretBase clientKey; + + /** + * Get the username property: The username of the Appfigures source. + * + * @return the username value. + */ + public Object username() { + return this.username; + } + + /** + * Set the username property: The username of the Appfigures source. + * + * @param username the username value to set. + * @return the AppFiguresLinkedServiceTypeProperties object itself. + */ + public AppFiguresLinkedServiceTypeProperties withUsername(Object username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the AppFigures source. + * + * @return the password value. + */ + public SecretBase password() { + return this.password; + } + + /** + * Set the password property: The password of the AppFigures source. + * + * @param password the password value to set. + * @return the AppFiguresLinkedServiceTypeProperties object itself. + */ + public AppFiguresLinkedServiceTypeProperties withPassword(SecretBase password) { + this.password = password; + return this; + } + + /** + * Get the clientKey property: The client key for the AppFigures source. + * + * @return the clientKey value. + */ + public SecretBase clientKey() { + return this.clientKey; + } + + /** + * Set the clientKey property: The client key for the AppFigures source. + * + * @param clientKey the clientKey value to set. + * @return the AppFiguresLinkedServiceTypeProperties object itself. + */ + public AppFiguresLinkedServiceTypeProperties withClientKey(SecretBase clientKey) { + this.clientKey = clientKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username in model AppFiguresLinkedServiceTypeProperties")); + } + if (password() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model AppFiguresLinkedServiceTypeProperties")); + } else { + password().validate(); + } + if (clientKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientKey in model AppFiguresLinkedServiceTypeProperties")); + } else { + clientKey().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AppFiguresLinkedServiceTypeProperties.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AsanaLinkedServiceTypeProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AsanaLinkedServiceTypeProperties.java new file mode 100644 index 0000000000000..b3d725c0a80fd --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AsanaLinkedServiceTypeProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.models.SecretBase; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Asana linked service type properties. */ +@Fluent +public final class AsanaLinkedServiceTypeProperties { + /* + * The api token for the Asana source. + */ + @JsonProperty(value = "apiToken", required = true) + private SecretBase apiToken; + + /* + * The encrypted credential used for authentication. Credentials are + * encrypted using the integration runtime credential manager. Type: string + * (or Expression with resultType string). + */ + @JsonProperty(value = "encryptedCredential") + private Object encryptedCredential; + + /** + * Get the apiToken property: The api token for the Asana source. + * + * @return the apiToken value. + */ + public SecretBase apiToken() { + return this.apiToken; + } + + /** + * Set the apiToken property: The api token for the Asana source. + * + * @param apiToken the apiToken value to set. + * @return the AsanaLinkedServiceTypeProperties object itself. + */ + public AsanaLinkedServiceTypeProperties withApiToken(SecretBase apiToken) { + this.apiToken = apiToken; + return this; + } + + /** + * Get the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @return the encryptedCredential value. + */ + public Object encryptedCredential() { + return this.encryptedCredential; + } + + /** + * Set the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @param encryptedCredential the encryptedCredential value to set. + * @return the AsanaLinkedServiceTypeProperties object itself. + */ + public AsanaLinkedServiceTypeProperties withEncryptedCredential(Object encryptedCredential) { + this.encryptedCredential = encryptedCredential; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (apiToken() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property apiToken in model AsanaLinkedServiceTypeProperties")); + } else { + apiToken().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AsanaLinkedServiceTypeProperties.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/DataworldLinkedServiceTypeProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/DataworldLinkedServiceTypeProperties.java new file mode 100644 index 0000000000000..1757a2b81f1c8 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/DataworldLinkedServiceTypeProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.models.SecretBase; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dataworld linked service type properties. */ +@Fluent +public final class DataworldLinkedServiceTypeProperties { + /* + * The api token for the Dataworld source. + */ + @JsonProperty(value = "apiToken", required = true) + private SecretBase apiToken; + + /* + * The encrypted credential used for authentication. Credentials are + * encrypted using the integration runtime credential manager. Type: string + * (or Expression with resultType string). + */ + @JsonProperty(value = "encryptedCredential") + private Object encryptedCredential; + + /** + * Get the apiToken property: The api token for the Dataworld source. + * + * @return the apiToken value. + */ + public SecretBase apiToken() { + return this.apiToken; + } + + /** + * Set the apiToken property: The api token for the Dataworld source. + * + * @param apiToken the apiToken value to set. + * @return the DataworldLinkedServiceTypeProperties object itself. + */ + public DataworldLinkedServiceTypeProperties withApiToken(SecretBase apiToken) { + this.apiToken = apiToken; + return this; + } + + /** + * Get the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @return the encryptedCredential value. + */ + public Object encryptedCredential() { + return this.encryptedCredential; + } + + /** + * Set the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @param encryptedCredential the encryptedCredential value to set. + * @return the DataworldLinkedServiceTypeProperties object itself. + */ + public DataworldLinkedServiceTypeProperties withEncryptedCredential(Object encryptedCredential) { + this.encryptedCredential = encryptedCredential; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (apiToken() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property apiToken in model DataworldLinkedServiceTypeProperties")); + } else { + apiToken().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataworldLinkedServiceTypeProperties.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/SqlServerStoredProcedureActivityTypeProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/SqlServerStoredProcedureActivityTypeProperties.java index 0cd0411a7bb08..6ed00df99fcdf 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/SqlServerStoredProcedureActivityTypeProperties.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/SqlServerStoredProcedureActivityTypeProperties.java @@ -6,10 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.datafactory.models.StoredProcedureParameter; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; /** SQL stored procedure activity properties. */ @Fluent @@ -26,8 +23,7 @@ public final class SqlServerStoredProcedureActivityTypeProperties { * "{Parameter1: {value: "1", type: "int"}}". */ @JsonProperty(value = "storedProcedureParameters") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map storedProcedureParameters; + private Object storedProcedureParameters; /** * Get the storedProcedureName property: Stored procedure name. Type: string (or Expression with resultType string). @@ -55,7 +51,7 @@ public SqlServerStoredProcedureActivityTypeProperties withStoredProcedureName(Ob * * @return the storedProcedureParameters value. */ - public Map storedProcedureParameters() { + public Object storedProcedureParameters() { return this.storedProcedureParameters; } @@ -67,7 +63,7 @@ public Map storedProcedureParameters() { * @return the SqlServerStoredProcedureActivityTypeProperties object itself. */ public SqlServerStoredProcedureActivityTypeProperties withStoredProcedureParameters( - Map storedProcedureParameters) { + Object storedProcedureParameters) { this.storedProcedureParameters = storedProcedureParameters; return this; } @@ -85,16 +81,6 @@ public void validate() { "Missing required property storedProcedureName in model" + " SqlServerStoredProcedureActivityTypeProperties")); } - if (storedProcedureParameters() != null) { - storedProcedureParameters() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } } private static final ClientLogger LOGGER = new ClientLogger(SqlServerStoredProcedureActivityTypeProperties.class); diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/TwilioLinkedServiceTypeProperties.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/TwilioLinkedServiceTypeProperties.java new file mode 100644 index 0000000000000..f63756e6e1f54 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/TwilioLinkedServiceTypeProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.models.SecretBase; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Twilio linked service type properties. */ +@Fluent +public final class TwilioLinkedServiceTypeProperties { + /* + * The Account SID of Twilio service. + */ + @JsonProperty(value = "userName", required = true) + private Object username; + + /* + * The auth token of Twilio service. + */ + @JsonProperty(value = "password", required = true) + private SecretBase password; + + /** + * Get the username property: The Account SID of Twilio service. + * + * @return the username value. + */ + public Object username() { + return this.username; + } + + /** + * Set the username property: The Account SID of Twilio service. + * + * @param username the username value to set. + * @return the TwilioLinkedServiceTypeProperties object itself. + */ + public TwilioLinkedServiceTypeProperties withUsername(Object username) { + this.username = username; + return this; + } + + /** + * Get the password property: The auth token of Twilio service. + * + * @return the password value. + */ + public SecretBase password() { + return this.password; + } + + /** + * Set the password property: The auth token of Twilio service. + * + * @param password the password value to set. + * @return the TwilioLinkedServiceTypeProperties object itself. + */ + public TwilioLinkedServiceTypeProperties withPassword(SecretBase password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username in model TwilioLinkedServiceTypeProperties")); + } + if (password() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model TwilioLinkedServiceTypeProperties")); + } else { + password().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TwilioLinkedServiceTypeProperties.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientBuilder.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientBuilder.java index 0415073729e87..fd2e7dbf0b38b 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientBuilder.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/DataFactoryManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public DataFactoryManagementClientBuilder environment(AzureEnvironment environme } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the DataFactoryManagementClientBuilder. */ - public DataFactoryManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public DataFactoryManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the DataFactoryManagementClientBuilder. */ - public DataFactoryManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public DataFactoryManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,21 +119,21 @@ public DataFactoryManagementClientBuilder serializerAdapter(SerializerAdapter se * @return an instance of DataFactoryManagementClientImpl. */ public DataFactoryManagementClientImpl buildClient() { + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (endpoint == null) { this.endpoint = "https://management.azure.com"; } if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AppFiguresLinkedService.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AppFiguresLinkedService.java new file mode 100644 index 0000000000000..54ef8b8486083 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AppFiguresLinkedService.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.fluent.models.AppFiguresLinkedServiceTypeProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Linked service for AppFigures. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("AppFigures") +@Fluent +public final class AppFiguresLinkedService extends LinkedService { + /* + * AppFigures linked service properties. + */ + @JsonProperty(value = "typeProperties", required = true) + private AppFiguresLinkedServiceTypeProperties innerTypeProperties = new AppFiguresLinkedServiceTypeProperties(); + + /** + * Get the innerTypeProperties property: AppFigures linked service properties. + * + * @return the innerTypeProperties value. + */ + private AppFiguresLinkedServiceTypeProperties innerTypeProperties() { + return this.innerTypeProperties; + } + + /** {@inheritDoc} */ + @Override + public AppFiguresLinkedService withConnectVia(IntegrationRuntimeReference connectVia) { + super.withConnectVia(connectVia); + return this; + } + + /** {@inheritDoc} */ + @Override + public AppFiguresLinkedService withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public AppFiguresLinkedService withParameters(Map parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public AppFiguresLinkedService withAnnotations(List annotations) { + super.withAnnotations(annotations); + return this; + } + + /** + * Get the username property: The username of the Appfigures source. + * + * @return the username value. + */ + public Object username() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().username(); + } + + /** + * Set the username property: The username of the Appfigures source. + * + * @param username the username value to set. + * @return the AppFiguresLinkedService object itself. + */ + public AppFiguresLinkedService withUsername(Object username) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new AppFiguresLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withUsername(username); + return this; + } + + /** + * Get the password property: The password of the AppFigures source. + * + * @return the password value. + */ + public SecretBase password() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().password(); + } + + /** + * Set the password property: The password of the AppFigures source. + * + * @param password the password value to set. + * @return the AppFiguresLinkedService object itself. + */ + public AppFiguresLinkedService withPassword(SecretBase password) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new AppFiguresLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withPassword(password); + return this; + } + + /** + * Get the clientKey property: The client key for the AppFigures source. + * + * @return the clientKey value. + */ + public SecretBase clientKey() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().clientKey(); + } + + /** + * Set the clientKey property: The client key for the AppFigures source. + * + * @param clientKey the clientKey value to set. + * @return the AppFiguresLinkedService object itself. + */ + public AppFiguresLinkedService withClientKey(SecretBase clientKey) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new AppFiguresLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withClientKey(clientKey); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerTypeProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerTypeProperties in model AppFiguresLinkedService")); + } else { + innerTypeProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AppFiguresLinkedService.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AsanaLinkedService.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AsanaLinkedService.java new file mode 100644 index 0000000000000..0bc19583ad9e3 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AsanaLinkedService.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.fluent.models.AsanaLinkedServiceTypeProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Linked service for Asana. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Asana") +@Fluent +public final class AsanaLinkedService extends LinkedService { + /* + * Asana linked service properties. + */ + @JsonProperty(value = "typeProperties", required = true) + private AsanaLinkedServiceTypeProperties innerTypeProperties = new AsanaLinkedServiceTypeProperties(); + + /** + * Get the innerTypeProperties property: Asana linked service properties. + * + * @return the innerTypeProperties value. + */ + private AsanaLinkedServiceTypeProperties innerTypeProperties() { + return this.innerTypeProperties; + } + + /** {@inheritDoc} */ + @Override + public AsanaLinkedService withConnectVia(IntegrationRuntimeReference connectVia) { + super.withConnectVia(connectVia); + return this; + } + + /** {@inheritDoc} */ + @Override + public AsanaLinkedService withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public AsanaLinkedService withParameters(Map parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public AsanaLinkedService withAnnotations(List annotations) { + super.withAnnotations(annotations); + return this; + } + + /** + * Get the apiToken property: The api token for the Asana source. + * + * @return the apiToken value. + */ + public SecretBase apiToken() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().apiToken(); + } + + /** + * Set the apiToken property: The api token for the Asana source. + * + * @param apiToken the apiToken value to set. + * @return the AsanaLinkedService object itself. + */ + public AsanaLinkedService withApiToken(SecretBase apiToken) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new AsanaLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withApiToken(apiToken); + return this; + } + + /** + * Get the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @return the encryptedCredential value. + */ + public Object encryptedCredential() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().encryptedCredential(); + } + + /** + * Set the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @param encryptedCredential the encryptedCredential value to set. + * @return the AsanaLinkedService object itself. + */ + public AsanaLinkedService withEncryptedCredential(Object encryptedCredential) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new AsanaLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withEncryptedCredential(encryptedCredential); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerTypeProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerTypeProperties in model AsanaLinkedService")); + } else { + innerTypeProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AsanaLinkedService.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReference.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReference.java index 16440b82de58b..44bc17d0ee983 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReference.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReference.java @@ -20,7 +20,7 @@ public final class CredentialReference { * Credential reference type. */ @JsonProperty(value = "type", required = true) - private String type = "CredentialReference"; + private CredentialReferenceType type; /* * Reference credential name. @@ -33,17 +33,12 @@ public final class CredentialReference { */ @JsonIgnore private Map additionalProperties; - /** Creates an instance of CredentialReference class. */ - public CredentialReference() { - type = "CredentialReference"; - } - /** * Get the type property: Credential reference type. * * @return the type value. */ - public String type() { + public CredentialReferenceType type() { return this.type; } @@ -53,7 +48,7 @@ public String type() { * @param type the type value to set. * @return the CredentialReference object itself. */ - public CredentialReference withType(String type) { + public CredentialReference withType(CredentialReferenceType type) { this.type = type; return this; } @@ -113,6 +108,11 @@ void withAdditionalProperties(String key, Object value) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model CredentialReference")); + } if (referenceName() == null) { throw LOGGER .logExceptionAsError( diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReferenceType.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReferenceType.java new file mode 100644 index 0000000000000..b329c12e05563 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/CredentialReferenceType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CredentialReferenceType. */ +public final class CredentialReferenceType extends ExpandableStringEnum { + /** Static value CredentialReference for CredentialReferenceType. */ + public static final CredentialReferenceType CREDENTIAL_REFERENCE = fromString("CredentialReference"); + + /** + * Creates or finds a CredentialReferenceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CredentialReferenceType. + */ + @JsonCreator + public static CredentialReferenceType fromString(String name) { + return fromString(name, CredentialReferenceType.class); + } + + /** @return known CredentialReferenceType values. */ + public static Collection values() { + return values(CredentialReferenceType.class); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReference.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReference.java index e803d37c60fe3..4d1fb2f42a45e 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReference.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReference.java @@ -21,7 +21,7 @@ public final class DataFlowReference { * Data flow reference type. */ @JsonProperty(value = "type", required = true) - private String type = "DataFlowReference"; + private DataFlowReferenceType type; /* * Reference data flow name. @@ -47,17 +47,12 @@ public final class DataFlowReference { */ @JsonIgnore private Map additionalProperties; - /** Creates an instance of DataFlowReference class. */ - public DataFlowReference() { - type = "DataFlowReference"; - } - /** * Get the type property: Data flow reference type. * * @return the type value. */ - public String type() { + public DataFlowReferenceType type() { return this.type; } @@ -67,7 +62,7 @@ public String type() { * @param type the type value to set. * @return the DataFlowReference object itself. */ - public DataFlowReference withType(String type) { + public DataFlowReference withType(DataFlowReferenceType type) { this.type = type; return this; } @@ -167,6 +162,11 @@ void withAdditionalProperties(String key, Object value) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model DataFlowReference")); + } if (referenceName() == null) { throw LOGGER .logExceptionAsError( diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReferenceType.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReferenceType.java new file mode 100644 index 0000000000000..28d22b0543342 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataFlowReferenceType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataFlowReferenceType. */ +public final class DataFlowReferenceType extends ExpandableStringEnum { + /** Static value DataFlowReference for DataFlowReferenceType. */ + public static final DataFlowReferenceType DATA_FLOW_REFERENCE = fromString("DataFlowReference"); + + /** + * Creates or finds a DataFlowReferenceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataFlowReferenceType. + */ + @JsonCreator + public static DataFlowReferenceType fromString(String name) { + return fromString(name, DataFlowReferenceType.class); + } + + /** @return known DataFlowReferenceType values. */ + public static Collection values() { + return values(DataFlowReferenceType.class); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataworldLinkedService.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataworldLinkedService.java new file mode 100644 index 0000000000000..93375ffb2b7f2 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataworldLinkedService.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.fluent.models.DataworldLinkedServiceTypeProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Linked service for Dataworld. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Dataworld") +@Fluent +public final class DataworldLinkedService extends LinkedService { + /* + * Dataworld linked service properties. + */ + @JsonProperty(value = "typeProperties", required = true) + private DataworldLinkedServiceTypeProperties innerTypeProperties = new DataworldLinkedServiceTypeProperties(); + + /** + * Get the innerTypeProperties property: Dataworld linked service properties. + * + * @return the innerTypeProperties value. + */ + private DataworldLinkedServiceTypeProperties innerTypeProperties() { + return this.innerTypeProperties; + } + + /** {@inheritDoc} */ + @Override + public DataworldLinkedService withConnectVia(IntegrationRuntimeReference connectVia) { + super.withConnectVia(connectVia); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataworldLinkedService withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataworldLinkedService withParameters(Map parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataworldLinkedService withAnnotations(List annotations) { + super.withAnnotations(annotations); + return this; + } + + /** + * Get the apiToken property: The api token for the Dataworld source. + * + * @return the apiToken value. + */ + public SecretBase apiToken() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().apiToken(); + } + + /** + * Set the apiToken property: The api token for the Dataworld source. + * + * @param apiToken the apiToken value to set. + * @return the DataworldLinkedService object itself. + */ + public DataworldLinkedService withApiToken(SecretBase apiToken) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new DataworldLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withApiToken(apiToken); + return this; + } + + /** + * Get the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @return the encryptedCredential value. + */ + public Object encryptedCredential() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().encryptedCredential(); + } + + /** + * Set the encryptedCredential property: The encrypted credential used for authentication. Credentials are encrypted + * using the integration runtime credential manager. Type: string (or Expression with resultType string). + * + * @param encryptedCredential the encryptedCredential value to set. + * @return the DataworldLinkedService object itself. + */ + public DataworldLinkedService withEncryptedCredential(Object encryptedCredential) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new DataworldLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withEncryptedCredential(encryptedCredential); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerTypeProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerTypeProperties in model DataworldLinkedService")); + } else { + innerTypeProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataworldLinkedService.class); +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivity.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivity.java index 043299d2f827e..0e9d49a92003f 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivity.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivity.java @@ -18,12 +18,38 @@ @JsonTypeName("ExecutePipeline") @Fluent public final class ExecutePipelineActivity extends ControlActivity { + /* + * Execute pipeline activity policy. + */ + @JsonProperty(value = "policy") + private ExecutePipelineActivityPolicy policy; + /* * Execute pipeline activity properties. */ @JsonProperty(value = "typeProperties", required = true) private ExecutePipelineActivityTypeProperties innerTypeProperties = new ExecutePipelineActivityTypeProperties(); + /** + * Get the policy property: Execute pipeline activity policy. + * + * @return the policy value. + */ + public ExecutePipelineActivityPolicy policy() { + return this.policy; + } + + /** + * Set the policy property: Execute pipeline activity policy. + * + * @param policy the policy value to set. + * @return the ExecutePipelineActivity object itself. + */ + public ExecutePipelineActivity withPolicy(ExecutePipelineActivityPolicy policy) { + this.policy = policy; + return this; + } + /** * Get the innerTypeProperties property: Execute pipeline activity properties. * @@ -140,6 +166,9 @@ public ExecutePipelineActivity withWaitOnCompletion(Boolean waitOnCompletion) { @Override public void validate() { super.validate(); + if (policy() != null) { + policy().validate(); + } if (innerTypeProperties() == null) { throw LOGGER .logExceptionAsError( diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivityPolicy.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivityPolicy.java new file mode 100644 index 0000000000000..da0c7f66865a0 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ExecutePipelineActivityPolicy.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** Execution policy for an execute pipeline activity. */ +@Fluent +public final class ExecutePipelineActivityPolicy { + /* + * When set to true, Input from activity is considered as secure and will + * not be logged to monitoring. + */ + @JsonProperty(value = "secureInput") + private Boolean secureInput; + + /* + * Execution policy for an execute pipeline activity. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the secureInput property: When set to true, Input from activity is considered as secure and will not be + * logged to monitoring. + * + * @return the secureInput value. + */ + public Boolean secureInput() { + return this.secureInput; + } + + /** + * Set the secureInput property: When set to true, Input from activity is considered as secure and will not be + * logged to monitoring. + * + * @param secureInput the secureInput value to set. + * @return the ExecutePipelineActivityPolicy object itself. + */ + public ExecutePipelineActivityPolicy withSecureInput(Boolean secureInput) { + this.secureInput = secureInput; + return this; + } + + /** + * Get the additionalProperties property: Execution policy for an execute pipeline activity. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Execution policy for an execute pipeline activity. + * + * @param additionalProperties the additionalProperties value to set. + * @return the ExecutePipelineActivityPolicy object itself. + */ + public ExecutePipelineActivityPolicy withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedService.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedService.java index 60b3003eb39b3..20bd6e9752cb4 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedService.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/LinkedService.java @@ -83,6 +83,10 @@ @JsonSubTypes.Type(name = "Quickbase", value = QuickbaseLinkedService.class), @JsonSubTypes.Type(name = "Smartsheet", value = SmartsheetLinkedService.class), @JsonSubTypes.Type(name = "Zendesk", value = ZendeskLinkedService.class), + @JsonSubTypes.Type(name = "Dataworld", value = DataworldLinkedService.class), + @JsonSubTypes.Type(name = "AppFigures", value = AppFiguresLinkedService.class), + @JsonSubTypes.Type(name = "Asana", value = AsanaLinkedService.class), + @JsonSubTypes.Type(name = "Twilio", value = TwilioLinkedService.class), @JsonSubTypes.Type(name = "AmazonRedshift", value = AmazonRedshiftLinkedService.class), @JsonSubTypes.Type(name = "CustomDataSource", value = CustomDataSourceLinkedService.class), @JsonSubTypes.Type(name = "AzureSearch", value = AzureSearchLinkedService.class), diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReference.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReference.java index bb87296ea3216..4e406f422f55f 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReference.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReference.java @@ -15,7 +15,7 @@ public final class ManagedVirtualNetworkReference { * Managed Virtual Network reference type. */ @JsonProperty(value = "type", required = true) - private String type = "ManagedVirtualNetworkReference"; + private ManagedVirtualNetworkReferenceType type; /* * Reference ManagedVirtualNetwork name. @@ -23,17 +23,12 @@ public final class ManagedVirtualNetworkReference { @JsonProperty(value = "referenceName", required = true) private String referenceName; - /** Creates an instance of ManagedVirtualNetworkReference class. */ - public ManagedVirtualNetworkReference() { - type = "ManagedVirtualNetworkReference"; - } - /** * Get the type property: Managed Virtual Network reference type. * * @return the type value. */ - public String type() { + public ManagedVirtualNetworkReferenceType type() { return this.type; } @@ -43,7 +38,7 @@ public String type() { * @param type the type value to set. * @return the ManagedVirtualNetworkReference object itself. */ - public ManagedVirtualNetworkReference withType(String type) { + public ManagedVirtualNetworkReference withType(ManagedVirtualNetworkReferenceType type) { this.type = type; return this; } @@ -74,6 +69,12 @@ public ManagedVirtualNetworkReference withReferenceName(String referenceName) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model ManagedVirtualNetworkReference")); + } if (referenceName() == null) { throw LOGGER .logExceptionAsError( diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReferenceType.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReferenceType.java new file mode 100644 index 0000000000000..479f42a4e561d --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/ManagedVirtualNetworkReferenceType.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedVirtualNetworkReferenceType. */ +public final class ManagedVirtualNetworkReferenceType extends ExpandableStringEnum { + /** Static value ManagedVirtualNetworkReference for ManagedVirtualNetworkReferenceType. */ + public static final ManagedVirtualNetworkReferenceType MANAGED_VIRTUAL_NETWORK_REFERENCE = + fromString("ManagedVirtualNetworkReference"); + + /** + * Creates or finds a ManagedVirtualNetworkReferenceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedVirtualNetworkReferenceType. + */ + @JsonCreator + public static ManagedVirtualNetworkReferenceType fromString(String name) { + return fromString(name, ManagedVirtualNetworkReferenceType.class); + } + + /** @return known ManagedVirtualNetworkReferenceType values. */ + public static Collection values() { + return values(ManagedVirtualNetworkReferenceType.class); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/SqlServerStoredProcedureActivity.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/SqlServerStoredProcedureActivity.java index f7918ad4933d1..9aae0158feb74 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/SqlServerStoredProcedureActivity.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/SqlServerStoredProcedureActivity.java @@ -11,7 +11,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -import java.util.Map; /** SQL stored procedure activity type. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @@ -105,7 +104,7 @@ public SqlServerStoredProcedureActivity withStoredProcedureName(Object storedPro * * @return the storedProcedureParameters value. */ - public Map storedProcedureParameters() { + public Object storedProcedureParameters() { return this.innerTypeProperties() == null ? null : this.innerTypeProperties().storedProcedureParameters(); } @@ -116,8 +115,7 @@ public Map storedProcedureParameters() { * @param storedProcedureParameters the storedProcedureParameters value to set. * @return the SqlServerStoredProcedureActivity object itself. */ - public SqlServerStoredProcedureActivity withStoredProcedureParameters( - Map storedProcedureParameters) { + public SqlServerStoredProcedureActivity withStoredProcedureParameters(Object storedProcedureParameters) { if (this.innerTypeProperties() == null) { this.innerTypeProperties = new SqlServerStoredProcedureActivityTypeProperties(); } diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReference.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReference.java index 2ca970e9833e6..a5485d2eccef3 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReference.java +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReference.java @@ -15,7 +15,7 @@ public final class TriggerReference { * Trigger reference type. */ @JsonProperty(value = "type", required = true) - private String type = "TriggerReference"; + private TriggerReferenceType type; /* * Reference trigger name. @@ -23,17 +23,12 @@ public final class TriggerReference { @JsonProperty(value = "referenceName", required = true) private String referenceName; - /** Creates an instance of TriggerReference class. */ - public TriggerReference() { - type = "TriggerReference"; - } - /** * Get the type property: Trigger reference type. * * @return the type value. */ - public String type() { + public TriggerReferenceType type() { return this.type; } @@ -43,7 +38,7 @@ public String type() { * @param type the type value to set. * @return the TriggerReference object itself. */ - public TriggerReference withType(String type) { + public TriggerReference withType(TriggerReferenceType type) { this.type = type; return this; } @@ -74,6 +69,11 @@ public TriggerReference withReferenceName(String referenceName) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model TriggerReference")); + } if (referenceName() == null) { throw LOGGER .logExceptionAsError( diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReferenceType.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReferenceType.java new file mode 100644 index 0000000000000..36bdde3b9968d --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TriggerReferenceType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TriggerReferenceType. */ +public final class TriggerReferenceType extends ExpandableStringEnum { + /** Static value TriggerReference for TriggerReferenceType. */ + public static final TriggerReferenceType TRIGGER_REFERENCE = fromString("TriggerReference"); + + /** + * Creates or finds a TriggerReferenceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerReferenceType. + */ + @JsonCreator + public static TriggerReferenceType fromString(String name) { + return fromString(name, TriggerReferenceType.class); + } + + /** @return known TriggerReferenceType values. */ + public static Collection values() { + return values(TriggerReferenceType.class); + } +} diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TwilioLinkedService.java b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TwilioLinkedService.java new file mode 100644 index 0000000000000..4ca527cc725b5 --- /dev/null +++ b/sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/TwilioLinkedService.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datafactory.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datafactory.fluent.models.TwilioLinkedServiceTypeProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Linked service for Twilio. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Twilio") +@Fluent +public final class TwilioLinkedService extends LinkedService { + /* + * Twilio linked service properties. + */ + @JsonProperty(value = "typeProperties", required = true) + private TwilioLinkedServiceTypeProperties innerTypeProperties = new TwilioLinkedServiceTypeProperties(); + + /** + * Get the innerTypeProperties property: Twilio linked service properties. + * + * @return the innerTypeProperties value. + */ + private TwilioLinkedServiceTypeProperties innerTypeProperties() { + return this.innerTypeProperties; + } + + /** {@inheritDoc} */ + @Override + public TwilioLinkedService withConnectVia(IntegrationRuntimeReference connectVia) { + super.withConnectVia(connectVia); + return this; + } + + /** {@inheritDoc} */ + @Override + public TwilioLinkedService withDescription(String description) { + super.withDescription(description); + return this; + } + + /** {@inheritDoc} */ + @Override + public TwilioLinkedService withParameters(Map parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public TwilioLinkedService withAnnotations(List annotations) { + super.withAnnotations(annotations); + return this; + } + + /** + * Get the username property: The Account SID of Twilio service. + * + * @return the username value. + */ + public Object username() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().username(); + } + + /** + * Set the username property: The Account SID of Twilio service. + * + * @param username the username value to set. + * @return the TwilioLinkedService object itself. + */ + public TwilioLinkedService withUsername(Object username) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new TwilioLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withUsername(username); + return this; + } + + /** + * Get the password property: The auth token of Twilio service. + * + * @return the password value. + */ + public SecretBase password() { + return this.innerTypeProperties() == null ? null : this.innerTypeProperties().password(); + } + + /** + * Set the password property: The auth token of Twilio service. + * + * @param password the password value to set. + * @return the TwilioLinkedService object itself. + */ + public TwilioLinkedService withPassword(SecretBase password) { + if (this.innerTypeProperties() == null) { + this.innerTypeProperties = new TwilioLinkedServiceTypeProperties(); + } + this.innerTypeProperties().withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerTypeProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerTypeProperties in model TwilioLinkedService")); + } else { + innerTypeProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TwilioLinkedService.class); +}