diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs index bde22556c0bf..a3212c17b95b 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs @@ -140,11 +140,6 @@ public partial class DataFactoryManagementClient : ServiceClient public virtual ITriggerRunsOperations TriggerRuns { get; private set; } - /// - /// Gets the IRerunTriggersOperations. - /// - public virtual IRerunTriggersOperations RerunTriggers { get; private set; } - /// /// Gets the IDataFlowsOperations. /// @@ -409,7 +404,6 @@ private void Initialize() ActivityRuns = new ActivityRunsOperations(this); Triggers = new TriggersOperations(this); TriggerRuns = new TriggerRunsOperations(this); - RerunTriggers = new RerunTriggersOperations(this); DataFlows = new DataFlowsOperations(this); DataFlowDebugSession = new DataFlowDebugSessionOperations(this); BaseUri = new System.Uri("https://management.azure.com"); @@ -461,8 +455,6 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("authenticationType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("authenticationType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); @@ -471,6 +463,8 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs index 1648e0af85c1..6b3e521ca6b1 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs @@ -135,11 +135,6 @@ public partial interface IDataFactoryManagementClient : System.IDisposable /// ITriggerRunsOperations TriggerRuns { get; } - /// - /// Gets the IRerunTriggersOperations. - /// - IRerunTriggersOperations RerunTriggers { get; } - /// /// Gets the IDataFlowsOperations. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IPipelinesOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IPipelinesOperations.cs index 48d598980f38..89211bd513d6 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IPipelinesOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IPipelinesOperations.cs @@ -167,6 +167,11 @@ public partial interface IPipelinesOperations /// In recovery mode, the rerun will start from this activity. If not /// specified, all activities will run. /// + /// + /// In recovery mode, if set to true, the rerun will start from failed + /// activities. The property will be used only if startActivityName is + /// not specified. + /// /// /// Parameters of the pipeline run. These parameters will be used only /// if the runId is not specified. @@ -186,7 +191,7 @@ public partial interface IPipelinesOperations /// /// Thrown when a required parameter is null /// - Task> CreateRunWithHttpMessagesAsync(string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), IDictionary parameters = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateRunWithHttpMessagesAsync(string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), bool? startFromFailure = default(bool?), IDictionary parameters = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists pipelines. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IRerunTriggersOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IRerunTriggersOperations.cs deleted file mode 100644 index 6bdfcfcbae66..000000000000 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IRerunTriggersOperations.cs +++ /dev/null @@ -1,279 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// RerunTriggersOperations operations. - /// - public partial interface IRerunTriggersOperations - { - /// - /// Creates a rerun trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// Rerun tumbling window trigger action parameters. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, RerunTumblingWindowTriggerActionParameters rerunTumblingWindowTriggerActionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Starts a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Stops a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Cancels a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task CancelWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByTriggerWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Starts a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Stops a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Cancels a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByTriggerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs index 62dd32263d05..547a650d4356 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs @@ -49,6 +49,34 @@ public partial interface ITriggersOperations /// Task>> ListByFactoryWithHttpMessagesAsync(string resourceGroupName, string factoryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Query triggers. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Parameters to filter the triggers. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> QueryByFactoryWithHttpMessagesAsync(string resourceGroupName, string factoryName, TriggerFilterParameters filterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates a trigger. /// /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Db2LinkedService.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Db2LinkedService.cs index 382b0cb0468f..a7ee7e576d6b 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Db2LinkedService.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Db2LinkedService.cs @@ -35,10 +35,6 @@ public Db2LinkedService() /// /// Initializes a new instance of the Db2LinkedService class. /// - /// Server name for connection. Type: string (or - /// Expression with resultType string). - /// Database name for connection. Type: string - /// (or Expression with resultType string). /// Unmatched properties from the /// message are deserialized this collection /// The integration runtime reference. @@ -46,24 +42,40 @@ public Db2LinkedService() /// Parameters for linked service. /// List of tags that can be used for /// describing the linked service. + /// The connection string. It is + /// mutually exclusive with server, database, authenticationType, + /// userName, packageCollection and certificateCommonName property. + /// Type: string, SecureString or AzureKeyVaultSecretReference. + /// Server name for connection. It is mutually + /// exclusive with connectionString property. Type: string (or + /// Expression with resultType string). + /// Database name for connection. It is mutually + /// exclusive with connectionString property. Type: string (or + /// Expression with resultType string). /// AuthenticationType to be used for - /// connection. Possible values include: 'Basic' - /// Username for authentication. Type: string - /// (or Expression with resultType string). + /// connection. It is mutually exclusive with connectionString + /// property. Possible values include: 'Basic' + /// Username for authentication. It is mutually + /// exclusive with connectionString property. Type: string (or + /// Expression with resultType string). /// Password for authentication. /// Under where packages are created - /// when querying database. Type: string (or Expression with resultType - /// string). + /// when querying database. It is mutually exclusive with + /// connectionString property. Type: string (or Expression with + /// resultType string). /// Certificate Common Name when - /// TLS is enabled. Type: string (or Expression with resultType + /// TLS is enabled. It is mutually exclusive with connectionString + /// property. Type: string (or Expression with resultType /// string). /// The encrypted credential used for /// authentication. Credentials are encrypted using the integration - /// runtime credential manager. Type: string (or Expression with + /// runtime credential manager. It is mutually exclusive with + /// connectionString property. Type: string (or Expression with /// resultType string). - public Db2LinkedService(object server, object database, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), string authenticationType = default(string), object username = default(object), SecretBase password = default(SecretBase), object packageCollection = default(object), object certificateCommonName = default(object), object encryptedCredential = default(object)) + public Db2LinkedService(IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object connectionString = default(object), object server = default(object), object database = default(object), string authenticationType = default(string), object username = default(object), SecretBase password = default(SecretBase), object packageCollection = default(object), object certificateCommonName = default(object), object encryptedCredential = default(object)) : base(additionalProperties, connectVia, description, parameters, annotations) { + ConnectionString = connectionString; Server = server; Database = database; AuthenticationType = authenticationType; @@ -81,29 +93,42 @@ public Db2LinkedService() partial void CustomInit(); /// - /// Gets or sets server name for connection. Type: string (or - /// Expression with resultType string). + /// Gets or sets the connection string. It is mutually exclusive with + /// server, database, authenticationType, userName, packageCollection + /// and certificateCommonName property. Type: string, SecureString or + /// AzureKeyVaultSecretReference. + /// + [JsonProperty(PropertyName = "typeProperties.connectionString")] + public object ConnectionString { get; set; } + + /// + /// Gets or sets server name for connection. It is mutually exclusive + /// with connectionString property. Type: string (or Expression with + /// resultType string). /// [JsonProperty(PropertyName = "typeProperties.server")] public object Server { get; set; } /// - /// Gets or sets database name for connection. Type: string (or - /// Expression with resultType string). + /// Gets or sets database name for connection. It is mutually exclusive + /// with connectionString property. Type: string (or Expression with + /// resultType string). /// [JsonProperty(PropertyName = "typeProperties.database")] public object Database { get; set; } /// - /// Gets or sets authenticationType to be used for connection. Possible - /// values include: 'Basic' + /// Gets or sets authenticationType to be used for connection. It is + /// mutually exclusive with connectionString property. Possible values + /// include: 'Basic' /// [JsonProperty(PropertyName = "typeProperties.authenticationType")] public string AuthenticationType { get; set; } /// - /// Gets or sets username for authentication. Type: string (or - /// Expression with resultType string). + /// Gets or sets username for authentication. It is mutually exclusive + /// with connectionString property. Type: string (or Expression with + /// resultType string). /// [JsonProperty(PropertyName = "typeProperties.username")] public object Username { get; set; } @@ -116,14 +141,16 @@ public Db2LinkedService() /// /// Gets or sets under where packages are created when querying - /// database. Type: string (or Expression with resultType string). + /// database. It is mutually exclusive with connectionString property. + /// Type: string (or Expression with resultType string). /// [JsonProperty(PropertyName = "typeProperties.packageCollection")] public object PackageCollection { get; set; } /// - /// Gets or sets certificate Common Name when TLS is enabled. Type: - /// string (or Expression with resultType string). + /// Gets or sets certificate Common Name when TLS is enabled. It is + /// mutually exclusive with connectionString property. Type: string (or + /// Expression with resultType string). /// [JsonProperty(PropertyName = "typeProperties.certificateCommonName")] public object CertificateCommonName { get; set; } @@ -131,7 +158,8 @@ public Db2LinkedService() /// /// Gets or sets the encrypted credential used for authentication. /// Credentials are encrypted using the integration runtime credential - /// manager. Type: string (or Expression with resultType string). + /// manager. It is mutually exclusive with connectionString property. + /// Type: string (or Expression with resultType string). /// [JsonProperty(PropertyName = "typeProperties.encryptedCredential")] public object EncryptedCredential { get; set; } @@ -145,14 +173,6 @@ public Db2LinkedService() public override void Validate() { base.Validate(); - if (Server == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Server"); - } - if (Database == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Database"); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTriggerResource.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTriggerResource.cs deleted file mode 100644 index ccf418370773..000000000000 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTriggerResource.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// RerunTrigger resource type. - /// - public partial class RerunTriggerResource : SubResource - { - /// - /// Initializes a new instance of the RerunTriggerResource class. - /// - public RerunTriggerResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RerunTriggerResource class. - /// - /// Properties of the rerun trigger. - /// The resource identifier. - /// The resource name. - /// The resource type. - /// Etag identifies change in the resource. - public RerunTriggerResource(RerunTumblingWindowTrigger properties, string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id, name, type, etag) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets properties of the rerun trigger. - /// - [JsonProperty(PropertyName = "properties")] - public RerunTumblingWindowTrigger Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Properties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); - } - if (Properties != null) - { - Properties.Validate(); - } - } - } -} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTumblingWindowTrigger.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTumblingWindowTrigger.cs index 72ee9d65ff13..c2a69f7c1acb 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTumblingWindowTrigger.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTumblingWindowTrigger.cs @@ -35,13 +35,14 @@ public RerunTumblingWindowTrigger() /// /// Initializes a new instance of the RerunTumblingWindowTrigger class. /// + /// The parent trigger reference. /// The start time for the time period /// for which restatement is initiated. Only UTC time is currently /// supported. /// The end time for the time period for /// which restatement is initiated. Only UTC time is currently /// supported. - /// The max number of parallel time + /// The max number of parallel time /// windows (ready for execution) for which a rerun is /// triggered. /// Unmatched properties from the @@ -52,14 +53,13 @@ public RerunTumblingWindowTrigger() /// values include: 'Started', 'Stopped', 'Disabled' /// List of tags that can be used for /// describing the trigger. - /// The parent trigger reference. - public RerunTumblingWindowTrigger(System.DateTime requestedStartTime, System.DateTime requestedEndTime, int maxConcurrency, IDictionary additionalProperties = default(IDictionary), string description = default(string), string runtimeState = default(string), IList annotations = default(IList), object parentTrigger = default(object)) + public RerunTumblingWindowTrigger(object parentTrigger, System.DateTime requestedStartTime, System.DateTime requestedEndTime, int rerunConcurrency, IDictionary additionalProperties = default(IDictionary), string description = default(string), string runtimeState = default(string), IList annotations = default(IList)) : base(additionalProperties, description, runtimeState, annotations) { ParentTrigger = parentTrigger; RequestedStartTime = requestedStartTime; RequestedEndTime = requestedEndTime; - MaxConcurrency = maxConcurrency; + RerunConcurrency = rerunConcurrency; CustomInit(); } @@ -92,8 +92,8 @@ public RerunTumblingWindowTrigger() /// Gets or sets the max number of parallel time windows (ready for /// execution) for which a rerun is triggered. /// - [JsonProperty(PropertyName = "typeProperties.maxConcurrency")] - public int MaxConcurrency { get; set; } + [JsonProperty(PropertyName = "typeProperties.rerunConcurrency")] + public int RerunConcurrency { get; set; } /// /// Validate the object. @@ -103,13 +103,17 @@ public RerunTumblingWindowTrigger() /// public virtual void Validate() { - if (MaxConcurrency > 50) + if (ParentTrigger == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ParentTrigger"); + } + if (RerunConcurrency > 50) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxConcurrency", 50); + throw new ValidationException(ValidationRules.InclusiveMaximum, "RerunConcurrency", 50); } - if (MaxConcurrency < 1) + if (RerunConcurrency < 1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxConcurrency", 1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "RerunConcurrency", 1); } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTumblingWindowTriggerActionParameters.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTumblingWindowTriggerActionParameters.cs deleted file mode 100644 index 504f977edee2..000000000000 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/RerunTumblingWindowTriggerActionParameters.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Rerun tumbling window trigger Parameters. - /// - public partial class RerunTumblingWindowTriggerActionParameters - { - /// - /// Initializes a new instance of the - /// RerunTumblingWindowTriggerActionParameters class. - /// - public RerunTumblingWindowTriggerActionParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// RerunTumblingWindowTriggerActionParameters class. - /// - /// The start time for the time period for - /// which restatement is initiated. Only UTC time is currently - /// supported. - /// The end time for the time period for which - /// restatement is initiated. Only UTC time is currently - /// supported. - /// The max number of parallel time - /// windows (ready for execution) for which a rerun is - /// triggered. - public RerunTumblingWindowTriggerActionParameters(System.DateTime startTime, System.DateTime endTime, int maxConcurrency) - { - StartTime = startTime; - EndTime = endTime; - MaxConcurrency = maxConcurrency; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the start time for the time period for which - /// restatement is initiated. Only UTC time is currently supported. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime StartTime { get; set; } - - /// - /// Gets or sets the end time for the time period for which restatement - /// is initiated. Only UTC time is currently supported. - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime EndTime { get; set; } - - /// - /// Gets or sets the max number of parallel time windows (ready for - /// execution) for which a rerun is triggered. - /// - [JsonProperty(PropertyName = "maxConcurrency")] - public int MaxConcurrency { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (MaxConcurrency > 50) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxConcurrency", 50); - } - if (MaxConcurrency < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxConcurrency", 1); - } - } - } -} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISPackageLocation.cs similarity index 100% rename from sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs rename to sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISPackageLocation.cs diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SelfDependencyTumblingWindowTriggerReference.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SelfDependencyTumblingWindowTriggerReference.cs index d4fb78fa80b5..71d386c8a657 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SelfDependencyTumblingWindowTriggerReference.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SelfDependencyTumblingWindowTriggerReference.cs @@ -85,9 +85,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.MinLength, "Offset", 8); } - if (!System.Text.RegularExpressions.Regex.IsMatch(Offset, "((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))")) + if (!System.Text.RegularExpressions.Regex.IsMatch(Offset, "-((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))")) { - throw new ValidationException(ValidationRules.Pattern, "Offset", "((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))"); + throw new ValidationException(ValidationRules.Pattern, "Offset", "-((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))"); } } if (Size != null) diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerFilterParameters.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerFilterParameters.cs new file mode 100644 index 000000000000..96cd2858e1cd --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerFilterParameters.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Query parameters for triggers. + /// + public partial class TriggerFilterParameters + { + /// + /// Initializes a new instance of the TriggerFilterParameters class. + /// + public TriggerFilterParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TriggerFilterParameters class. + /// + /// The continuation token for getting + /// the next page of results. Null for first page. + /// The name of the parent + /// TumblingWindowTrigger to get the child rerun triggers + public TriggerFilterParameters(string continuationToken = default(string), string parentTriggerName = default(string)) + { + ContinuationToken = continuationToken; + ParentTriggerName = parentTriggerName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the continuation token for getting the next page of + /// results. Null for first page. + /// + [JsonProperty(PropertyName = "continuationToken")] + public string ContinuationToken { get; set; } + + /// + /// Gets or sets the name of the parent TumblingWindowTrigger to get + /// the child rerun triggers + /// + [JsonProperty(PropertyName = "parentTriggerName")] + public string ParentTriggerName { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerQueryResponse.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerQueryResponse.cs new file mode 100644 index 000000000000..82615f3a500c --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerQueryResponse.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataFactory.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A query of triggers. + /// + public partial class TriggerQueryResponse + { + /// + /// Initializes a new instance of the TriggerQueryResponse class. + /// + public TriggerQueryResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TriggerQueryResponse class. + /// + /// List of triggers. + /// The continuation token for getting + /// the next page of results, if any remaining results exist, null + /// otherwise. + public TriggerQueryResponse(IList value, string continuationToken = default(string)) + { + Value = value; + ContinuationToken = continuationToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of triggers. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets the continuation token for getting the next page of + /// results, if any remaining results exist, null otherwise. + /// + [JsonProperty(PropertyName = "continuationToken")] + public string ContinuationToken { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + if (Value != null) + { + foreach (var element in Value) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TumblingWindowTriggerDependencyReference.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TumblingWindowTriggerDependencyReference.cs index 3c26484919d2..b274d37a7636 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TumblingWindowTriggerDependencyReference.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TumblingWindowTriggerDependencyReference.cs @@ -85,9 +85,9 @@ public override void Validate() { throw new ValidationException(ValidationRules.MinLength, "Offset", 8); } - if (!System.Text.RegularExpressions.Regex.IsMatch(Offset, "((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))")) + if (!System.Text.RegularExpressions.Regex.IsMatch(Offset, "-?((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))")) { - throw new ValidationException(ValidationRules.Pattern, "Offset", "((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))"); + throw new ValidationException(ValidationRules.Pattern, "Offset", "-?((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9]))"); } } if (Size != null) diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperations.cs index 011c56eb99ea..8433a0986787 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperations.cs @@ -1075,6 +1075,11 @@ internal PipelinesOperations(DataFactoryManagementClient client) /// In recovery mode, the rerun will start from this activity. If not /// specified, all activities will run. /// + /// + /// In recovery mode, if set to true, the rerun will start from failed + /// activities. The property will be used only if startActivityName is not + /// specified. + /// /// /// Parameters of the pipeline run. These parameters will be used only if the /// runId is not specified. @@ -1100,7 +1105,7 @@ internal PipelinesOperations(DataFactoryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateRunWithHttpMessagesAsync(string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), IDictionary parameters = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateRunWithHttpMessagesAsync(string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), bool? startFromFailure = default(bool?), IDictionary parameters = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1180,6 +1185,7 @@ internal PipelinesOperations(DataFactoryManagementClient client) tracingParameters.Add("referencePipelineRunId", referencePipelineRunId); tracingParameters.Add("isRecovery", isRecovery); tracingParameters.Add("startActivityName", startActivityName); + tracingParameters.Add("startFromFailure", startFromFailure); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateRun", tracingParameters); @@ -1208,6 +1214,10 @@ internal PipelinesOperations(DataFactoryManagementClient client) { _queryParameters.Add(string.Format("startActivityName={0}", System.Uri.EscapeDataString(startActivityName))); } + if (startFromFailure != null) + { + _queryParameters.Add(string.Format("startFromFailure={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startFromFailure, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperationsExtensions.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperationsExtensions.cs index 3179cc730385..09978899849d 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperationsExtensions.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/PipelinesOperationsExtensions.cs @@ -250,13 +250,18 @@ public static void Delete(this IPipelinesOperations operations, string resourceG /// In recovery mode, the rerun will start from this activity. If not /// specified, all activities will run. /// + /// + /// In recovery mode, if set to true, the rerun will start from failed + /// activities. The property will be used only if startActivityName is not + /// specified. + /// /// /// Parameters of the pipeline run. These parameters will be used only if the /// runId is not specified. /// - public static CreateRunResponse CreateRun(this IPipelinesOperations operations, string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), IDictionary parameters = default(IDictionary)) + public static CreateRunResponse CreateRun(this IPipelinesOperations operations, string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), bool? startFromFailure = default(bool?), IDictionary parameters = default(IDictionary)) { - return operations.CreateRunAsync(resourceGroupName, factoryName, pipelineName, referencePipelineRunId, isRecovery, startActivityName, parameters).GetAwaiter().GetResult(); + return operations.CreateRunAsync(resourceGroupName, factoryName, pipelineName, referencePipelineRunId, isRecovery, startActivityName, startFromFailure, parameters).GetAwaiter().GetResult(); } /// @@ -287,6 +292,11 @@ public static void Delete(this IPipelinesOperations operations, string resourceG /// In recovery mode, the rerun will start from this activity. If not /// specified, all activities will run. /// + /// + /// In recovery mode, if set to true, the rerun will start from failed + /// activities. The property will be used only if startActivityName is not + /// specified. + /// /// /// Parameters of the pipeline run. These parameters will be used only if the /// runId is not specified. @@ -294,9 +304,9 @@ public static void Delete(this IPipelinesOperations operations, string resourceG /// /// The cancellation token. /// - public static async Task CreateRunAsync(this IPipelinesOperations operations, string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), IDictionary parameters = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateRunAsync(this IPipelinesOperations operations, string resourceGroupName, string factoryName, string pipelineName, string referencePipelineRunId = default(string), bool? isRecovery = default(bool?), string startActivityName = default(string), bool? startFromFailure = default(bool?), IDictionary parameters = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateRunWithHttpMessagesAsync(resourceGroupName, factoryName, pipelineName, referencePipelineRunId, isRecovery, startActivityName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateRunWithHttpMessagesAsync(resourceGroupName, factoryName, pipelineName, referencePipelineRunId, isRecovery, startActivityName, startFromFailure, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/RerunTriggersOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/RerunTriggersOperations.cs deleted file mode 100644 index 540b16f0014d..000000000000 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/RerunTriggersOperations.cs +++ /dev/null @@ -1,1612 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// RerunTriggersOperations operations. - /// - internal partial class RerunTriggersOperations : IServiceOperations, IRerunTriggersOperations - { - /// - /// Initializes a new instance of the RerunTriggersOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal RerunTriggersOperations(DataFactoryManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the DataFactoryManagementClient - /// - public DataFactoryManagementClient Client { get; private set; } - - /// - /// Creates a rerun trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// Rerun tumbling window trigger action parameters. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, RerunTumblingWindowTriggerActionParameters rerunTumblingWindowTriggerActionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (factoryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); - } - if (factoryName != null) - { - if (factoryName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); - } - if (factoryName.Length < 3) - { - throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); - } - } - if (triggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); - } - if (triggerName != null) - { - if (triggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); - } - if (triggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (rerunTriggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "rerunTriggerName"); - } - if (rerunTriggerName != null) - { - if (rerunTriggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "rerunTriggerName", 260); - } - if (rerunTriggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "rerunTriggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(rerunTriggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "rerunTriggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (rerunTumblingWindowTriggerActionParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "rerunTumblingWindowTriggerActionParameters"); - } - if (rerunTumblingWindowTriggerActionParameters != null) - { - rerunTumblingWindowTriggerActionParameters.Validate(); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("factoryName", factoryName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("rerunTriggerName", rerunTriggerName); - tracingParameters.Add("rerunTumblingWindowTriggerActionParameters", rerunTumblingWindowTriggerActionParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/rerunTriggers/{rerunTriggerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); - _url = _url.Replace("{rerunTriggerName}", System.Uri.EscapeDataString(rerunTriggerName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(rerunTumblingWindowTriggerActionParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(rerunTumblingWindowTriggerActionParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Starts a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Stops a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Cancels a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CancelWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCancelWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListByTriggerWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (factoryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); - } - if (factoryName != null) - { - if (factoryName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); - } - if (factoryName.Length < 3) - { - throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); - } - } - if (triggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); - } - if (triggerName != null) - { - if (triggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); - } - if (triggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("factoryName", factoryName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByTrigger", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/rerunTriggers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Starts a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (factoryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); - } - if (factoryName != null) - { - if (factoryName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); - } - if (factoryName.Length < 3) - { - throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); - } - } - if (triggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); - } - if (triggerName != null) - { - if (triggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); - } - if (triggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (rerunTriggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "rerunTriggerName"); - } - if (rerunTriggerName != null) - { - if (rerunTriggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "rerunTriggerName", 260); - } - if (rerunTriggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "rerunTriggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(rerunTriggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "rerunTriggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("factoryName", factoryName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("rerunTriggerName", rerunTriggerName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/rerunTriggers/{rerunTriggerName}/start").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); - _url = _url.Replace("{rerunTriggerName}", System.Uri.EscapeDataString(rerunTriggerName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Stops a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (factoryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); - } - if (factoryName != null) - { - if (factoryName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); - } - if (factoryName.Length < 3) - { - throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); - } - } - if (triggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); - } - if (triggerName != null) - { - if (triggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); - } - if (triggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (rerunTriggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "rerunTriggerName"); - } - if (rerunTriggerName != null) - { - if (rerunTriggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "rerunTriggerName", 260); - } - if (rerunTriggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "rerunTriggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(rerunTriggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "rerunTriggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("factoryName", factoryName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("rerunTriggerName", rerunTriggerName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/rerunTriggers/{rerunTriggerName}/stop").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); - _url = _url.Replace("{rerunTriggerName}", System.Uri.EscapeDataString(rerunTriggerName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Cancels a trigger. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (factoryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); - } - if (factoryName != null) - { - if (factoryName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); - } - if (factoryName.Length < 3) - { - throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) - { - throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); - } - } - if (triggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "triggerName"); - } - if (triggerName != null) - { - if (triggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "triggerName", 260); - } - if (triggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "triggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(triggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "triggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (rerunTriggerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "rerunTriggerName"); - } - if (rerunTriggerName != null) - { - if (rerunTriggerName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "rerunTriggerName", 260); - } - if (rerunTriggerName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "rerunTriggerName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(rerunTriggerName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "rerunTriggerName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("factoryName", factoryName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("rerunTriggerName", rerunTriggerName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCancel", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/triggers/{triggerName}/rerunTriggers/{rerunTriggerName}/cancel").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); - _url = _url.Replace("{rerunTriggerName}", System.Uri.EscapeDataString(rerunTriggerName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListByTriggerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByTriggerNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/RerunTriggersOperationsExtensions.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/RerunTriggersOperationsExtensions.cs deleted file mode 100644 index cdd2b66de90e..000000000000 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/RerunTriggersOperationsExtensions.cs +++ /dev/null @@ -1,457 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataFactory -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for RerunTriggersOperations. - /// - public static partial class RerunTriggersOperationsExtensions - { - /// - /// Creates a rerun trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// Rerun tumbling window trigger action parameters. - /// - public static TriggerResource Create(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, RerunTumblingWindowTriggerActionParameters rerunTumblingWindowTriggerActionParameters) - { - return operations.CreateAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, rerunTumblingWindowTriggerActionParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a rerun trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// Rerun tumbling window trigger action parameters. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, RerunTumblingWindowTriggerActionParameters rerunTumblingWindowTriggerActionParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, rerunTumblingWindowTriggerActionParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - public static void Start(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName) - { - operations.StartAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName).GetAwaiter().GetResult(); - } - - /// - /// Starts a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The cancellation token. - /// - public static async Task StartAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Stops a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - public static void Stop(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName) - { - operations.StopAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName).GetAwaiter().GetResult(); - } - - /// - /// Stops a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The cancellation token. - /// - public static async Task StopAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.StopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Cancels a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - public static void Cancel(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName) - { - operations.CancelAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName).GetAwaiter().GetResult(); - } - - /// - /// Cancels a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - public static IPage ListByTrigger(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) - { - return operations.ListByTriggerAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); - } - - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByTriggerAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByTriggerWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Starts a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - public static void BeginStart(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName) - { - operations.BeginStartAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName).GetAwaiter().GetResult(); - } - - /// - /// Starts a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStartAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Stops a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - public static void BeginStop(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName) - { - operations.BeginStopAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName).GetAwaiter().GetResult(); - } - - /// - /// Stops a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The cancellation token. - /// - public static async Task BeginStopAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Cancels a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - public static void BeginCancel(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName) - { - operations.BeginCancelAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName).GetAwaiter().GetResult(); - } - - /// - /// Cancels a trigger. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The resource group name. - /// - /// - /// The factory name. - /// - /// - /// The trigger name. - /// - /// - /// The rerun trigger name. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCancelAsync(this IRerunTriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, string rerunTriggerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCancelWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, rerunTriggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByTriggerNext(this IRerunTriggersOperations operations, string nextPageLink) - { - return operations.ListByTriggerNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists rerun triggers by an original trigger name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByTriggerNextAsync(this IRerunTriggersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByTriggerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs index 7c915a373c10..b31348b3961b 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs @@ -32,22 +32,10 @@ public static IEnumerable> ApiInfo_DataFactoryMana new Tuple("DataFactory", "Operations", "2018-06-01"), new Tuple("DataFactory", "PipelineRuns", "2018-06-01"), new Tuple("DataFactory", "Pipelines", "2018-06-01"), - new Tuple("DataFactory", "RerunTriggers", "2018-06-01"), new Tuple("DataFactory", "TriggerRuns", "2018-06-01"), new Tuple("DataFactory", "Triggers", "2018-06-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4407"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datafactory/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=D:\\Git\\Azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e6a133198d4bc7e0cc8a3e42f8e10c5353a1d4ed"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs index 08657cb81ff2..24c8316dfff1 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs @@ -276,6 +276,246 @@ internal TriggersOperations(DataFactoryManagementClient client) return _result; } + /// + /// Query triggers. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Parameters to filter the triggers. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> QueryByFactoryWithHttpMessagesAsync(string resourceGroupName, string factoryName, TriggerFilterParameters filterParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (filterParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "filterParameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("filterParameters", filterParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "QueryByFactory", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/querytriggers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(filterParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(filterParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Creates or updates a trigger. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs index 62ee3833a23c..a8037398ce7a 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs @@ -61,6 +61,52 @@ public static IPage ListByFactory(this ITriggersOperations oper } } + /// + /// Query triggers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Parameters to filter the triggers. + /// + public static TriggerQueryResponse QueryByFactory(this ITriggersOperations operations, string resourceGroupName, string factoryName, TriggerFilterParameters filterParameters) + { + return operations.QueryByFactoryAsync(resourceGroupName, factoryName, filterParameters).GetAwaiter().GetResult(); + } + + /// + /// Query triggers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Parameters to filter the triggers. + /// + /// + /// The cancellation token. + /// + public static async Task QueryByFactoryAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, TriggerFilterParameters filterParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.QueryByFactoryWithHttpMessagesAsync(resourceGroupName, factoryName, filterParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates a trigger. ///