From 315bd706c2550dcfe16614561035f0435a103e25 Mon Sep 17 00:00:00 2001 From: Haoran Sun Date: Mon, 12 Aug 2019 16:59:10 +0800 Subject: [PATCH 1/7] add property blockSizeInMB for blobsink and blobFSsink --- .../src/Generated/Models/AzureBlobFSSink.cs | 12 ++++- .../src/Generated/Models/BlobSink.cs | 13 ++++- .../SdkInfo_DataFactoryManagementClient.cs | 51 ------------------- .../tests/JsonSamples/PipelineJsonSamples.cs | 50 +++++++++++++++++- 4 files changed, 72 insertions(+), 54 deletions(-) delete mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs index 587c3c7c0b67..8c9dbb6971c7 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs @@ -48,10 +48,13 @@ public AzureBlobFSSink() /// Expression with resultType integer). /// The type of copy behavior for copy /// sink. - public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) + /// Indicates the block size(MB) when + /// writing data to blobFS. Type: integer. + public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object), int? blockSizeInMB = default(int?)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { CopyBehavior = copyBehavior; + BlockSizeInMB = blockSizeInMB; CustomInit(); } @@ -66,5 +69,12 @@ public AzureBlobFSSink() [JsonProperty(PropertyName = "copyBehavior")] public object CopyBehavior { get; set; } + /// + /// Gets or sets indicates the block size(MB) when writing data to + /// blobFS. Type: integer. + /// + [JsonProperty(PropertyName = "blockSizeInMB")] + public int? BlockSizeInMB { get; set; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs index ff85b921f5a5..f14cf6657dc4 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs @@ -55,13 +55,17 @@ public BlobSink() /// boolean (or Expression with resultType boolean). /// The type of copy behavior for copy /// sink. - public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object)) + /// Indicates the block size(MB) when + /// writing data to blob. Type: integer (or Expression with resultType + /// integer). + public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object), int? blockSizeInMB = default(int?)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { BlobWriterOverwriteFiles = blobWriterOverwriteFiles; BlobWriterDateTimeFormat = blobWriterDateTimeFormat; BlobWriterAddHeader = blobWriterAddHeader; CopyBehavior = copyBehavior; + BlockSizeInMB = blockSizeInMB; CustomInit(); } @@ -97,5 +101,12 @@ public BlobSink() [JsonProperty(PropertyName = "copyBehavior")] public object CopyBehavior { get; set; } + /// + /// Gets or sets indicates the block size(MB) when writing data to + /// blob. Type: integer (or Expression with resultType integer). + /// + [JsonProperty(PropertyName = "blockSizeInMB")] + public int? BlockSizeInMB { get; set; } + } } 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 deleted file mode 100644 index 1d5b778524b6..000000000000 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs +++ /dev/null @@ -1,51 +0,0 @@ - -// -// 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 System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_DataFactoryManagementClient - { - get - { - return new Tuple[] - { - new Tuple("DataFactory", "ActivityRuns", "2018-06-01"), - new Tuple("DataFactory", "Datasets", "2018-06-01"), - new Tuple("DataFactory", "ExposureControl", "2018-06-01"), - new Tuple("DataFactory", "Factories", "2018-06-01"), - new Tuple("DataFactory", "IntegrationRuntimeNodes", "2018-06-01"), - new Tuple("DataFactory", "IntegrationRuntimeObjectMetadata", "2018-06-01"), - new Tuple("DataFactory", "IntegrationRuntimes", "2018-06-01"), - new Tuple("DataFactory", "LinkedServices", "2018-06-01"), - 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.4283"; - 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=C:\\Users\\xiaoyz\\Source\\Repos\\azure-sdk-for-net-wenbo\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "f80a6c182c85879a415d4c668473c592147416f3"; - 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/tests/JsonSamples/PipelineJsonSamples.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs index c868ea22dc00..72be66e2ceb8 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs @@ -1502,7 +1502,8 @@ public class PipelineJsonSamples : JsonSampleCollection type: ""BlobSink"", writeBatchSize: 1000000, writeBatchTimeout: ""01:00:00"", - copyBehavior: ""FlattenHierarchy"" + copyBehavior: ""FlattenHierarchy"", + blockSizeInMB: 8 } }, inputs: @@ -1522,6 +1523,53 @@ public class PipelineJsonSamples : JsonSampleCollection ] } } +"; + + [JsonSample(version: "Copy")] + public const string CopyFileSystemSourceToBlobFSSink = @" +{ + name: ""MyPipelineName"", + properties: + { + description : ""Copy from File to BlobFS"", + activities: + [ + { + type: ""Copy"", + name: ""MyActivityName"", + typeProperties: + { + source: + { + type: ""FileSystemSource"", + recursive: true + }, + sink: + { + type: ""BlobSink"", + writeBatchSize: 1000000, + writeBatchTimeout: ""01:00:00"", + copyBehavior: ""FlattenHierarchy"", + blockSizeInMB: 8 + } + }, + inputs: + [ + { + referenceName: ""RawFileSource"", type: ""DatasetReference"" + } + ], + outputs: + [ + { + referenceName: ""BlobFSSink"", type: ""DatasetReference"" + } + ], + linkedServiceName: { referenceName: ""MyLinkedServiceName"", type: ""LinkedServiceReference"" } + } + ] + } +} "; [JsonSample(version: "Copy")] From 50ddcb8319858361cc35e0aad6d6ec78f8f5b748 Mon Sep 17 00:00:00 2001 From: Haoran Sun Date: Tue, 13 Aug 2019 11:07:51 +0800 Subject: [PATCH 2/7] fix property type --- .../src/Generated/Models/AzureBlobFSSink.cs | 9 +++++---- .../src/Generated/Models/BlobSink.cs | 4 ++-- .../tests/JsonSamples/PipelineJsonSamples.cs | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs index 8c9dbb6971c7..6931cfc32a30 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs @@ -49,8 +49,9 @@ public AzureBlobFSSink() /// The type of copy behavior for copy /// sink. /// Indicates the block size(MB) when - /// writing data to blobFS. Type: integer. - public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object), int? blockSizeInMB = default(int?)) + /// writing data to blobFS. Type: integer (or Expression with + /// resultType integer). + public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { CopyBehavior = copyBehavior; @@ -71,10 +72,10 @@ public AzureBlobFSSink() /// /// Gets or sets indicates the block size(MB) when writing data to - /// blobFS. Type: integer. + /// blobFS. Type: integer (or Expression with resultType integer). /// [JsonProperty(PropertyName = "blockSizeInMB")] - public int? BlockSizeInMB { get; set; } + public object BlockSizeInMB { get; set; } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs index f14cf6657dc4..a1595461b9ee 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs @@ -58,7 +58,7 @@ public BlobSink() /// Indicates the block size(MB) when /// writing data to blob. Type: integer (or Expression with resultType /// integer). - public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object), int? blockSizeInMB = default(int?)) + public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { BlobWriterOverwriteFiles = blobWriterOverwriteFiles; @@ -106,7 +106,7 @@ public BlobSink() /// blob. Type: integer (or Expression with resultType integer). /// [JsonProperty(PropertyName = "blockSizeInMB")] - public int? BlockSizeInMB { get; set; } + public object BlockSizeInMB { get; set; } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs index 72be66e2ceb8..dd4cb479d072 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs @@ -1546,7 +1546,7 @@ public class PipelineJsonSamples : JsonSampleCollection }, sink: { - type: ""BlobSink"", + type: ""AzureBlobFSSink"", writeBatchSize: 1000000, writeBatchTimeout: ""01:00:00"", copyBehavior: ""FlattenHierarchy"", @@ -1562,7 +1562,7 @@ public class PipelineJsonSamples : JsonSampleCollection outputs: [ { - referenceName: ""BlobFSSink"", type: ""DatasetReference"" + referenceName: ""AzureBlobFSSink"", type: ""DatasetReference"" } ], linkedServiceName: { referenceName: ""MyLinkedServiceName"", type: ""LinkedServiceReference"" } From 6197aaa7179f8d66421baabff9bf63af6b7e695c Mon Sep 17 00:00:00 2001 From: Haoran Sun Date: Tue, 13 Aug 2019 14:03:48 +0800 Subject: [PATCH 3/7] Move property from BlobSink (datasetV1) to AzureBlobStorageWriteSettings (datasetV2) --- .../src/Generated/Models/AzureBlobFSSink.cs | 13 +- .../Models/AzureBlobFSWriteSettings.cs | 14 ++- .../Models/AzureBlobStorageWriteSettings.cs | 14 ++- .../src/Generated/Models/BinarySink.cs | 4 +- .../src/Generated/Models/BlobSink.cs | 13 +- .../tests/JsonSamples/PipelineJsonSamples.cs | 119 ++++++++++-------- 6 files changed, 100 insertions(+), 77 deletions(-) diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs index 6931cfc32a30..587c3c7c0b67 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSSink.cs @@ -48,14 +48,10 @@ public AzureBlobFSSink() /// Expression with resultType integer). /// The type of copy behavior for copy /// sink. - /// Indicates the block size(MB) when - /// writing data to blobFS. Type: integer (or Expression with - /// resultType integer). - public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) + public AzureBlobFSSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { CopyBehavior = copyBehavior; - BlockSizeInMB = blockSizeInMB; CustomInit(); } @@ -70,12 +66,5 @@ public AzureBlobFSSink() [JsonProperty(PropertyName = "copyBehavior")] public object CopyBehavior { get; set; } - /// - /// Gets or sets indicates the block size(MB) when writing data to - /// blobFS. Type: integer (or Expression with resultType integer). - /// - [JsonProperty(PropertyName = "blockSizeInMB")] - public object BlockSizeInMB { get; set; } - } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs index b80df367637a..25427124a47a 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.DataFactory.Models { + using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -38,9 +39,13 @@ public AzureBlobFSWriteSettings() /// Expression with resultType integer). /// The type of copy behavior for copy /// sink. - public AzureBlobFSWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) + /// Indicates the block size(MB) when + /// writing data to blob. Type: integer (or Expression with resultType + /// integer). + public AzureBlobFSWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) : base(type, additionalProperties, maxConcurrentConnections, copyBehavior) { + BlockSizeInMB = blockSizeInMB; CustomInit(); } @@ -49,6 +54,13 @@ public AzureBlobFSWriteSettings() /// partial void CustomInit(); + /// + /// Gets or sets indicates the block size(MB) when writing data to + /// blob. Type: integer (or Expression with resultType integer). + /// + [JsonProperty(PropertyName = "blockSizeInMB")] + public object BlockSizeInMB { get; set; } + /// /// Validate the object. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs index b40c03973a83..97e0f5c9d434 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.DataFactory.Models { + using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -40,9 +41,13 @@ public AzureBlobStorageWriteSettings() /// Expression with resultType integer). /// The type of copy behavior for copy /// sink. - public AzureBlobStorageWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) + /// Indicates the block size(MB) when + /// writing data to blob. Type: integer (or Expression with resultType + /// integer). + public AzureBlobStorageWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) : base(type, additionalProperties, maxConcurrentConnections, copyBehavior) { + BlockSizeInMB = blockSizeInMB; CustomInit(); } @@ -51,6 +56,13 @@ public AzureBlobStorageWriteSettings() /// partial void CustomInit(); + /// + /// Gets or sets indicates the block size(MB) when writing data to + /// blob. Type: integer (or Expression with resultType integer). + /// + [JsonProperty(PropertyName = "blockSizeInMB")] + public object BlockSizeInMB { get; set; } + /// /// Validate the object. /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs index 46e9928c924c..ecfd2b070915 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs @@ -47,7 +47,7 @@ public BinarySink() /// connection count for the sink data store. Type: integer (or /// Expression with resultType integer). /// Binary store settings. - public BinarySink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), StoreReadSettings storeSettings = default(StoreReadSettings)) + public BinarySink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { StoreSettings = storeSettings; @@ -63,7 +63,7 @@ public BinarySink() /// Gets or sets binary store settings. /// [JsonProperty(PropertyName = "storeSettings")] - public StoreReadSettings StoreSettings { get; set; } + public StoreWriteSettings StoreSettings { get; set; } /// /// Validate the object. diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs index a1595461b9ee..ff85b921f5a5 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BlobSink.cs @@ -55,17 +55,13 @@ public BlobSink() /// boolean (or Expression with resultType boolean). /// The type of copy behavior for copy /// sink. - /// Indicates the block size(MB) when - /// writing data to blob. Type: integer (or Expression with resultType - /// integer). - public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) + public BlobSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object blobWriterOverwriteFiles = default(object), object blobWriterDateTimeFormat = default(object), object blobWriterAddHeader = default(object), object copyBehavior = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { BlobWriterOverwriteFiles = blobWriterOverwriteFiles; BlobWriterDateTimeFormat = blobWriterDateTimeFormat; BlobWriterAddHeader = blobWriterAddHeader; CopyBehavior = copyBehavior; - BlockSizeInMB = blockSizeInMB; CustomInit(); } @@ -101,12 +97,5 @@ public BlobSink() [JsonProperty(PropertyName = "copyBehavior")] public object CopyBehavior { get; set; } - /// - /// Gets or sets indicates the block size(MB) when writing data to - /// blob. Type: integer (or Expression with resultType integer). - /// - [JsonProperty(PropertyName = "blockSizeInMB")] - public object BlockSizeInMB { get; set; } - } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs index dd4cb479d072..20fae534b331 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs @@ -1502,8 +1502,7 @@ public class PipelineJsonSamples : JsonSampleCollection type: ""BlobSink"", writeBatchSize: 1000000, writeBatchTimeout: ""01:00:00"", - copyBehavior: ""FlattenHierarchy"", - blockSizeInMB: 8 + copyBehavior: ""FlattenHierarchy"" } }, inputs: @@ -1523,53 +1522,6 @@ public class PipelineJsonSamples : JsonSampleCollection ] } } -"; - - [JsonSample(version: "Copy")] - public const string CopyFileSystemSourceToBlobFSSink = @" -{ - name: ""MyPipelineName"", - properties: - { - description : ""Copy from File to BlobFS"", - activities: - [ - { - type: ""Copy"", - name: ""MyActivityName"", - typeProperties: - { - source: - { - type: ""FileSystemSource"", - recursive: true - }, - sink: - { - type: ""AzureBlobFSSink"", - writeBatchSize: 1000000, - writeBatchTimeout: ""01:00:00"", - copyBehavior: ""FlattenHierarchy"", - blockSizeInMB: 8 - } - }, - inputs: - [ - { - referenceName: ""RawFileSource"", type: ""DatasetReference"" - } - ], - outputs: - [ - { - referenceName: ""AzureBlobFSSink"", type: ""DatasetReference"" - } - ], - linkedServiceName: { referenceName: ""MyLinkedServiceName"", type: ""LinkedServiceReference"" } - } - ] - } -} "; [JsonSample(version: "Copy")] @@ -4310,11 +4262,80 @@ public class PipelineJsonSamples : JsonSampleCollection ""referenceName"": ""exampleDataset"", ""type"": ""DatasetReference"" } + ] + }, + { + ""type"": ""Copy"", + ""typeProperties"": { + ""source"": { + ""type"": ""BinarySource"", + ""storeSettings"": { + ""type"": ""AzureDataLakeStoreReadSettings"", + ""recursive"": true, + ""enablePartitionDiscovery"": true + } + }, + ""sink"": { + ""type"": ""BinarySink"", + ""storeSettings"": { + ""type"": ""AzureBlobStorageWriteSettings"", + ""maxConcurrentConnections"": 3, + ""copyBehavior"": ""PreserveHierarchy"", + ""blockSizeInMB"": 8 + } + } + }, + ""inputs"": [ + { + ""referenceName"": ""exampleDataset"", + ""type"": ""DatasetReference"" + } + ], + ""outputs"": [ + { + ""referenceName"": ""exampleDataset"", + ""type"": ""DatasetReference"" + } + ] + }, + { + ""type"": ""Copy"", + ""typeProperties"": { + ""source"": { + ""type"": ""BinarySource"", + ""storeSettings"": { + ""type"": ""AzureDataLakeStoreReadSettings"", + ""recursive"": true, + ""enablePartitionDiscovery"": true + } + }, + ""sink"": { + ""type"": ""BinarySink"", + ""storeSettings"": { + ""type"": ""AzureBlobFSWriteSettings"", + ""maxConcurrentConnections"": 3, + ""copyBehavior"": ""PreserveHierarchy"", + ""blockSizeInMB"": 8 + } + } + }, + ""inputs"": [ + { + ""referenceName"": ""exampleDataset"", + ""type"": ""DatasetReference"" + } ], + ""outputs"": [ + { + ""referenceName"": ""exampleDataset"", + ""type"": ""DatasetReference"" + } + ] } ] } }"; + [JsonSample] public const string CopyActivity_Teradata_Binary = @"{ ""name"": ""MyPipeline"", From 3432790b0f3e49a0278b90631c9e8c3d03a2db0b Mon Sep 17 00:00:00 2001 From: Haoran Sun Date: Tue, 13 Aug 2019 15:22:41 +0800 Subject: [PATCH 4/7] Enable override for StoreWriteSettings --- .../Generated/DataFactoryManagementClient.cs | 2 ++ .../src/Generated/Models/AvroSink.cs | 17 ------------- .../Models/AzureBlobFSWriteSettings.cs | 15 ++---------- .../Models/AzureBlobStorageWriteSettings.cs | 15 ++---------- .../Models/AzureDataLakeStoreWriteSettings.cs | 15 ++---------- .../src/Generated/Models/BinarySink.cs | 13 ---------- .../src/Generated/Models/DelimitedTextSink.cs | 4 ---- .../Models/FileServerWriteSettings.cs | 15 ++---------- .../src/Generated/Models/ParquetSink.cs | 13 ---------- .../Generated/Models/StoreWriteSettings.cs | 24 +------------------ 10 files changed, 11 insertions(+), 122 deletions(-) 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 9766686b44ba..e33e68d2d6aa 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs @@ -457,6 +457,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("authorizationType")); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs index 674850039188..971fe631c2e1 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AvroSink.cs @@ -73,22 +73,5 @@ public AvroSink() [JsonProperty(PropertyName = "formatSettings")] public AvroWriteSettings FormatSettings { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StoreSettings != null) - { - StoreSettings.Validate(); - } - if (FormatSettings != null) - { - FormatSettings.Validate(); - } - } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs index 25427124a47a..a4190a133de4 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobFSWriteSettings.cs @@ -31,7 +31,6 @@ public AzureBlobFSWriteSettings() /// /// Initializes a new instance of the AzureBlobFSWriteSettings class. /// - /// The write setting type. /// Unmatched properties from the /// message are deserialized this collection /// The maximum concurrent @@ -42,8 +41,8 @@ public AzureBlobFSWriteSettings() /// Indicates the block size(MB) when /// writing data to blob. Type: integer (or Expression with resultType /// integer). - public AzureBlobFSWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) - : base(type, additionalProperties, maxConcurrentConnections, copyBehavior) + public AzureBlobFSWriteSettings(IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) + : base(additionalProperties, maxConcurrentConnections, copyBehavior) { BlockSizeInMB = blockSizeInMB; CustomInit(); @@ -61,15 +60,5 @@ public AzureBlobFSWriteSettings() [JsonProperty(PropertyName = "blockSizeInMB")] public object BlockSizeInMB { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs index 97e0f5c9d434..5abe50e082e2 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureBlobStorageWriteSettings.cs @@ -33,7 +33,6 @@ public AzureBlobStorageWriteSettings() /// Initializes a new instance of the AzureBlobStorageWriteSettings /// class. /// - /// The write setting type. /// Unmatched properties from the /// message are deserialized this collection /// The maximum concurrent @@ -44,8 +43,8 @@ public AzureBlobStorageWriteSettings() /// Indicates the block size(MB) when /// writing data to blob. Type: integer (or Expression with resultType /// integer). - public AzureBlobStorageWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) - : base(type, additionalProperties, maxConcurrentConnections, copyBehavior) + public AzureBlobStorageWriteSettings(IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object), object blockSizeInMB = default(object)) + : base(additionalProperties, maxConcurrentConnections, copyBehavior) { BlockSizeInMB = blockSizeInMB; CustomInit(); @@ -63,15 +62,5 @@ public AzureBlobStorageWriteSettings() [JsonProperty(PropertyName = "blockSizeInMB")] public object BlockSizeInMB { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreWriteSettings.cs index 5d10b8f5583d..6a3e6a6958a7 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreWriteSettings.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureDataLakeStoreWriteSettings.cs @@ -32,7 +32,6 @@ public AzureDataLakeStoreWriteSettings() /// Initializes a new instance of the AzureDataLakeStoreWriteSettings /// class. /// - /// The write setting type. /// Unmatched properties from the /// message are deserialized this collection /// The maximum concurrent @@ -40,8 +39,8 @@ public AzureDataLakeStoreWriteSettings() /// Expression with resultType integer). /// The type of copy behavior for copy /// sink. - public AzureDataLakeStoreWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) - : base(type, additionalProperties, maxConcurrentConnections, copyBehavior) + public AzureDataLakeStoreWriteSettings(IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) + : base(additionalProperties, maxConcurrentConnections, copyBehavior) { CustomInit(); } @@ -51,15 +50,5 @@ public AzureDataLakeStoreWriteSettings() /// partial void CustomInit(); - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs index ecfd2b070915..5fec652f6705 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/BinarySink.cs @@ -65,18 +65,5 @@ public BinarySink() [JsonProperty(PropertyName = "storeSettings")] public StoreWriteSettings StoreSettings { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StoreSettings != null) - { - StoreSettings.Validate(); - } - } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs index 48aa6c4a5e6d..d6c268d8b94f 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DelimitedTextSink.cs @@ -81,10 +81,6 @@ public DelimitedTextSink() /// public virtual void Validate() { - if (StoreSettings != null) - { - StoreSettings.Validate(); - } if (FormatSettings != null) { FormatSettings.Validate(); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileServerWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileServerWriteSettings.cs index c7f5984e798d..b89b89c40ba2 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileServerWriteSettings.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/FileServerWriteSettings.cs @@ -30,7 +30,6 @@ public FileServerWriteSettings() /// /// Initializes a new instance of the FileServerWriteSettings class. /// - /// The write setting type. /// Unmatched properties from the /// message are deserialized this collection /// The maximum concurrent @@ -38,8 +37,8 @@ public FileServerWriteSettings() /// Expression with resultType integer). /// The type of copy behavior for copy /// sink. - public FileServerWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) - : base(type, additionalProperties, maxConcurrentConnections, copyBehavior) + public FileServerWriteSettings(IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) + : base(additionalProperties, maxConcurrentConnections, copyBehavior) { CustomInit(); } @@ -49,15 +48,5 @@ public FileServerWriteSettings() /// partial void CustomInit(); - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs index 73efe2afcdf0..67b95379fe09 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ParquetSink.cs @@ -65,18 +65,5 @@ public ParquetSink() [JsonProperty(PropertyName = "storeSettings")] public StoreWriteSettings StoreSettings { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StoreSettings != null) - { - StoreSettings.Validate(); - } - } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/StoreWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/StoreWriteSettings.cs index a2865e56f776..0346d5e0d099 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/StoreWriteSettings.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/StoreWriteSettings.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataFactory.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -32,7 +31,6 @@ public StoreWriteSettings() /// /// Initializes a new instance of the StoreWriteSettings class. /// - /// The write setting type. /// Unmatched properties from the /// message are deserialized this collection /// The maximum concurrent @@ -40,10 +38,9 @@ public StoreWriteSettings() /// Expression with resultType integer). /// The type of copy behavior for copy /// sink. - public StoreWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) + public StoreWriteSettings(IDictionary additionalProperties = default(IDictionary), object maxConcurrentConnections = default(object), object copyBehavior = default(object)) { AdditionalProperties = additionalProperties; - Type = type; MaxConcurrentConnections = maxConcurrentConnections; CopyBehavior = copyBehavior; CustomInit(); @@ -61,12 +58,6 @@ public StoreWriteSettings() [JsonExtensionData] public IDictionary AdditionalProperties { get; set; } - /// - /// Gets or sets the write setting type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - /// /// Gets or sets the maximum concurrent connection count for the source /// data store. Type: integer (or Expression with resultType integer). @@ -80,18 +71,5 @@ public StoreWriteSettings() [JsonProperty(PropertyName = "copyBehavior")] public object CopyBehavior { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); - } - } } } From 9befc0ead3c46a59d9219fd69d30bd96ee8c52fd Mon Sep 17 00:00:00 2001 From: Haoran Sun Date: Wed, 14 Aug 2019 10:58:59 +0800 Subject: [PATCH 5/7] bug fix --- .../tests/JsonSamples/PipelineJsonSamples.cs | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs index 20fae534b331..3f110228d975 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/tests/JsonSamples/PipelineJsonSamples.cs @@ -3746,12 +3746,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreReadSetting"", + ""type"": ""AzureDataLakeStoreReadSettings"", ""recursive"": true, ""enablePartitionDiscovery"": true }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -3759,12 +3759,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -3797,14 +3797,14 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""AzureBlobStorageReadSetting"", + ""type"": ""AzureBlobStorageReadSettings"", ""recursive"": true, ""enablePartitionDiscovery"": true, ""wildcardFolderPath"": ""abc/efg"", ""wildcardFileName"": ""a.csv"" }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -3812,12 +3812,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -3851,14 +3851,14 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""AzureBlobFSReadSetting"", + ""type"": ""AzureBlobFSReadSettings"", ""recursive"": true, ""enablePartitionDiscovery"": true, ""modifiedDatetimeStart"": ""2019-07-02T00:00:00.000Z"", ""modifiedDatetimeEnd"": ""2019-07-03T00:00:00.000Z"" }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -3866,12 +3866,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -3906,7 +3906,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""FileServerReadSetting"", + ""type"": ""FileServerReadSettings"", ""recursive"": true, ""enablePartitionDiscovery"": true, ""wildcardFolderPath"": ""A*"", @@ -3914,7 +3914,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""modifiedDatetimeEnd"": ""2019-07-03T00:00:00.000Z"" }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -3922,12 +3922,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -3961,14 +3961,14 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""FtpReadSetting"", + ""type"": ""FtpReadSettings"", ""recursive"": true, ""wildcardFolderPath"": ""A*"", ""wildcardFileName"": ""*.csv"", ""useBinaryTransfer"": true }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -3976,12 +3976,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -4015,7 +4015,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""HdfsReadSetting"", + ""type"": ""HdfsReadSettings"", ""recursive"": true, ""enablePartitionDiscovery"": true, ""wildcardFolderPath"": ""A*"", @@ -4023,7 +4023,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""modifiedDatetimeEnd"": ""2019-07-03T00:00:00.000Z"" }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -4031,12 +4031,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -4071,14 +4071,14 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""HttpReadSetting"", + ""type"": ""HttpReadSettings"", ""requestMethod"": ""POST"", ""requestBody"": ""request body"", ""additionalHeaders"": ""testHeaders"", ""requestTimeout"": ""2400"" }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -4086,12 +4086,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -4125,7 +4125,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""AmazonS3ReadSetting"", + ""type"": ""AmazonS3ReadSettings"", ""recursive"": true, ""enablePartitionDiscovery"": true, ""prefix"": ""A*"", @@ -4133,7 +4133,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""modifiedDatetimeEnd"": ""2019-07-03T00:00:00.000Z"" }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -4141,12 +4141,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -4181,7 +4181,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""DelimitedTextSource"", ""storeSettings"": { - ""type"": ""SftpReadSetting"", + ""type"": ""SftpReadSettings"", ""recursive"": true, ""wildcardFileName"": ""*.csv"", ""wildcardFolderPath"": ""A*"", @@ -4189,7 +4189,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""modifiedDatetimeEnd"": ""2019-07-03T00:00:00.000Z"" }, ""formatSettings"": { - ""type"": ""DelimitedTextReadSetting"", + ""type"": ""DelimitedTextReadSettings"", ""skipLineCount"": 10, ""additionalNullValues"": [ ""\\N"", ""NULL"" ] } @@ -4197,12 +4197,12 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""DelimitedTextSink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" }, ""formatSettings"": { - ""type"": ""DelimitedTextWriteSetting"", + ""type"": ""DelimitedTextWriteSettings"", ""quoteAllText"": true, ""fileExtension"": "".csv"" } @@ -4237,7 +4237,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""source"": { ""type"": ""BinarySource"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreReadSetting"", + ""type"": ""AzureDataLakeStoreReadSettings"", ""recursive"": true, ""enablePartitionDiscovery"": true } @@ -4245,7 +4245,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""BinarySink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" } @@ -4356,7 +4356,7 @@ public class PipelineJsonSamples : JsonSampleCollection ""sink"": { ""type"": ""BinarySink"", ""storeSettings"": { - ""type"": ""AzureDataLakeStoreWriteSetting"", + ""type"": ""AzureDataLakeStoreWriteSettings"", ""maxConcurrentConnections"": 3, ""copyBehavior"": ""PreserveHierarchy"" } From 1855007d0973e7739e78c3a3e321a57c021d50dd Mon Sep 17 00:00:00 2001 From: Haoran Sun Date: Tue, 20 Aug 2019 16:20:50 +0800 Subject: [PATCH 6/7] merge from master --- .../src/Generated/ITriggersOperations.cs | 140 +++ .../src/Generated/Models/AzureSqlSink.cs | 14 +- .../Models/EventSubscriptionStatus.cs | 25 + .../src/Generated/Models/JsonDataset.cs | 120 +++ .../src/Generated/Models/JsonSink.cs | 77 ++ .../src/Generated/Models/JsonSource.cs | 77 ++ .../Generated/Models/JsonWriteFilePattern.cs | 22 + .../src/Generated/Models/JsonWriteSettings.cs | 73 ++ .../src/Generated/Models/SqlDWSink.cs | 14 +- .../src/Generated/Models/SqlMISink.cs | 14 +- .../src/Generated/Models/SqlServerSink.cs | 14 +- .../src/Generated/Models/SqlSink.cs | 14 +- .../TriggerSubscriptionOperationStatus.cs | 64 ++ .../src/Generated/TriggersOperations.cs | 812 +++++++++++++++++- .../Generated/TriggersOperationsExtensions.cs | 230 +++++ 15 files changed, 1699 insertions(+), 11 deletions(-) create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EventSubscriptionStatus.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonDataset.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSource.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteFilePattern.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteSettings.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerSubscriptionOperationStatus.cs 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 638fc80b41a1..62dd32263d05 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/ITriggersOperations.cs @@ -143,6 +143,90 @@ public partial interface ITriggersOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Subscribe event trigger to events. + /// + /// + /// 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> SubscribeToEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a trigger's event subscription status. + /// + /// + /// 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> GetEventSubscriptionStatusWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Unsubscribe event trigger from events. + /// + /// + /// 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> UnsubscribeFromEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Starts a trigger. /// /// @@ -193,6 +277,62 @@ public partial interface ITriggersOperations /// Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Subscribe event trigger to events. + /// + /// + /// 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> BeginSubscribeToEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Unsubscribe event trigger from events. + /// + /// + /// 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> BeginUnsubscribeFromEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Starts a trigger. /// /// diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs index 50290e3179d8..e5132caf465f 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AzureSqlSink.cs @@ -58,7 +58,10 @@ public AzureSqlSink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public AzureSqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + public AzureSqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object), object tableOption = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; @@ -66,6 +69,7 @@ public AzureSqlSink() PreCopyScript = preCopyScript; StoredProcedureParameters = storedProcedureParameters; StoredProcedureTableTypeParameterName = storedProcedureTableTypeParameterName; + TableOption = tableOption; CustomInit(); } @@ -108,5 +112,13 @@ public AzureSqlSink() [JsonProperty(PropertyName = "storedProcedureTableTypeParameterName")] public object StoredProcedureTableTypeParameterName { get; set; } + /// + /// Gets or sets the option to handle sink table, such as autoCreate. + /// For now only 'autoCreate' value is supported. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "tableOption")] + public object TableOption { get; set; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EventSubscriptionStatus.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EventSubscriptionStatus.cs new file mode 100644 index 000000000000..580f566a608d --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/EventSubscriptionStatus.cs @@ -0,0 +1,25 @@ +// +// 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 +{ + + /// + /// Defines values for EventSubscriptionStatus. + /// + public static class EventSubscriptionStatus + { + public const string Enabled = "Enabled"; + public const string Provisioning = "Provisioning"; + public const string Deprovisioning = "Deprovisioning"; + public const string Disabled = "Disabled"; + public const string Unknown = "Unknown"; + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonDataset.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonDataset.cs new file mode 100644 index 000000000000..f0a13fc24ceb --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonDataset.cs @@ -0,0 +1,120 @@ +// +// 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 Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Json dataset. + /// + [Newtonsoft.Json.JsonObject("Json")] + [Rest.Serialization.JsonTransformation] + public partial class JsonDataset : Dataset + { + /// + /// Initializes a new instance of the JsonDataset class. + /// + public JsonDataset() + { + LinkedServiceName = new LinkedServiceReference(); + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonDataset class. + /// + /// Linked service reference. + /// The location of the json data + /// storage. + /// Unmatched properties from the + /// message are deserialized this collection + /// Dataset description. + /// Columns that define the structure of the + /// dataset. Type: array (or Expression with resultType array), + /// itemType: DatasetDataElement. + /// Columns that define the physical type schema + /// of the dataset. Type: array (or Expression with resultType array), + /// itemType: DatasetSchemaDataElement. + /// Parameters for dataset. + /// List of tags that can be used for + /// describing the Dataset. + /// The folder that this Dataset is in. If not + /// specified, Dataset will appear at the root level. + /// The code page name of the preferred + /// encoding. If not specified, the default value is UTF-8, unless BOM + /// denotes another Unicode encoding. Refer to the name column of the + /// table in the following link to set supported values: + /// https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: + /// string (or Expression with resultType string). + /// The data compression method used for the + /// json dataset. + public JsonDataset(LinkedServiceReference linkedServiceName, DatasetLocation location, IDictionary additionalProperties = default(IDictionary), string description = default(string), object structure = default(object), object schema = default(object), IDictionary parameters = default(IDictionary), IList annotations = default(IList), DatasetFolder folder = default(DatasetFolder), object encodingName = default(object), DatasetCompression compression = default(DatasetCompression)) + : base(linkedServiceName, additionalProperties, description, structure, schema, parameters, annotations, folder) + { + Location = location; + EncodingName = encodingName; + Compression = compression; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the location of the json data storage. + /// + [JsonProperty(PropertyName = "typeProperties.location")] + public DatasetLocation Location { get; set; } + + /// + /// Gets or sets the code page name of the preferred encoding. If not + /// specified, the default value is UTF-8, unless BOM denotes another + /// Unicode encoding. Refer to the name column of the table in the + /// following link to set supported values: + /// https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: + /// string (or Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.encodingName")] + public object EncodingName { get; set; } + + /// + /// Gets or sets the data compression method used for the json dataset. + /// + [JsonProperty(PropertyName = "typeProperties.compression")] + public DatasetCompression Compression { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (Location != null) + { + Location.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs new file mode 100644 index 000000000000..703c9718ea8c --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs @@ -0,0 +1,77 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A copy activity Json sink. + /// + public partial class JsonSink : CopySink + { + /// + /// Initializes a new instance of the JsonSink class. + /// + public JsonSink() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonSink class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Write batch size. Type: integer (or + /// Expression with resultType integer), minimum: 0. + /// Write batch timeout. Type: string + /// (or Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// Sink retry count. Type: integer (or + /// Expression with resultType integer). + /// Sink retry wait. Type: string (or + /// Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// The maximum concurrent + /// connection count for the sink data store. Type: integer (or + /// Expression with resultType integer). + /// Json store settings. + /// Json format settings. + public JsonSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), StoreWriteSettings storeSettings = default(StoreWriteSettings), JsonWriteSettings formatSettings = default(JsonWriteSettings)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + { + StoreSettings = storeSettings; + FormatSettings = formatSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets json store settings. + /// + [JsonProperty(PropertyName = "storeSettings")] + public StoreWriteSettings StoreSettings { get; set; } + + /// + /// Gets or sets json format settings. + /// + [JsonProperty(PropertyName = "formatSettings")] + public JsonWriteSettings FormatSettings { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSource.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSource.cs new file mode 100644 index 000000000000..2732f3e4e69d --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSource.cs @@ -0,0 +1,77 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A copy activity Json source. + /// + public partial class JsonSource : CopySource + { + /// + /// Initializes a new instance of the JsonSource class. + /// + public JsonSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonSource class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Source retry count. Type: integer + /// (or Expression with resultType integer). + /// Source retry wait. Type: string (or + /// Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// The maximum concurrent + /// connection count for the source data store. Type: integer (or + /// Expression with resultType integer). + /// Json store settings. + public JsonSource(IDictionary additionalProperties = default(IDictionary), object sourceRetryCount = default(object), object sourceRetryWait = default(object), object maxConcurrentConnections = default(object), StoreReadSettings storeSettings = default(StoreReadSettings)) + : base(additionalProperties, sourceRetryCount, sourceRetryWait, maxConcurrentConnections) + { + StoreSettings = storeSettings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets json store settings. + /// + [JsonProperty(PropertyName = "storeSettings")] + public StoreReadSettings StoreSettings { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StoreSettings != null) + { + StoreSettings.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteFilePattern.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteFilePattern.cs new file mode 100644 index 000000000000..124f33ec1a7f --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteFilePattern.cs @@ -0,0 +1,22 @@ +// +// 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 +{ + + /// + /// Defines values for JsonWriteFilePattern. + /// + public static class JsonWriteFilePattern + { + public const string SetOfObjects = "setOfObjects"; + public const string ArrayOfObjects = "arrayOfObjects"; + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteSettings.cs new file mode 100644 index 000000000000..23b2cb664523 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonWriteSettings.cs @@ -0,0 +1,73 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Json write settings. + /// + public partial class JsonWriteSettings : FormatWriteSettings + { + /// + /// Initializes a new instance of the JsonWriteSettings class. + /// + public JsonWriteSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JsonWriteSettings class. + /// + /// The write setting type. + /// Unmatched properties from the + /// message are deserialized this collection + /// File pattern of JSON. This setting + /// controls the way a collection of JSON objects will be treated. The + /// default value is 'setOfObjects'. It is case-sensitive. Possible + /// values include: 'setOfObjects', 'arrayOfObjects' + public JsonWriteSettings(string type, IDictionary additionalProperties = default(IDictionary), string filePattern = default(string)) + : base(type, additionalProperties) + { + FilePattern = filePattern; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets file pattern of JSON. This setting controls the way a + /// collection of JSON objects will be treated. The default value is + /// 'setOfObjects'. It is case-sensitive. Possible values include: + /// 'setOfObjects', 'arrayOfObjects' + /// + [JsonProperty(PropertyName = "filePattern")] + public string FilePattern { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs index e52711727fb1..665789d11e24 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlDWSink.cs @@ -53,12 +53,16 @@ public SqlDWSink() /// Expression with resultType boolean). /// Specifies PolyBase-related settings /// when allowPolyBase is true. - public SqlDWSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object), object allowPolyBase = default(object), PolybaseSettings polyBaseSettings = default(PolybaseSettings)) + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + public SqlDWSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object preCopyScript = default(object), object allowPolyBase = default(object), PolybaseSettings polyBaseSettings = default(PolybaseSettings), object tableOption = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { PreCopyScript = preCopyScript; AllowPolyBase = allowPolyBase; PolyBaseSettings = polyBaseSettings; + TableOption = tableOption; CustomInit(); } @@ -89,5 +93,13 @@ public SqlDWSink() [JsonProperty(PropertyName = "polyBaseSettings")] public PolybaseSettings PolyBaseSettings { get; set; } + /// + /// Gets or sets the option to handle sink table, such as autoCreate. + /// For now only 'autoCreate' value is supported. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "tableOption")] + public object TableOption { get; set; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs index 5044366f301f..d64ed35f2ae2 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlMISink.cs @@ -58,7 +58,10 @@ public SqlMISink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public SqlMISink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + public SqlMISink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object), object tableOption = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; @@ -66,6 +69,7 @@ public SqlMISink() PreCopyScript = preCopyScript; StoredProcedureParameters = storedProcedureParameters; StoredProcedureTableTypeParameterName = storedProcedureTableTypeParameterName; + TableOption = tableOption; CustomInit(); } @@ -108,5 +112,13 @@ public SqlMISink() [JsonProperty(PropertyName = "storedProcedureTableTypeParameterName")] public object StoredProcedureTableTypeParameterName { get; set; } + /// + /// Gets or sets the option to handle sink table, such as autoCreate. + /// For now only 'autoCreate' value is supported. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "tableOption")] + public object TableOption { get; set; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs index 017de9d8f760..ab3da5038a7d 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlServerSink.cs @@ -58,7 +58,10 @@ public SqlServerSink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public SqlServerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + public SqlServerSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object), object tableOption = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; @@ -66,6 +69,7 @@ public SqlServerSink() PreCopyScript = preCopyScript; StoredProcedureParameters = storedProcedureParameters; StoredProcedureTableTypeParameterName = storedProcedureTableTypeParameterName; + TableOption = tableOption; CustomInit(); } @@ -108,5 +112,13 @@ public SqlServerSink() [JsonProperty(PropertyName = "storedProcedureTableTypeParameterName")] public object StoredProcedureTableTypeParameterName { get; set; } + /// + /// Gets or sets the option to handle sink table, such as autoCreate. + /// For now only 'autoCreate' value is supported. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "tableOption")] + public object TableOption { get; set; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs index 56c858661b2a..a388a568e45f 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SqlSink.cs @@ -58,7 +58,10 @@ public SqlSink() /// The stored /// procedure parameter name of the table type. Type: string (or /// Expression with resultType string). - public SqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object)) + /// The option to handle sink table, such as + /// autoCreate. For now only 'autoCreate' value is supported. Type: + /// string (or Expression with resultType string). + public SqlSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object sqlWriterStoredProcedureName = default(object), object sqlWriterTableType = default(object), object preCopyScript = default(object), IDictionary storedProcedureParameters = default(IDictionary), object storedProcedureTableTypeParameterName = default(object), object tableOption = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { SqlWriterStoredProcedureName = sqlWriterStoredProcedureName; @@ -66,6 +69,7 @@ public SqlSink() PreCopyScript = preCopyScript; StoredProcedureParameters = storedProcedureParameters; StoredProcedureTableTypeParameterName = storedProcedureTableTypeParameterName; + TableOption = tableOption; CustomInit(); } @@ -108,5 +112,13 @@ public SqlSink() [JsonProperty(PropertyName = "storedProcedureTableTypeParameterName")] public object StoredProcedureTableTypeParameterName { get; set; } + /// + /// Gets or sets the option to handle sink table, such as autoCreate. + /// For now only 'autoCreate' value is supported. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "tableOption")] + public object TableOption { get; set; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerSubscriptionOperationStatus.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerSubscriptionOperationStatus.cs new file mode 100644 index 000000000000..dc44fadce22e --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/TriggerSubscriptionOperationStatus.cs @@ -0,0 +1,64 @@ +// +// 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; + + /// + /// Defines the response of a trigger subscription operation. + /// + public partial class TriggerSubscriptionOperationStatus + { + /// + /// Initializes a new instance of the + /// TriggerSubscriptionOperationStatus class. + /// + public TriggerSubscriptionOperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// TriggerSubscriptionOperationStatus class. + /// + /// Trigger name. + /// Event Subscription Status. Possible values + /// include: 'Enabled', 'Provisioning', 'Deprovisioning', 'Disabled', + /// 'Unknown' + public TriggerSubscriptionOperationStatus(string triggerName = default(string), string status = default(string)) + { + TriggerName = triggerName; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets trigger name. + /// + [JsonProperty(PropertyName = "triggerName")] + public string TriggerName { get; private set; } + + /// + /// Gets event Subscription Status. Possible values include: 'Enabled', + /// 'Provisioning', 'Deprovisioning', 'Disabled', 'Unknown' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + } +} 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 45ce129518bc..08657cb81ff2 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperations.cs @@ -1051,7 +1051,7 @@ internal TriggersOperations(DataFactoryManagementClient client) } /// - /// Starts a trigger. + /// Subscribe event trigger to events. /// /// /// The resource group name. @@ -1068,15 +1068,265 @@ internal TriggersOperations(DataFactoryManagementClient client) /// /// The cancellation token. /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> SubscribeToEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginSubscribeToEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Stops a trigger. + /// Get a trigger's event subscription status. + /// + /// + /// 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> GetEventSubscriptionStatusWithHttpMessagesAsync(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, "GetEventSubscriptionStatus", 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}/getEventSubscriptionStatus").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("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(); + } + // 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; + } + + /// + /// Unsubscribe event trigger from events. /// /// /// The resource group name. @@ -1093,13 +1343,563 @@ internal TriggersOperations(DataFactoryManagementClient client) /// /// The cancellation token. /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UnsubscribeFromEventsWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUnsubscribeFromEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Starts a trigger. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, 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 headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string factoryName, string triggerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Subscribe event trigger to events. + /// + /// + /// 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> BeginSubscribeToEventsWithHttpMessagesAsync(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, "BeginSubscribeToEvents", 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}/subscribeToEvents").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("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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// 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> BeginUnsubscribeFromEventsWithHttpMessagesAsync(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, "BeginUnsubscribeFromEvents", 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}/unsubscribeFromEvents").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("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 && (int)_statusCode != 202) + { + 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. /// 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 b942984b5427..62ee3833a23c 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/TriggersOperationsExtensions.cs @@ -220,6 +220,144 @@ public static void Delete(this ITriggersOperations operations, string resourceGr (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus SubscribeToEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.SubscribeToEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task SubscribeToEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SubscribeToEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a trigger's event subscription status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus GetEventSubscriptionStatus(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.GetEventSubscriptionStatusAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Get a trigger's event subscription status. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task GetEventSubscriptionStatusAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetEventSubscriptionStatusWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus UnsubscribeFromEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.UnsubscribeFromEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task UnsubscribeFromEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UnsubscribeFromEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Starts a trigger. /// @@ -306,6 +444,98 @@ public static void Stop(this ITriggersOperations operations, string resourceGrou (await operations.StopWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus BeginSubscribeToEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.BeginSubscribeToEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Subscribe event trigger to events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginSubscribeToEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginSubscribeToEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + public static TriggerSubscriptionOperationStatus BeginUnsubscribeFromEvents(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName) + { + return operations.BeginUnsubscribeFromEventsAsync(resourceGroupName, factoryName, triggerName).GetAwaiter().GetResult(); + } + + /// + /// Unsubscribe event trigger from events. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The trigger name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUnsubscribeFromEventsAsync(this ITriggersOperations operations, string resourceGroupName, string factoryName, string triggerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUnsubscribeFromEventsWithHttpMessagesAsync(resourceGroupName, factoryName, triggerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Starts a trigger. /// From 1dcdbcebe249d2846eedd42a3defa24582c1ba4d Mon Sep 17 00:00:00 2001 From: Haoran Sun Date: Thu, 29 Aug 2019 11:04:37 +0800 Subject: [PATCH 7/7] Generate SDK --- .../datafactory_resource-manager.txt | 6 +++--- .../src/Generated/Models/JsonSink.cs | 17 ----------------- .../SdkInfo_DataFactoryManagementClient.cs | 4 ++-- ...icrosoft.Azure.Management.DataFactory.csproj | 3 ++- .../src/Properties/AssemblyInfo.cs | 2 +- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt b/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt index 696d1f4e18a8..f67326d190f4 100644 --- a/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/datafactory_resource-manager.txt @@ -3,12 +3,12 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -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-sdk-for-net\sdk -2019-08-16 09:08:46 UTC +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=C:\azure-sdk-for-net\sdk +2019-08-22 15:02:19 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 23326b92394ef630c59833f27e512544162ef4dd +Commit: fb8f078deac2367f3dbcfbd8a542c77083c28a5b AutoRest information Requested version: latest Bootstrapper version: autorest@2.0.4283 diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs index 9017df04eaad..703c9718ea8c 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/JsonSink.cs @@ -73,22 +73,5 @@ public JsonSink() [JsonProperty(PropertyName = "formatSettings")] public JsonWriteSettings FormatSettings { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StoreSettings != null) - { - StoreSettings.Validate(); - } - if (FormatSettings != null) - { - FormatSettings.Validate(); - } - } } } 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 c4fbcebffce0..6c4f6b0598b1 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 @@ -39,10 +39,10 @@ public static IEnumerable> ApiInfo_DataFactoryMana // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "latest"; public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - 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-sdk-for-net\\sdk"; + 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=C:\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "23326b92394ef630c59833f27e512544162ef4dd"; + public static readonly String GithubCommidId = "fb8f078deac2367f3dbcfbd8a542c77083c28a5b"; 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/Microsoft.Azure.Management.DataFactory.csproj b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Microsoft.Azure.Management.DataFactory.csproj index a6f1cf3f243e..ebc881b532e7 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Microsoft.Azure.Management.DataFactory.csproj +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Microsoft.Azure.Management.DataFactory.csproj @@ -5,10 +5,11 @@ Microsoft.Azure.Management.DataFactory Azure Data Factory V2 is the data integration platform that goes beyond Azure Data Factory V1's orchestration and batch-processing of time-series data, with a general purpose app model supporting modern data warehousing patterns and scenarios, lift-and-shift SSIS, and data-driven SaaS applications. Compose and manage reliable and secure data integration workflows at scale. Use native ADF data connectors and Integration Runtimes to move and transform cloud and on-premises data that can be unstructured, semi-structured, and structured with Hadoop, Azure Data Lake, Spark, SQL Server, Cosmos DB and many other data platforms. - 4.1.2 + 4.1.3 Microsoft.Azure.Management.DataFactory Microsoft Azure resource management;Data Factory;ADF;