From fae03d601cffcb7bdc579cafd72b3351ce1fcd13 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 5 Sep 2024 08:17:59 +0000 Subject: [PATCH] CodeGen from PR 29938 in Azure/azure-rest-api-specs Merge cff8233bd23398a224c5d7bb9a0e5c60b72e7c66 into 3c4ddfa53535e9e2b775d885d91aa1ab57a7a7fd --- .../Samples/Sample_StreamingJobCollection.cs | 89 ++++++- .../Sample_StreamingJobFunctionResource.cs | 4 +- .../Sample_StreamingJobInputCollection.cs | 46 ++++ .../Sample_StreamingJobOutputCollection.cs | 217 ++++++++++++++++++ .../Sample_StreamingJobOutputResource.cs | 79 +++++++ .../Samples/Sample_StreamingJobResource.cs | 34 ++- .../Sample_SubscriptionResourceExtensions.cs | 9 +- .../ArmStreamAnalyticsModelFactory.cs | 146 ++++++++++-- ...ableStreamAnalyticsSubscriptionResource.cs | 2 +- ...aExplorerOutputDataSource.Serialization.cs | 188 +++++++++++++++ .../AzureDataExplorerOutputDataSource.cs | 47 ++++ .../src/Generated/Models/DataRefreshType.cs | 6 - .../DeltaSerialization.Serialization.cs | 170 ++++++++++++++ .../Generated/Models/DeltaSerialization.cs | 40 ++++ .../Models/EventSerializationType.cs | 3 + ...eReferenceInputDataSource.Serialization.cs | 145 ++++++++++++ .../Models/FileReferenceInputDataSource.cs | 35 +++ .../GetStreamingJobSkuResult.Serialization.cs | 156 +++++++++++++ .../Models/GetStreamingJobSkuResult.cs | 79 +++++++ ...tStreamingJobSkuResultSku.Serialization.cs | 126 ++++++++++ .../Models/GetStreamingJobSkuResultSku.cs | 65 ++++++ ...GetStreamingJobSkuResults.Serialization.cs | 147 ++++++++++++ .../Models/GetStreamingJobSkuResults.cs | 70 ++++++ .../ReferenceInputDataSource.Serialization.cs | 1 + .../Models/ReferenceInputDataSource.cs | 2 +- .../ReferenceInputProperties.Serialization.cs | 12 + .../Models/ReferenceInputProperties.cs | 9 +- .../ReflexOutputDataSource.Serialization.cs | 212 +++++++++++++++++ .../Models/ReflexOutputDataSource.cs | 55 +++++ .../src/Generated/Models/ResourceType.cs | 48 ++++ .../Models/SkuCapacity.Serialization.cs | 202 ++++++++++++++++ .../src/Generated/Models/SkuCapacity.cs | 82 +++++++ .../Generated/Models/SkuCapacityScaleType.cs | 54 +++++ ...nalyticsDataSerialization.Serialization.cs | 1 + .../StreamAnalyticsDataSerialization.cs | 2 +- .../StreamAnalyticsSku.Serialization.cs | 19 +- .../Generated/Models/StreamAnalyticsSku.cs | 8 +- ...treamAnalyticsSubResource.Serialization.cs | 4 +- .../Models/StreamAnalyticsSubResource.cs | 4 +- ...nalyticsSubscriptionQuota.Serialization.cs | 4 +- .../StreamAnalyticsSubscriptionQuota.cs | 2 +- .../StreamInputProperties.Serialization.cs | 12 + .../Generated/Models/StreamInputProperties.cs | 5 +- ...reamingJobInputProperties.Serialization.cs | 5 + .../Models/StreamingJobInputProperties.cs | 11 +- ...eamingJobOutputDataSource.Serialization.cs | 2 + .../Models/StreamingJobOutputDataSource.cs | 2 +- ...ngJobRefreshConfiguration.Serialization.cs | 4 +- .../StreamingJobRefreshConfiguration.cs | 4 +- .../UnknownInputProperties.Serialization.cs | 12 + .../Models/UnknownInputProperties.cs | 5 +- .../Models/UpdatableUdfRefreshType.cs | 51 ++++ .../RestOperations/SkuRestOperations.cs | 217 ++++++++++++++++++ .../StreamingJobsRestOperations.cs | 2 + ...treamAnalyticsClusterData.Serialization.cs | 4 +- .../Generated/StreamAnalyticsClusterData.cs | 2 +- .../StreamAnalyticsClusterResource.cs | 2 +- ...lyticsPrivateEndpointData.Serialization.cs | 4 +- .../StreamAnalyticsPrivateEndpointData.cs | 2 +- .../StreamingJobData.Serialization.cs | 42 +++- .../src/Generated/StreamingJobData.cs | 29 ++- .../StreamingJobFunctionData.Serialization.cs | 4 +- .../src/Generated/StreamingJobFunctionData.cs | 2 +- .../Generated/StreamingJobFunctionResource.cs | 2 +- .../StreamingJobInputData.Serialization.cs | 4 +- .../src/Generated/StreamingJobInputData.cs | 2 +- .../Generated/StreamingJobInputResource.cs | 2 +- .../StreamingJobOutputData.Serialization.cs | 8 +- .../src/Generated/StreamingJobOutputData.cs | 12 +- .../Generated/StreamingJobOutputResource.cs | 2 +- .../src/Generated/StreamingJobResource.cs | 59 ++++- .../StreamingJobTransformationData.cs | 2 +- .../src/autorest.md | 2 +- 73 files changed, 3026 insertions(+), 116 deletions(-) create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ResourceType.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.Serialization.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacityScaleType.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UpdatableUdfRefreshType.cs create mode 100644 sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/SkuRestOperations.cs diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobCollection.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobCollection.cs index 87b81a8af9c8..18eb5c6bdc0a 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobCollection.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; using Azure.ResourceManager.StreamAnalytics.Models; @@ -43,7 +44,14 @@ public async Task CreateOrUpdate_CreateACompleteStreamingJobAStreamingJobWithATr string jobName = "sj7804"; StreamingJobData data = new StreamingJobData(new AzureLocation("West US")) { - SkuName = StreamAnalyticsSkuName.Standard, + Sku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, + SkuPropertiesSku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, EventsOutOfOrderPolicy = EventsOutOfOrderPolicy.Drop, OutputErrorPolicy = StreamingJobOutputErrorPolicy.Drop, EventsOutOfOrderMaxDelayInSeconds = 0, @@ -116,7 +124,7 @@ public async Task CreateOrUpdate_CreateACompleteStreamingJobAStreamingJobWithATr DateFormat = "yyyy-dd-MM", TimeFormat = "HH", RefreshInterval = "00:01:00", - RefreshType = DataRefreshType.Nonblocking, + RefreshType = UpdatableUdfRefreshType.Nonblocking, }, }, Tags = @@ -163,7 +171,82 @@ public async Task CreateOrUpdate_CreateAStreamingJobShellAStreamingJobWithNoInpu string jobName = "sj59"; StreamingJobData data = new StreamingJobData(new AzureLocation("West US")) { - SkuName = StreamAnalyticsSkuName.Standard, + Sku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, + SkuPropertiesSku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, + EventsOutOfOrderPolicy = EventsOutOfOrderPolicy.Drop, + OutputErrorPolicy = StreamingJobOutputErrorPolicy.Drop, + EventsOutOfOrderMaxDelayInSeconds = 5, + EventsLateArrivalMaxDelayInSeconds = 16, + DataLocalion = new AzureLocation("en-US"), + CompatibilityLevel = StreamingJobCompatibilityLevel.Level1_0, + Inputs = +{ +}, + Outputs = +{ +}, + Functions = +{ +}, + Tags = +{ +["key1"] = "value1", +["key3"] = "value3", +["randomKey"] = "randomValue", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobName, data); + StreamingJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a streaming job shell (a streaming job with no inputs, outputs, transformation, or functions) with user assigned identity + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAStreamingJobShellAStreamingJobWithNoInputsOutputsTransformationOrFunctionsWithUserAssignedIdentity() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_Create_UserAssignedIdentity.json + // this example is just showing the usage of "StreamingJobs_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this StreamingJobResource + StreamingJobCollection collection = resourceGroupResource.GetStreamingJobs(); + + // invoke the operation + string jobName = "sjName"; + StreamingJobData data = new StreamingJobData(new AzureLocation("West US")) + { + Sku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, + Identity = new ManagedServiceIdentity("UserAssigned"), + SkuPropertiesSku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, EventsOutOfOrderPolicy = EventsOutOfOrderPolicy.Drop, OutputErrorPolicy = StreamingJobOutputErrorPolicy.Drop, EventsOutOfOrderMaxDelayInSeconds = 5, diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobFunctionResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobFunctionResource.cs index 098d14936bdb..822fb3d18dee 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobFunctionResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobFunctionResource.cs @@ -236,8 +236,8 @@ public async Task Test_TestTheConnectionForAnAzureMLFunction() // this example assumes you already have this StreamingJobFunctionResource created on azure // for more information of creating StreamingJobFunctionResource, please refer to the document of StreamingJobFunctionResource string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; - string resourceGroupName = "sjrg7"; - string jobName = "sj9093"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; string functionName = "function588"; ResourceIdentifier streamingJobFunctionResourceId = StreamingJobFunctionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName, functionName); StreamingJobFunctionResource streamingJobFunction = client.GetStreamingJobFunctionResource(streamingJobFunctionResourceId); diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobInputCollection.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobInputCollection.cs index 337d4ab708bd..4e653366519d 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobInputCollection.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobInputCollection.cs @@ -128,6 +128,52 @@ public async Task CreateOrUpdate_CreateAReferenceBlobInputWithCSVSerialization() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Create a reference file input + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAReferenceFileInput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Input_Create_Reference_File.json + // this example is just showing the usage of "Inputs_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobResource created on azure + // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg8440"; + string jobName = "sj9597"; + ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); + + // get the collection of this StreamingJobInputResource + StreamingJobInputCollection collection = streamingJob.GetStreamingJobInputs(); + + // invoke the operation + string inputName = "input7225"; + StreamingJobInputData input = new StreamingJobInputData() + { + Properties = new ReferenceInputProperties() + { + Datasource = new FileReferenceInputDataSource() + { + Path = "my/path", + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, inputName, input); + StreamingJobInputResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobInputData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create a stream Event Hub input with JSON serialization [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputCollection.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputCollection.cs index b8c5c42fd706..f13f231f5d61 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputCollection.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputCollection.cs @@ -15,6 +15,68 @@ namespace Azure.ResourceManager.StreamAnalytics.Samples { public partial class Sample_StreamingJobOutputCollection { + // Create a Delta Lake output + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateADeltaLakeOutput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_DeltaLake.json + // this example is just showing the usage of "Outputs_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobResource created on azure + // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; + ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); + + // get the collection of this StreamingJobOutputResource + StreamingJobOutputCollection collection = streamingJob.GetStreamingJobOutputs(); + + // invoke the operation + string outputName = "output1221"; + StreamingJobOutputData data = new StreamingJobOutputData() + { + Datasource = new BlobOutputDataSource() + { + StorageAccounts = +{ +new StreamAnalyticsStorageAccount() +{ +AccountName = "someAccountName", +AccountKey = "accountKey==", +} +}, + Container = "deltaoutput", + PathPattern = null, + DateFormat = null, + TimeFormat = null, + }, + Serialization = new DeltaSerialization() + { + DeltaTablePath = "/folder1/table1", + PartitionColumns = +{ +"column1" +}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, outputName, data); + StreamingJobOutputResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobOutputData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create a DocumentDB output [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] @@ -377,6 +439,52 @@ public async Task CreateOrUpdate_CreateABlobOutputWithCSVSerialization() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Create an Azure Data Explorer output + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAnAzureDataExplorerOutput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Create_AzureDataExplorer.json + // this example is just showing the usage of "Outputs_CreateOrReplace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobResource created on azure + // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; + ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); + + // get the collection of this StreamingJobOutputResource + StreamingJobOutputCollection collection = streamingJob.GetStreamingJobOutputs(); + + // invoke the operation + string outputName = "adxOutput"; + StreamingJobOutputData data = new StreamingJobOutputData() + { + Datasource = new AzureDataExplorerOutputDataSource() + { + Cluster = "https://asakustotest.eastus.kusto.windows.net", + Database = "dbname", + Table = "mytable", + AuthenticationMode = StreamAnalyticsAuthenticationMode.Msi, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, outputName, data); + StreamingJobOutputResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobOutputData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create an Azure Data Lake Store output with JSON serialization [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] @@ -683,6 +791,115 @@ public async Task CreateOrUpdate_CreateAnEventHubOutputWithJSONSerialization() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Get a Delta Lake output + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetADeltaLakeOutput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_DeltaLake.json + // this example is just showing the usage of "Outputs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobResource created on azure + // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; + ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); + + // get the collection of this StreamingJobOutputResource + StreamingJobOutputCollection collection = streamingJob.GetStreamingJobOutputs(); + + // invoke the operation + string outputName = "output1221"; + StreamingJobOutputResource result = await collection.GetAsync(outputName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobOutputData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a Delta Lake output + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetADeltaLakeOutput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_DeltaLake.json + // this example is just showing the usage of "Outputs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobResource created on azure + // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; + ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); + + // get the collection of this StreamingJobOutputResource + StreamingJobOutputCollection collection = streamingJob.GetStreamingJobOutputs(); + + // invoke the operation + string outputName = "output1221"; + bool result = await collection.ExistsAsync(outputName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a Delta Lake output + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetADeltaLakeOutput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_DeltaLake.json + // this example is just showing the usage of "Outputs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobResource created on azure + // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; + ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); + + // get the collection of this StreamingJobOutputResource + StreamingJobOutputCollection collection = streamingJob.GetStreamingJobOutputs(); + + // invoke the operation + string outputName = "output1221"; + NullableResponse response = await collection.GetIfExistsAsync(outputName); + StreamingJobOutputResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobOutputData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + // Get a DocumentDB output [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputResource.cs index de7cf799641b..824c4286a853 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobOutputResource.cs @@ -15,6 +15,53 @@ namespace Azure.ResourceManager.StreamAnalytics.Samples { public partial class Sample_StreamingJobOutputResource { + // Update a Delta Lake output + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateADeltaLakeOutput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Update_DeltaLake.json + // this example is just showing the usage of "Outputs_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobOutputResource created on azure + // for more information of creating StreamingJobOutputResource, please refer to the document of StreamingJobOutputResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; + string outputName = "output1221"; + ResourceIdentifier streamingJobOutputResourceId = StreamingJobOutputResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName, outputName); + StreamingJobOutputResource streamingJobOutput = client.GetStreamingJobOutputResource(streamingJobOutputResourceId); + + // invoke the operation + StreamingJobOutputData data = new StreamingJobOutputData() + { + Datasource = new BlobOutputDataSource() + { + Container = "deltaoutput2", + }, + Serialization = new DeltaSerialization() + { + DeltaTablePath = "/folder1/table2", + PartitionColumns = +{ +"column2" +}, + }, + }; + StreamingJobOutputResource result = await streamingJobOutput.UpdateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobOutputData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Update a DocumentDB output [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] @@ -497,6 +544,38 @@ public async Task Delete_DeleteAnOutput() Console.WriteLine($"Succeeded"); } + // Get a Delta Lake output + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetADeltaLakeOutput() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/Output_Get_DeltaLake.json + // this example is just showing the usage of "Outputs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobOutputResource created on azure + // for more information of creating StreamingJobOutputResource, please refer to the document of StreamingJobOutputResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; + string outputName = "output1221"; + ResourceIdentifier streamingJobOutputResourceId = StreamingJobOutputResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName, outputName); + StreamingJobOutputResource streamingJobOutput = client.GetStreamingJobOutputResource(streamingJobOutputResourceId); + + // invoke the operation + StreamingJobOutputResource result = await streamingJobOutput.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StreamingJobOutputData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Get a DocumentDB output [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobResource.cs index 58ccf5cf1a7a..e2ead143b4ba 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_StreamingJobResource.cs @@ -344,8 +344,8 @@ public async Task Scale_ScaleAStreamingJob() // this example assumes you already have this StreamingJobResource created on azure // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; - string resourceGroupName = "sjrg6936"; - string jobName = "sj59"; + string resourceGroupName = "sjrg"; + string jobName = "sjName"; ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); @@ -358,5 +358,35 @@ public async Task Scale_ScaleAStreamingJob() Console.WriteLine($"Succeeded"); } + + // Get valid SKUs list for the specified streaming job + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetSkus_GetValidSKUsListForTheSpecifiedStreamingJob() + { + // Generated from example definition: specification/streamanalytics/resource-manager/Microsoft.StreamAnalytics/preview/2021-10-01-preview/examples/StreamingJob_GetSkus.json + // this example is just showing the usage of "Sku_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StreamingJobResource created on azure + // for more information of creating StreamingJobResource, please refer to the document of StreamingJobResource + string subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; + string resourceGroupName = "sjrg3276"; + string jobName = "sj7804"; + ResourceIdentifier streamingJobResourceId = StreamingJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + StreamingJobResource streamingJob = client.GetStreamingJobResource(streamingJobResourceId); + + // invoke the operation and iterate over the result + await foreach (GetStreamingJobSkuResult item in streamingJob.GetSkusAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 4aca641ff427..4d8bfd145c9b 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -68,7 +68,14 @@ public async Task TestQuerySubscription_TestTheStreamAnalyticsQuery() AzureLocation location = new AzureLocation("West US"); StreamAnalyticsTestQuery testQuery = new StreamAnalyticsTestQuery(new StreamingJobData(new AzureLocation("West US")) { - SkuName = StreamAnalyticsSkuName.Standard, + Sku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, + SkuPropertiesSku = new StreamAnalyticsSku() + { + Name = StreamAnalyticsSkuName.Standard, + }, EventsOutOfOrderPolicy = EventsOutOfOrderPolicy.Drop, OutputErrorPolicy = StreamingJobOutputErrorPolicy.Drop, EventsOutOfOrderMaxDelayInSeconds = 0, diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/ArmStreamAnalyticsModelFactory.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/ArmStreamAnalyticsModelFactory.cs index 8414b4474cc3..d5712687e3da 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/ArmStreamAnalyticsModelFactory.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/ArmStreamAnalyticsModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -26,7 +27,7 @@ public static partial class ArmStreamAnalyticsModelFactory /// The available derived classes include and . /// /// A new instance for mocking. - public static StreamingJobFunctionData StreamingJobFunctionData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, StreamingJobFunctionProperties properties = null) + public static StreamingJobFunctionData StreamingJobFunctionData(ResourceIdentifier id = null, string name = null, Core.ResourceType? resourceType = null, StreamingJobFunctionProperties properties = null) { return new StreamingJobFunctionData(id, name, resourceType, serializedAdditionalRawData: null, properties); } @@ -60,7 +61,7 @@ public static StreamingJobFunctionProperties StreamingJobFunctionProperties(stri /// Resource name. /// Resource type. /// A new instance for mocking. - public static StreamAnalyticsSubResource StreamAnalyticsSubResource(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null) + public static StreamAnalyticsSubResource StreamAnalyticsSubResource(ResourceIdentifier id = null, string name = null, Core.ResourceType? resourceType = null) { return new StreamAnalyticsSubResource(id, name, resourceType, serializedAdditionalRawData: null); } @@ -108,7 +109,7 @@ public static StreamAnalyticsResourceTestStatus StreamAnalyticsResourceTestStatu /// The available derived classes include and . /// /// A new instance for mocking. - public static StreamingJobInputData StreamingJobInputData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, StreamingJobInputProperties properties = null) + public static StreamingJobInputData StreamingJobInputData(ResourceIdentifier id = null, string name = null, Core.ResourceType? resourceType = null, StreamingJobInputProperties properties = null) { return new StreamingJobInputData(id, name, resourceType, serializedAdditionalRawData: null, properties); } @@ -118,15 +119,16 @@ public static StreamingJobInputData StreamingJobInputData(ResourceIdentifier id /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// Describes how input data is compressed. /// partitionKey Describes a key in the input data which is used for partitioning the input data. /// Settings which determine whether to read watermark events. + /// Messaging catalog configuration. /// A new instance for mocking. - public static StreamingJobInputProperties StreamingJobInputProperties(string inputPropertiesType = null, StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, StreamingCompressionType? compressionType = null, string partitionKey = null, StreamingJobInputWatermarkMode? watermarkMode = null) + public static StreamingJobInputProperties StreamingJobInputProperties(string inputPropertiesType = null, StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, StreamingCompressionType? compressionType = null, string partitionKey = null, StreamingJobInputWatermarkMode? watermarkMode = null, string messagingCatalogConfiguration = null) { diagnosticsConditions ??= new List(); @@ -138,6 +140,7 @@ public static StreamingJobInputProperties StreamingJobInputProperties(string inp compressionType.HasValue ? new StreamingCompression(compressionType.Value, serializedAdditionalRawData: null) : null, partitionKey, watermarkMode != null ? new StreamingJobInputWatermarkProperties(watermarkMode, serializedAdditionalRawData: null) : null, + messagingCatalogConfiguration, serializedAdditionalRawData: null); } @@ -158,21 +161,21 @@ public static StreamingJobDiagnosticCondition StreamingJobDiagnosticCondition(Da /// /// Describes the data source that output will be written to. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , and . + /// The available derived classes include , , , , , , , , , , , , , , , and . /// /// The time frame for filtering Stream Analytics job outputs. /// The size window to constrain a Stream Analytics output to. /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the output. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// A list of the last output event times for each output partition. The index of the array corresponds to the partition number. /// Settings which determine whether to send watermarks to downstream. /// A new instance for mocking. - public static StreamingJobOutputData StreamingJobOutputData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, StreamingJobOutputDataSource datasource = null, TimeSpan? timeFrame = null, float? sizeWindow = null, StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, IEnumerable lastOutputEventTimestamps = null, StreamingJobOutputWatermarkProperties watermarkSettings = null) + public static StreamingJobOutputData StreamingJobOutputData(ResourceIdentifier id = null, string name = null, Core.ResourceType? resourceType = null, StreamingJobOutputDataSource datasource = null, TimeSpan? timeFrame = null, int? sizeWindow = null, StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, IEnumerable lastOutputEventTimestamps = null, StreamingJobOutputWatermarkProperties watermarkSettings = null) { diagnosticsConditions ??= new List(); lastOutputEventTimestamps ??= new List(); @@ -208,8 +211,9 @@ public static LastOutputEventTimestamp LastOutputEventTimestamp(DateTimeOffset? /// The systemData. /// The tags. /// The location. + /// Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. /// Describes the managed identity assigned to this job that can be used to authenticate with inputs and outputs. Current supported identity types: SystemAssigned, UserAssigned, SystemAssigned,UserAssigned. - /// Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. + /// Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. /// A GUID uniquely identifying the streaming job. This GUID is generated upon creation of the streaming job. /// Describes the provisioning status of the streaming job. /// Describes the state of the streaming job. @@ -233,8 +237,9 @@ public static LastOutputEventTimestamp LastOutputEventTimestamp(DateTimeOffset? /// Valid values are JobStorageAccount and SystemAccount. If set to JobStorageAccount, this requires the user to also specify jobStorageAccount property. . /// The storage account where the custom code artifacts are located. /// The cluster which streaming jobs will run on. + /// The subnet resource id that the user can link their streaming job to. /// A new instance for mocking. - public static StreamingJobData StreamingJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, StreamAnalyticsSkuName? skuName = null, Guid? jobId = null, string provisioningState = null, string jobState = null, StreamingJobType? jobType = null, StreamingJobOutputStartMode? outputStartMode = null, DateTimeOffset? outputStartOn = null, DateTimeOffset? lastOutputEventOn = null, EventsOutOfOrderPolicy? eventsOutOfOrderPolicy = null, StreamingJobOutputErrorPolicy? outputErrorPolicy = null, int? eventsOutOfOrderMaxDelayInSeconds = null, int? eventsLateArrivalMaxDelayInSeconds = null, AzureLocation? dataLocalion = null, StreamingJobCompatibilityLevel? compatibilityLevel = null, DateTimeOffset? createdOn = null, IEnumerable inputs = null, StreamingJobTransformationData transformation = null, IEnumerable outputs = null, IEnumerable functions = null, ETag? etag = null, StreamingJobStorageAccount jobStorageAccount = null, StreamingJobContentStoragePolicy? contentStoragePolicy = null, StreamingJobExternal externals = null, ResourceIdentifier clusterId = null) + public static StreamingJobData StreamingJobData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, StreamAnalyticsSku sku = null, ManagedServiceIdentity identity = null, StreamAnalyticsSku skuPropertiesSku = null, Guid? jobId = null, string provisioningState = null, string jobState = null, StreamingJobType? jobType = null, StreamingJobOutputStartMode? outputStartMode = null, DateTimeOffset? outputStartOn = null, DateTimeOffset? lastOutputEventOn = null, EventsOutOfOrderPolicy? eventsOutOfOrderPolicy = null, StreamingJobOutputErrorPolicy? outputErrorPolicy = null, int? eventsOutOfOrderMaxDelayInSeconds = null, int? eventsLateArrivalMaxDelayInSeconds = null, AzureLocation? dataLocalion = null, StreamingJobCompatibilityLevel? compatibilityLevel = null, DateTimeOffset? createdOn = null, IEnumerable inputs = null, StreamingJobTransformationData transformation = null, IEnumerable outputs = null, IEnumerable functions = null, ETag? etag = null, StreamingJobStorageAccount jobStorageAccount = null, StreamingJobContentStoragePolicy? contentStoragePolicy = null, StreamingJobExternal externals = null, ResourceIdentifier clusterId = null, string subnetResourceId = null) { tags ??= new Dictionary(); inputs ??= new List(); @@ -248,8 +253,9 @@ public static StreamingJobData StreamingJobData(ResourceIdentifier id = null, st systemData, tags, location, + sku, identity, - skuName != null ? new StreamAnalyticsSku(skuName, serializedAdditionalRawData: null) : null, + skuPropertiesSku, jobId, provisioningState, jobState, @@ -273,6 +279,7 @@ public static StreamingJobData StreamingJobData(ResourceIdentifier id = null, st contentStoragePolicy, externals, clusterId != null ? new ClusterInfo(clusterId, serializedAdditionalRawData: null) : null, + subnetResourceId, serializedAdditionalRawData: null); } @@ -285,7 +292,7 @@ public static StreamingJobData StreamingJobData(ResourceIdentifier id = null, st /// Specifies the query that will be run in the streaming job. You can learn more about the Stream Analytics Query Language (SAQL) here: https://msdn.microsoft.com/library/azure/dn834998 . Required on PUT (CreateOrReplace) requests. /// The current entity tag for the transformation. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// A new instance for mocking. - public static StreamingJobTransformationData StreamingJobTransformationData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, int? streamingUnits = null, IEnumerable validStreamingUnits = null, string query = null, ETag? etag = null) + public static StreamingJobTransformationData StreamingJobTransformationData(ResourceIdentifier id = null, string name = null, Core.ResourceType? resourceType = null, int? streamingUnits = null, IEnumerable validStreamingUnits = null, string query = null, ETag? etag = null) { validStreamingUnits ??= new List(); @@ -300,6 +307,36 @@ public static StreamingJobTransformationData StreamingJobTransformationData(Reso etag); } + /// Initializes a new instance of . + /// The type of resource the SKU applies to. + /// The properties that are associated with a SKU. + /// Describes scaling information of a SKU. + /// A new instance for mocking. + public static GetStreamingJobSkuResult GetStreamingJobSkuResult(ResourceType? resourceType = null, StreamAnalyticsSkuName? skuName = null, SkuCapacity capacity = null) + { + return new GetStreamingJobSkuResult(resourceType, skuName != null ? new GetStreamingJobSkuResultSku(skuName, serializedAdditionalRawData: null) : null, capacity, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Specifies the minimum streaming units that the streaming job can use. + /// Specifies the maximum streaming units that the streaming job can use. + /// Specifies the default streaming units that the streaming job can use. + /// The scale type applicable to the SKU. + /// Specifies the valid streaming units a streaming job can scale to. + /// A new instance for mocking. + public static SkuCapacity SkuCapacity(int? minimum = null, int? maximum = null, int? @default = null, SkuCapacityScaleType? scaleType = null, IEnumerable allowedValues = null) + { + allowedValues ??= new List(); + + return new SkuCapacity( + minimum, + maximum, + @default, + scaleType, + allowedValues?.ToList(), + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Resource Id. /// Resource name. @@ -307,7 +344,7 @@ public static StreamingJobTransformationData StreamingJobTransformationData(Reso /// The max permitted usage of this resource. /// The current usage of this resource. /// A new instance for mocking. - public static StreamAnalyticsSubscriptionQuota StreamAnalyticsSubscriptionQuota(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, int? maxCount = null, int? currentCount = null) + public static StreamAnalyticsSubscriptionQuota StreamAnalyticsSubscriptionQuota(ResourceIdentifier id = null, string name = null, Core.ResourceType? resourceType = null, int? maxCount = null, int? currentCount = null) { return new StreamAnalyticsSubscriptionQuota( id, @@ -473,7 +510,7 @@ public static StreamAnalyticsTestDatasourceResult StreamAnalyticsTestDatasourceR /// The current entity tag for the cluster. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// The properties associated with a Stream Analytics cluster. /// A new instance for mocking. - public static StreamAnalyticsClusterData StreamAnalyticsClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, StreamAnalyticsClusterSku sku = null, ETag? etag = null, StreamAnalyticsClusterProperties properties = null) + public static StreamAnalyticsClusterData StreamAnalyticsClusterData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, StreamAnalyticsClusterSku sku = null, ETag? etag = null, StreamAnalyticsClusterProperties properties = null) { tags ??= new Dictionary(); @@ -526,7 +563,7 @@ public static StreamAnalyticsClusterJob StreamAnalyticsClusterJob(ResourceIdenti /// The properties associated with a private endpoint. /// Unique opaque string (generally a GUID) that represents the metadata state of the resource (private endpoint) and changes whenever the resource is updated. Required on PUT (CreateOrUpdate) requests. /// A new instance for mocking. - public static StreamAnalyticsPrivateEndpointData StreamAnalyticsPrivateEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, StreamAnalyticsPrivateEndpointProperties properties = null, ETag? etag = null) + public static StreamAnalyticsPrivateEndpointData StreamAnalyticsPrivateEndpointData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, StreamAnalyticsPrivateEndpointProperties properties = null, ETag? etag = null) { return new StreamAnalyticsPrivateEndpointData( id, @@ -622,20 +659,21 @@ public static AggregateFunctionProperties AggregateFunctionProperties(ETag? etag /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// Describes how input data is compressed. /// partitionKey Describes a key in the input data which is used for partitioning the input data. /// Settings which determine whether to read watermark events. + /// Messaging catalog configuration. /// /// Describes an input data source that contains stream data. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , and . /// /// A new instance for mocking. - public static StreamInputProperties StreamInputProperties(StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, StreamingCompressionType? compressionType = null, string partitionKey = null, StreamingJobInputWatermarkMode? watermarkMode = null, StreamInputDataSource datasource = null) + public static StreamInputProperties StreamInputProperties(StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, StreamingCompressionType? compressionType = null, string partitionKey = null, StreamingJobInputWatermarkMode? watermarkMode = null, string messagingCatalogConfiguration = null, StreamInputDataSource datasource = null) { diagnosticsConditions ??= new List(); @@ -647,6 +685,7 @@ public static StreamInputProperties StreamInputProperties(StreamAnalyticsDataSer compressionType.HasValue ? new StreamingCompression(compressionType.Value, serializedAdditionalRawData: null) : null, partitionKey, watermarkMode != null ? new StreamingJobInputWatermarkProperties(watermarkMode, serializedAdditionalRawData: null) : null, + messagingCatalogConfiguration, serializedAdditionalRawData: null, datasource); } @@ -655,20 +694,21 @@ public static StreamInputProperties StreamInputProperties(StreamAnalyticsDataSer /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// Describes how input data is compressed. /// partitionKey Describes a key in the input data which is used for partitioning the input data. /// Settings which determine whether to read watermark events. + /// Messaging catalog configuration. /// /// Describes an input data source that contains reference data. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// A new instance for mocking. - public static ReferenceInputProperties ReferenceInputProperties(StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, StreamingCompressionType? compressionType = null, string partitionKey = null, StreamingJobInputWatermarkMode? watermarkMode = null, ReferenceInputDataSource datasource = null) + public static ReferenceInputProperties ReferenceInputProperties(StreamAnalyticsDataSerialization serialization = null, IEnumerable diagnosticsConditions = null, ETag? etag = null, StreamingCompressionType? compressionType = null, string partitionKey = null, StreamingJobInputWatermarkMode? watermarkMode = null, string messagingCatalogConfiguration = null, ReferenceInputDataSource datasource = null) { diagnosticsConditions ??= new List(); @@ -680,8 +720,74 @@ public static ReferenceInputProperties ReferenceInputProperties(StreamAnalyticsD compressionType.HasValue ? new StreamingCompression(compressionType.Value, serializedAdditionalRawData: null) : null, partitionKey, watermarkMode != null ? new StreamingJobInputWatermarkProperties(watermarkMode, serializedAdditionalRawData: null) : null, + messagingCatalogConfiguration, serializedAdditionalRawData: null, datasource); } + + /// Initializes a new instance of . + /// Indicates whether the input is a source of reference data or stream data. Required on PUT (CreateOrReplace) requests. + /// + /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. + /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. + /// Describes how input data is compressed. + /// partitionKey Describes a key in the input data which is used for partitioning the input data. + /// Settings which determine whether to read watermark events. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static StreamingJobInputProperties StreamingJobInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, IEnumerable diagnosticsConditions, ETag? etag, StreamingCompressionType? compressionType, string partitionKey, StreamingJobInputWatermarkMode? watermarkMode) + { + return StreamingJobInputProperties(inputPropertiesType: inputPropertiesType, serialization: serialization, diagnosticsConditions: diagnosticsConditions, etag: etag, compressionType: compressionType, partitionKey: partitionKey, watermarkMode: watermarkMode, messagingCatalogConfiguration: default); + } + + /// Initializes a new instance of . + /// + /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. + /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. + /// Describes how input data is compressed. + /// partitionKey Describes a key in the input data which is used for partitioning the input data. + /// Settings which determine whether to read watermark events. + /// + /// Describes an input data source that contains stream data. Required on PUT (CreateOrReplace) requests. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static StreamInputProperties StreamInputProperties(StreamAnalyticsDataSerialization serialization, IEnumerable diagnosticsConditions, ETag? etag, StreamingCompressionType? compressionType, string partitionKey, StreamingJobInputWatermarkMode? watermarkMode, StreamInputDataSource datasource) + { + return StreamInputProperties(serialization: serialization, diagnosticsConditions: diagnosticsConditions, etag: etag, compressionType: compressionType, partitionKey: partitionKey, watermarkMode: watermarkMode, messagingCatalogConfiguration: default, datasource: datasource); + } + + /// Initializes a new instance of . + /// + /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. + /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. + /// Describes how input data is compressed. + /// partitionKey Describes a key in the input data which is used for partitioning the input data. + /// Settings which determine whether to read watermark events. + /// + /// Describes an input data source that contains reference data. Required on PUT (CreateOrReplace) requests. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ReferenceInputProperties ReferenceInputProperties(StreamAnalyticsDataSerialization serialization, IEnumerable diagnosticsConditions, ETag? etag, StreamingCompressionType? compressionType, string partitionKey, StreamingJobInputWatermarkMode? watermarkMode, ReferenceInputDataSource datasource) + { + return ReferenceInputProperties(serialization: serialization, diagnosticsConditions: diagnosticsConditions, etag: etag, compressionType: compressionType, partitionKey: partitionKey, watermarkMode: watermarkMode, messagingCatalogConfiguration: default, datasource: datasource); + } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/MockableStreamAnalyticsSubscriptionResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/MockableStreamAnalyticsSubscriptionResource.cs index b29a23a3009f..5d1c78651e29 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/MockableStreamAnalyticsSubscriptionResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Extensions/MockableStreamAnalyticsSubscriptionResource.cs @@ -44,7 +44,7 @@ internal MockableStreamAnalyticsSubscriptionResource(ArmClient client, ResourceI private ClientDiagnostics StreamAnalyticsClusterClustersClientDiagnostics => _streamAnalyticsClusterClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.StreamAnalytics", StreamAnalyticsClusterResource.ResourceType.Namespace, Diagnostics); private ClustersRestOperations StreamAnalyticsClusterClustersRestClient => _streamAnalyticsClusterClustersRestClient ??= new ClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(StreamAnalyticsClusterResource.ResourceType)); - private string GetApiVersionOrNull(ResourceType resourceType) + private string GetApiVersionOrNull(Core.ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); return apiVersion; diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.Serialization.cs new file mode 100644 index 000000000000..93240cd7d31c --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + public partial class AzureDataExplorerOutputDataSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureDataExplorerOutputDataSource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(OutputDataSourceType); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Cluster)) + { + writer.WritePropertyName("cluster"u8); + writer.WriteStringValue(Cluster); + } + if (Optional.IsDefined(Database)) + { + writer.WritePropertyName("database"u8); + writer.WriteStringValue(Database); + } + if (Optional.IsDefined(Table)) + { + writer.WritePropertyName("table"u8); + writer.WriteStringValue(Table); + } + if (Optional.IsDefined(AuthenticationMode)) + { + writer.WritePropertyName("authenticationMode"u8); + writer.WriteStringValue(AuthenticationMode.Value.ToString()); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureDataExplorerOutputDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureDataExplorerOutputDataSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureDataExplorerOutputDataSource(document.RootElement, options); + } + + internal static AzureDataExplorerOutputDataSource DeserializeAzureDataExplorerOutputDataSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + string cluster = default; + string database = default; + string table = default; + StreamAnalyticsAuthenticationMode? authenticationMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("cluster"u8)) + { + cluster = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("database"u8)) + { + database = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("table"u8)) + { + table = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("authenticationMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authenticationMode = new StreamAnalyticsAuthenticationMode(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureDataExplorerOutputDataSource( + type, + serializedAdditionalRawData, + cluster, + database, + table, + authenticationMode); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureDataExplorerOutputDataSource)} does not support writing '{options.Format}' format."); + } + } + + AzureDataExplorerOutputDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureDataExplorerOutputDataSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureDataExplorerOutputDataSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.cs new file mode 100644 index 000000000000..25608ba2edbe --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/AzureDataExplorerOutputDataSource.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// Describes an Azure Data Explorer output data source. + public partial class AzureDataExplorerOutputDataSource : StreamingJobOutputDataSource + { + /// Initializes a new instance of . + public AzureDataExplorerOutputDataSource() + { + OutputDataSourceType = "Microsoft.Kusto/clusters/databases"; + } + + /// Initializes a new instance of . + /// Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. + /// Keeps track of any properties unknown to the library. + /// The name of the Azure Data Explorer cluster. Required on PUT (CreateOrReplace) requests. + /// The name of the Azure Data Explorer database. Required on PUT (CreateOrReplace) requests. + /// The name of the Azure Table. Required on PUT (CreateOrReplace) requests. + /// Authentication Mode. + internal AzureDataExplorerOutputDataSource(string outputDataSourceType, IDictionary serializedAdditionalRawData, string cluster, string database, string table, StreamAnalyticsAuthenticationMode? authenticationMode) : base(outputDataSourceType, serializedAdditionalRawData) + { + Cluster = cluster; + Database = database; + Table = table; + AuthenticationMode = authenticationMode; + OutputDataSourceType = outputDataSourceType ?? "Microsoft.Kusto/clusters/databases"; + } + + /// The name of the Azure Data Explorer cluster. Required on PUT (CreateOrReplace) requests. + public string Cluster { get; set; } + /// The name of the Azure Data Explorer database. Required on PUT (CreateOrReplace) requests. + public string Database { get; set; } + /// The name of the Azure Table. Required on PUT (CreateOrReplace) requests. + public string Table { get; set; } + /// Authentication Mode. + public StreamAnalyticsAuthenticationMode? AuthenticationMode { get; set; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DataRefreshType.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DataRefreshType.cs index ef84a2891415..d80663c8ef4c 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DataRefreshType.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DataRefreshType.cs @@ -25,8 +25,6 @@ public DataRefreshType(string value) private const string StaticValue = "Static"; private const string RefreshPeriodicallyWithFullValue = "RefreshPeriodicallyWithFull"; private const string RefreshPeriodicallyWithDeltaValue = "RefreshPeriodicallyWithDelta"; - private const string BlockingValue = "Blocking"; - private const string NonblockingValue = "Nonblocking"; /// Static. public static DataRefreshType Static { get; } = new DataRefreshType(StaticValue); @@ -34,10 +32,6 @@ public DataRefreshType(string value) public static DataRefreshType RefreshPeriodicallyWithFull { get; } = new DataRefreshType(RefreshPeriodicallyWithFullValue); /// RefreshPeriodicallyWithDelta. public static DataRefreshType RefreshPeriodicallyWithDelta { get; } = new DataRefreshType(RefreshPeriodicallyWithDeltaValue); - /// Blocking. - public static DataRefreshType Blocking { get; } = new DataRefreshType(BlockingValue); - /// Nonblocking. - public static DataRefreshType Nonblocking { get; } = new DataRefreshType(NonblockingValue); /// Determines if two values are the same. public static bool operator ==(DataRefreshType left, DataRefreshType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.Serialization.cs new file mode 100644 index 000000000000..420ef930a25a --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + public partial class DeltaSerialization : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaSerialization)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EventSerializationType.ToString()); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(DeltaTablePath)) + { + writer.WritePropertyName("deltaTablePath"u8); + writer.WriteStringValue(DeltaTablePath); + } + if (Optional.IsCollectionDefined(PartitionColumns)) + { + writer.WritePropertyName("partitionColumns"u8); + writer.WriteStartArray(); + foreach (var item in PartitionColumns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeltaSerialization IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeltaSerialization)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeltaSerialization(document.RootElement, options); + } + + internal static DeltaSerialization DeserializeDeltaSerialization(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EventSerializationType type = default; + string deltaTablePath = default; + IList partitionColumns = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new EventSerializationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("deltaTablePath"u8)) + { + deltaTablePath = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("partitionColumns"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + partitionColumns = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeltaSerialization(type, serializedAdditionalRawData, deltaTablePath, partitionColumns ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeltaSerialization)} does not support writing '{options.Format}' format."); + } + } + + DeltaSerialization IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeltaSerialization(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeltaSerialization)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.cs new file mode 100644 index 000000000000..399104ca049b --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/DeltaSerialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// Describes how data from an input is serialized or how data is serialized when written to an output in Delta Lake format. + public partial class DeltaSerialization : StreamAnalyticsDataSerialization + { + /// Initializes a new instance of . + public DeltaSerialization() + { + PartitionColumns = new ChangeTrackingList(); + EventSerializationType = EventSerializationType.Delta; + } + + /// Initializes a new instance of . + /// Indicates the type of serialization that the input or output uses. Required on PUT (CreateOrReplace) requests. + /// Keeps track of any properties unknown to the library. + /// Specifies the path of the Delta Lake table that the output will be written to. + /// Specifies the names of the columns for which the Delta Lake table will be partitioned. We are only supporting 1 partition column, but keeping it as an array for extensibility. + internal DeltaSerialization(EventSerializationType eventSerializationType, IDictionary serializedAdditionalRawData, string deltaTablePath, IList partitionColumns) : base(eventSerializationType, serializedAdditionalRawData) + { + DeltaTablePath = deltaTablePath; + PartitionColumns = partitionColumns; + EventSerializationType = eventSerializationType; + } + + /// Specifies the path of the Delta Lake table that the output will be written to. + public string DeltaTablePath { get; set; } + /// Specifies the names of the columns for which the Delta Lake table will be partitioned. We are only supporting 1 partition column, but keeping it as an array for extensibility. + public IList PartitionColumns { get; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/EventSerializationType.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/EventSerializationType.cs index 10ed0f610094..182155321caa 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/EventSerializationType.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/EventSerializationType.cs @@ -27,6 +27,7 @@ public EventSerializationType(string value) private const string JsonValue = "Json"; private const string CustomClrValue = "CustomClr"; private const string ParquetValue = "Parquet"; + private const string DeltaValue = "Delta"; /// Csv. public static EventSerializationType Csv { get; } = new EventSerializationType(CsvValue); @@ -38,6 +39,8 @@ public EventSerializationType(string value) public static EventSerializationType CustomClr { get; } = new EventSerializationType(CustomClrValue); /// Parquet. public static EventSerializationType Parquet { get; } = new EventSerializationType(ParquetValue); + /// Delta. + public static EventSerializationType Delta { get; } = new EventSerializationType(DeltaValue); /// Determines if two values are the same. public static bool operator ==(EventSerializationType left, EventSerializationType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.Serialization.cs new file mode 100644 index 000000000000..40688ffd3f22 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + public partial class FileReferenceInputDataSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileReferenceInputDataSource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ReferenceInputDataSourceType); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FileReferenceInputDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileReferenceInputDataSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileReferenceInputDataSource(document.RootElement, options); + } + + internal static FileReferenceInputDataSource DeserializeFileReferenceInputDataSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + string path = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("path"u8)) + { + path = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FileReferenceInputDataSource(type, serializedAdditionalRawData, path); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FileReferenceInputDataSource)} does not support writing '{options.Format}' format."); + } + } + + FileReferenceInputDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFileReferenceInputDataSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileReferenceInputDataSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.cs new file mode 100644 index 000000000000..25a3e19e2dbd --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/FileReferenceInputDataSource.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// Describes a file input data source that contains reference data. + public partial class FileReferenceInputDataSource : ReferenceInputDataSource + { + /// Initializes a new instance of . + public FileReferenceInputDataSource() + { + ReferenceInputDataSourceType = "File"; + } + + /// Initializes a new instance of . + /// Indicates the type of input data source containing reference data. Required on PUT (CreateOrReplace) requests. + /// Keeps track of any properties unknown to the library. + /// The path of the file. + internal FileReferenceInputDataSource(string referenceInputDataSourceType, IDictionary serializedAdditionalRawData, string path) : base(referenceInputDataSourceType, serializedAdditionalRawData) + { + Path = path; + ReferenceInputDataSourceType = referenceInputDataSourceType ?? "File"; + } + + /// The path of the file. + public string Path { get; set; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.Serialization.cs new file mode 100644 index 000000000000..7c59f3ddf717 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + public partial class GetStreamingJobSkuResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetStreamingJobSkuResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (options.Format != "W" && Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteObjectValue(Capacity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetStreamingJobSkuResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetStreamingJobSkuResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetStreamingJobSkuResult(document.RootElement, options); + } + + internal static GetStreamingJobSkuResult DeserializeGetStreamingJobSkuResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType? resourceType = default; + GetStreamingJobSkuResultSku sku = default; + SkuCapacity capacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = GetStreamingJobSkuResultSku.DeserializeGetStreamingJobSkuResultSku(property.Value, options); + continue; + } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = SkuCapacity.DeserializeSkuCapacity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetStreamingJobSkuResult(resourceType, sku, capacity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetStreamingJobSkuResult)} does not support writing '{options.Format}' format."); + } + } + + GetStreamingJobSkuResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetStreamingJobSkuResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetStreamingJobSkuResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.cs new file mode 100644 index 000000000000..db6120f8c905 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResult.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// Describes an available SKU information. + public partial class GetStreamingJobSkuResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal GetStreamingJobSkuResult() + { + } + + /// Initializes a new instance of . + /// The type of resource the SKU applies to. + /// The properties that are associated with a SKU. + /// Describes scaling information of a SKU. + /// Keeps track of any properties unknown to the library. + internal GetStreamingJobSkuResult(ResourceType? resourceType, GetStreamingJobSkuResultSku sku, SkuCapacity capacity, IDictionary serializedAdditionalRawData) + { + ResourceType = resourceType; + Sku = sku; + Capacity = capacity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of resource the SKU applies to. + public ResourceType? ResourceType { get; } + /// The properties that are associated with a SKU. + internal GetStreamingJobSkuResultSku Sku { get; } + /// The name of the SKU. + public StreamAnalyticsSkuName? SkuName + { + get => Sku?.Name; + } + + /// Describes scaling information of a SKU. + public SkuCapacity Capacity { get; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.Serialization.cs new file mode 100644 index 000000000000..207af18f6529 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + internal partial class GetStreamingJobSkuResultSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetStreamingJobSkuResultSku)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetStreamingJobSkuResultSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetStreamingJobSkuResultSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetStreamingJobSkuResultSku(document.RootElement, options); + } + + internal static GetStreamingJobSkuResultSku DeserializeGetStreamingJobSkuResultSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + StreamAnalyticsSkuName? name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new StreamAnalyticsSkuName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetStreamingJobSkuResultSku(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetStreamingJobSkuResultSku)} does not support writing '{options.Format}' format."); + } + } + + GetStreamingJobSkuResultSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetStreamingJobSkuResultSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetStreamingJobSkuResultSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.cs new file mode 100644 index 000000000000..e24c40c4d73c --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResultSku.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// The properties that are associated with a SKU. + internal partial class GetStreamingJobSkuResultSku + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal GetStreamingJobSkuResultSku() + { + } + + /// Initializes a new instance of . + /// The name of the SKU. + /// Keeps track of any properties unknown to the library. + internal GetStreamingJobSkuResultSku(StreamAnalyticsSkuName? name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the SKU. + public StreamAnalyticsSkuName? Name { get; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.Serialization.cs new file mode 100644 index 000000000000..3e418017017f --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + internal partial class GetStreamingJobSkuResults : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetStreamingJobSkuResults)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GetStreamingJobSkuResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GetStreamingJobSkuResults)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGetStreamingJobSkuResults(document.RootElement, options); + } + + internal static GetStreamingJobSkuResults DeserializeGetStreamingJobSkuResults(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GetStreamingJobSkuResult.DeserializeGetStreamingJobSkuResult(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GetStreamingJobSkuResults(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GetStreamingJobSkuResults)} does not support writing '{options.Format}' format."); + } + } + + GetStreamingJobSkuResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGetStreamingJobSkuResults(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GetStreamingJobSkuResults)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.cs new file mode 100644 index 000000000000..916bfee860c4 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/GetStreamingJobSkuResults.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// Result of the request to get streaming job SKUs. + internal partial class GetStreamingJobSkuResults + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal GetStreamingJobSkuResults() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of available SKUs that the streaming job can use. + /// The link (url) to the next page of results. + /// Keeps track of any properties unknown to the library. + internal GetStreamingJobSkuResults(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of available SKUs that the streaming job can use. + public IReadOnlyList Value { get; } + /// The link (url) to the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.Serialization.cs index 6454a82b7d11..323648661235 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.Serialization.cs @@ -70,6 +70,7 @@ internal static ReferenceInputDataSource DeserializeReferenceInputDataSource(Jso { switch (discriminator.GetString()) { + case "File": return FileReferenceInputDataSource.DeserializeFileReferenceInputDataSource(element, options); case "Microsoft.Sql/Server/Database": return SqlReferenceInputDataSource.DeserializeSqlReferenceInputDataSource(element, options); case "Microsoft.Storage/Blob": return BlobReferenceInputDataSource.DeserializeBlobReferenceInputDataSource(element, options); case "Raw": return RawReferenceInputDataSource.DeserializeRawReferenceInputDataSource(element, options); diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs index b3894341b59b..4850f4d47ab3 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.StreamAnalytics.Models /// /// Describes an input data source that contains reference data. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// public abstract partial class ReferenceInputDataSource { diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.Serialization.cs index 863741a309c9..e06521002711 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.Serialization.cs @@ -63,6 +63,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("watermarkSettings"u8); writer.WriteObjectValue(WatermarkSettings, options); } + if (Optional.IsDefined(MessagingCatalogConfiguration)) + { + writer.WritePropertyName("messagingCatalogConfiguration"u8); + writer.WriteStringValue(MessagingCatalogConfiguration); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -109,6 +114,7 @@ internal static ReferenceInputProperties DeserializeReferenceInputProperties(Jso StreamingCompression compression = default; string partitionKey = default; StreamingJobInputWatermarkProperties watermarkSettings = default; + string messagingCatalogConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -177,6 +183,11 @@ internal static ReferenceInputProperties DeserializeReferenceInputProperties(Jso watermarkSettings = StreamingJobInputWatermarkProperties.DeserializeStreamingJobInputWatermarkProperties(property.Value, options); continue; } + if (property.NameEquals("messagingCatalogConfiguration"u8)) + { + messagingCatalogConfiguration = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -191,6 +202,7 @@ internal static ReferenceInputProperties DeserializeReferenceInputProperties(Jso compression, partitionKey, watermarkSettings, + messagingCatalogConfiguration, serializedAdditionalRawData, datasource); } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.cs index bb91042d5bee..9fd9b98c8dca 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReferenceInputProperties.cs @@ -24,20 +24,21 @@ public ReferenceInputProperties() /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// Describes how input data is compressed. /// partitionKey Describes a key in the input data which is used for partitioning the input data. /// Settings which determine whether to read watermark events. + /// Messaging catalog configuration. /// Keeps track of any properties unknown to the library. /// /// Describes an input data source that contains reference data. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// - internal ReferenceInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, IDictionary serializedAdditionalRawData, ReferenceInputDataSource datasource) : base(inputPropertiesType, serialization, diagnostics, etag, compression, partitionKey, watermarkSettings, serializedAdditionalRawData) + internal ReferenceInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, string messagingCatalogConfiguration, IDictionary serializedAdditionalRawData, ReferenceInputDataSource datasource) : base(inputPropertiesType, serialization, diagnostics, etag, compression, partitionKey, watermarkSettings, messagingCatalogConfiguration, serializedAdditionalRawData) { Datasource = datasource; InputPropertiesType = inputPropertiesType ?? "Reference"; @@ -46,7 +47,7 @@ internal ReferenceInputProperties(string inputPropertiesType, StreamAnalyticsDat /// /// Describes an input data source that contains reference data. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// public ReferenceInputDataSource Datasource { get; set; } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.Serialization.cs new file mode 100644 index 000000000000..22dbaf3c267b --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + public partial class ReflexOutputDataSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReflexOutputDataSource)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(OutputDataSourceType); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(RefreshToken)) + { + writer.WritePropertyName("refreshToken"u8); + writer.WriteStringValue(RefreshToken); + } + if (Optional.IsDefined(TokenUserPrincipalName)) + { + writer.WritePropertyName("tokenUserPrincipalName"u8); + writer.WriteStringValue(TokenUserPrincipalName); + } + if (Optional.IsDefined(TokenUserDisplayName)) + { + writer.WritePropertyName("tokenUserDisplayName"u8); + writer.WriteStringValue(TokenUserDisplayName); + } + if (Optional.IsDefined(AegSubscriptionName)) + { + writer.WritePropertyName("AegSubscriptionName"u8); + writer.WriteStringValue(AegSubscriptionName); + } + if (Optional.IsDefined(FabricEsName)) + { + writer.WritePropertyName("FabricEsName"u8); + writer.WriteStringValue(FabricEsName); + } + if (Optional.IsDefined(WebhookUri)) + { + writer.WritePropertyName("WebhookUrl"u8); + writer.WriteStringValue(WebhookUri.AbsoluteUri); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReflexOutputDataSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReflexOutputDataSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReflexOutputDataSource(document.RootElement, options); + } + + internal static ReflexOutputDataSource DeserializeReflexOutputDataSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + string refreshToken = default; + string tokenUserPrincipalName = default; + string tokenUserDisplayName = default; + string aegSubscriptionName = default; + string fabricEsName = default; + Uri webhookUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("refreshToken"u8)) + { + refreshToken = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("tokenUserPrincipalName"u8)) + { + tokenUserPrincipalName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("tokenUserDisplayName"u8)) + { + tokenUserDisplayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("AegSubscriptionName"u8)) + { + aegSubscriptionName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("FabricEsName"u8)) + { + fabricEsName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("WebhookUrl"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + webhookUrl = new Uri(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReflexOutputDataSource( + type, + serializedAdditionalRawData, + refreshToken, + tokenUserPrincipalName, + tokenUserDisplayName, + aegSubscriptionName, + fabricEsName, + webhookUrl); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReflexOutputDataSource)} does not support writing '{options.Format}' format."); + } + } + + ReflexOutputDataSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReflexOutputDataSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReflexOutputDataSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.cs new file mode 100644 index 000000000000..7aa1dc707525 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ReflexOutputDataSource.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// Describes a Reflex output data source. + public partial class ReflexOutputDataSource : StreamingJobOutputDataSource + { + /// Initializes a new instance of . + public ReflexOutputDataSource() + { + OutputDataSourceType = "Reflex"; + } + + /// Initializes a new instance of . + /// Indicates the type of data source output will be written to. Required on PUT (CreateOrReplace) requests. + /// Keeps track of any properties unknown to the library. + /// A refresh token that can be used to obtain a valid access token that can then be used to authenticate with the data source. A valid refresh token is currently only obtainable via the Azure Portal. It is recommended to put a dummy string value here when creating the data source and then going to the Azure Portal to authenticate the data source which will update this property with a valid refresh token. Required on PUT (CreateOrReplace) requests. + /// The user principal name (UPN) of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token. + /// The user display name of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token. + /// Unique ASA query ID. For EventGrid it's an unique subscription name, set internally by EventGrid on subscription creation. + /// Public EG populates aeg-subscription-name with the subscription name set by the subscription creator. This header was added, because Fabric EG didn't populate aeg-subscription-name with our set value, but EG internal value. The EG subscription name set by us during creation gets populated to fabris-es-name. There is no additional validation to ensure the existence of the subscription, so both aeg-subscription-name and fabris-es-name can be set to any ID that best represents the ASA query subscription. + /// Webhook URL Format: https://{RegionCode}.data.activator.pipe.{WebhookEnvironment}.aria.trafficmanager.net/api/v2/OneRiv er/PushEvents/{tenantId}/{sourceType}/{eventName}. + internal ReflexOutputDataSource(string outputDataSourceType, IDictionary serializedAdditionalRawData, string refreshToken, string tokenUserPrincipalName, string tokenUserDisplayName, string aegSubscriptionName, string fabricEsName, Uri webhookUri) : base(outputDataSourceType, serializedAdditionalRawData) + { + RefreshToken = refreshToken; + TokenUserPrincipalName = tokenUserPrincipalName; + TokenUserDisplayName = tokenUserDisplayName; + AegSubscriptionName = aegSubscriptionName; + FabricEsName = fabricEsName; + WebhookUri = webhookUri; + OutputDataSourceType = outputDataSourceType ?? "Reflex"; + } + + /// A refresh token that can be used to obtain a valid access token that can then be used to authenticate with the data source. A valid refresh token is currently only obtainable via the Azure Portal. It is recommended to put a dummy string value here when creating the data source and then going to the Azure Portal to authenticate the data source which will update this property with a valid refresh token. Required on PUT (CreateOrReplace) requests. + public string RefreshToken { get; set; } + /// The user principal name (UPN) of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token. + public string TokenUserPrincipalName { get; set; } + /// The user display name of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token. + public string TokenUserDisplayName { get; set; } + /// Unique ASA query ID. For EventGrid it's an unique subscription name, set internally by EventGrid on subscription creation. + public string AegSubscriptionName { get; set; } + /// Public EG populates aeg-subscription-name with the subscription name set by the subscription creator. This header was added, because Fabric EG didn't populate aeg-subscription-name with our set value, but EG internal value. The EG subscription name set by us during creation gets populated to fabris-es-name. There is no additional validation to ensure the existence of the subscription, so both aeg-subscription-name and fabris-es-name can be set to any ID that best represents the ASA query subscription. + public string FabricEsName { get; set; } + /// Webhook URL Format: https://{RegionCode}.data.activator.pipe.{WebhookEnvironment}.aria.trafficmanager.net/api/v2/OneRiv er/PushEvents/{tenantId}/{sourceType}/{eventName}. + public Uri WebhookUri { get; set; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ResourceType.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ResourceType.cs new file mode 100644 index 000000000000..7d8d8c7b360a --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/ResourceType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// The type of resource the SKU applies to. + public readonly partial struct ResourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MicrosoftStreamAnalyticsStreamingjobsValue = "Microsoft.StreamAnalytics/streamingjobs"; + + /// Microsoft.StreamAnalytics/streamingjobs. + public static ResourceType MicrosoftStreamAnalyticsStreamingjobs { get; } = new ResourceType(MicrosoftStreamAnalyticsStreamingjobsValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceType left, ResourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceType left, ResourceType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ResourceType(string value) => new ResourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceType other && Equals(other); + /// + public bool Equals(ResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.Serialization.cs new file mode 100644 index 000000000000..87339e02bdfa --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.Serialization.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + public partial class SkuCapacity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkuCapacity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Minimum)) + { + writer.WritePropertyName("minimum"u8); + writer.WriteNumberValue(Minimum.Value); + } + if (options.Format != "W" && Optional.IsDefined(Maximum)) + { + writer.WritePropertyName("maximum"u8); + writer.WriteNumberValue(Maximum.Value); + } + if (options.Format != "W" && Optional.IsDefined(Default)) + { + writer.WritePropertyName("default"u8); + writer.WriteNumberValue(Default.Value); + } + if (options.Format != "W" && Optional.IsDefined(ScaleType)) + { + writer.WritePropertyName("scaleType"u8); + writer.WriteStringValue(ScaleType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AllowedValues)) + { + writer.WritePropertyName("allowedValues"u8); + writer.WriteStartArray(); + foreach (var item in AllowedValues) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SkuCapacity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkuCapacity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkuCapacity(document.RootElement, options); + } + + internal static SkuCapacity DeserializeSkuCapacity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minimum = default; + int? maximum = default; + int? @default = default; + SkuCapacityScaleType? scaleType = default; + IReadOnlyList allowedValues = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minimum"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimum = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximum"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximum = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("default"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @default = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("scaleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scaleType = new SkuCapacityScaleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("allowedValues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + allowedValues = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkuCapacity( + minimum, + maximum, + @default, + scaleType, + allowedValues ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SkuCapacity)} does not support writing '{options.Format}' format."); + } + } + + SkuCapacity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSkuCapacity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkuCapacity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.cs new file mode 100644 index 000000000000..109ed0fdb22f --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacity.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// Describes scaling information of a SKU. + public partial class SkuCapacity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SkuCapacity() + { + AllowedValues = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Specifies the minimum streaming units that the streaming job can use. + /// Specifies the maximum streaming units that the streaming job can use. + /// Specifies the default streaming units that the streaming job can use. + /// The scale type applicable to the SKU. + /// Specifies the valid streaming units a streaming job can scale to. + /// Keeps track of any properties unknown to the library. + internal SkuCapacity(int? minimum, int? maximum, int? @default, SkuCapacityScaleType? scaleType, IReadOnlyList allowedValues, IDictionary serializedAdditionalRawData) + { + Minimum = minimum; + Maximum = maximum; + Default = @default; + ScaleType = scaleType; + AllowedValues = allowedValues; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the minimum streaming units that the streaming job can use. + public int? Minimum { get; } + /// Specifies the maximum streaming units that the streaming job can use. + public int? Maximum { get; } + /// Specifies the default streaming units that the streaming job can use. + public int? Default { get; } + /// The scale type applicable to the SKU. + public SkuCapacityScaleType? ScaleType { get; } + /// Specifies the valid streaming units a streaming job can scale to. + public IReadOnlyList AllowedValues { get; } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacityScaleType.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacityScaleType.cs new file mode 100644 index 000000000000..104ec6de6db4 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/SkuCapacityScaleType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// The scale type applicable to the SKU. + public readonly partial struct SkuCapacityScaleType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SkuCapacityScaleType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "automatic"; + private const string ManualValue = "manual"; + private const string NoneValue = "none"; + + /// Supported scale type automatic. + public static SkuCapacityScaleType Automatic { get; } = new SkuCapacityScaleType(AutomaticValue); + /// Supported scale type manual. + public static SkuCapacityScaleType Manual { get; } = new SkuCapacityScaleType(ManualValue); + /// Scaling not supported. + public static SkuCapacityScaleType None { get; } = new SkuCapacityScaleType(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(SkuCapacityScaleType left, SkuCapacityScaleType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SkuCapacityScaleType left, SkuCapacityScaleType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SkuCapacityScaleType(string value) => new SkuCapacityScaleType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SkuCapacityScaleType other && Equals(other); + /// + public bool Equals(SkuCapacityScaleType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.Serialization.cs index f7d095ca72c8..3b56a7d995be 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.Serialization.cs @@ -73,6 +73,7 @@ internal static StreamAnalyticsDataSerialization DeserializeStreamAnalyticsDataS case "Avro": return AvroFormatSerialization.DeserializeAvroFormatSerialization(element, options); case "Csv": return CsvFormatSerialization.DeserializeCsvFormatSerialization(element, options); case "CustomClr": return CustomClrFormatSerialization.DeserializeCustomClrFormatSerialization(element, options); + case "Delta": return DeltaSerialization.DeserializeDeltaSerialization(element, options); case "Json": return JsonFormatSerialization.DeserializeJsonFormatSerialization(element, options); case "Parquet": return ParquetFormatSerialization.DeserializeParquetFormatSerialization(element, options); } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.cs index fa5e17b53e39..f89213fd5fc5 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsDataSerialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.StreamAnalytics.Models /// /// Describes how data from an input is serialized or how data is serialized when written to an output. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// public abstract partial class StreamAnalyticsDataSerialization { diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.Serialization.cs index 73b5f24c7263..3e2e6a98ed1d 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.StreamAnalytics.Models { - internal partial class StreamAnalyticsSku : IUtf8JsonSerializable, IJsonModel + public partial class StreamAnalyticsSku : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -31,6 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name.Value.ToString()); } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -70,6 +75,7 @@ internal static StreamAnalyticsSku DeserializeStreamAnalyticsSku(JsonElement ele return null; } StreamAnalyticsSkuName? name = default; + int? capacity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -83,13 +89,22 @@ internal static StreamAnalyticsSku DeserializeStreamAnalyticsSku(JsonElement ele name = new StreamAnalyticsSkuName(property.Value.GetString()); continue; } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new StreamAnalyticsSku(name, serializedAdditionalRawData); + return new StreamAnalyticsSku(name, capacity, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.cs index 182761b1a708..f4108528c2d8 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSku.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.StreamAnalytics.Models { /// The properties that are associated with a SKU. - internal partial class StreamAnalyticsSku + public partial class StreamAnalyticsSku { /// /// Keeps track of any properties unknown to the library. @@ -52,14 +52,18 @@ public StreamAnalyticsSku() /// Initializes a new instance of . /// The name of the SKU. Required on PUT (CreateOrReplace) requests. + /// The capacity of the SKU. /// Keeps track of any properties unknown to the library. - internal StreamAnalyticsSku(StreamAnalyticsSkuName? name, IDictionary serializedAdditionalRawData) + internal StreamAnalyticsSku(StreamAnalyticsSkuName? name, int? capacity, IDictionary serializedAdditionalRawData) { Name = name; + Capacity = capacity; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The name of the SKU. Required on PUT (CreateOrReplace) requests. public StreamAnalyticsSkuName? Name { get; set; } + /// The capacity of the SKU. + public int? Capacity { get; set; } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.Serialization.cs index 753732ae505d..c1584b7b4ac0 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.Serialization.cs @@ -81,7 +81,7 @@ internal static StreamAnalyticsSubResource DeserializeStreamAnalyticsSubResource } ResourceIdentifier id = default; string name = default; - ResourceType? type = default; + Core.ResourceType? type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -106,7 +106,7 @@ internal static StreamAnalyticsSubResource DeserializeStreamAnalyticsSubResource { continue; } - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.cs index 5942fff400a4..bb6e64bd635b 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubResource.cs @@ -56,7 +56,7 @@ public StreamAnalyticsSubResource() /// Resource name. /// Resource type. /// Keeps track of any properties unknown to the library. - internal StreamAnalyticsSubResource(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData) + internal StreamAnalyticsSubResource(ResourceIdentifier id, string name, Core.ResourceType? resourceType, IDictionary serializedAdditionalRawData) { Id = id; Name = name; @@ -69,6 +69,6 @@ internal StreamAnalyticsSubResource(ResourceIdentifier id, string name, Resource /// Resource name. public string Name { get; set; } /// Resource type. - public ResourceType? ResourceType { get; } + public Core.ResourceType? ResourceType { get; } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.Serialization.cs index ebcb6655d49a..ffb7a40b706e 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.Serialization.cs @@ -94,7 +94,7 @@ internal static StreamAnalyticsSubscriptionQuota DeserializeStreamAnalyticsSubsc } ResourceIdentifier id = default; string name = default; - ResourceType? type = default; + Core.ResourceType? type = default; int? maxCount = default; int? currentCount = default; IDictionary serializedAdditionalRawData = default; @@ -121,7 +121,7 @@ internal static StreamAnalyticsSubscriptionQuota DeserializeStreamAnalyticsSubsc { continue; } - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("properties"u8)) diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.cs index 1edfb94d1a14..90cf33d01a53 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamAnalyticsSubscriptionQuota.cs @@ -26,7 +26,7 @@ public StreamAnalyticsSubscriptionQuota() /// Keeps track of any properties unknown to the library. /// The max permitted usage of this resource. /// The current usage of this resource. - internal StreamAnalyticsSubscriptionQuota(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, int? maxCount, int? currentCount) : base(id, name, resourceType, serializedAdditionalRawData) + internal StreamAnalyticsSubscriptionQuota(ResourceIdentifier id, string name, Core.ResourceType? resourceType, IDictionary serializedAdditionalRawData, int? maxCount, int? currentCount) : base(id, name, resourceType, serializedAdditionalRawData) { MaxCount = maxCount; CurrentCount = currentCount; diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.Serialization.cs index b36fe1197a65..0feb79645ad6 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.Serialization.cs @@ -63,6 +63,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WritePropertyName("watermarkSettings"u8); writer.WriteObjectValue(WatermarkSettings, options); } + if (Optional.IsDefined(MessagingCatalogConfiguration)) + { + writer.WritePropertyName("messagingCatalogConfiguration"u8); + writer.WriteStringValue(MessagingCatalogConfiguration); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -109,6 +114,7 @@ internal static StreamInputProperties DeserializeStreamInputProperties(JsonEleme StreamingCompression compression = default; string partitionKey = default; StreamingJobInputWatermarkProperties watermarkSettings = default; + string messagingCatalogConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -177,6 +183,11 @@ internal static StreamInputProperties DeserializeStreamInputProperties(JsonEleme watermarkSettings = StreamingJobInputWatermarkProperties.DeserializeStreamingJobInputWatermarkProperties(property.Value, options); continue; } + if (property.NameEquals("messagingCatalogConfiguration"u8)) + { + messagingCatalogConfiguration = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -191,6 +202,7 @@ internal static StreamInputProperties DeserializeStreamInputProperties(JsonEleme compression, partitionKey, watermarkSettings, + messagingCatalogConfiguration, serializedAdditionalRawData, datasource); } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.cs index 7e9f3dab0ed4..b93f10bb6dc0 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamInputProperties.cs @@ -24,20 +24,21 @@ public StreamInputProperties() /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// Describes how input data is compressed. /// partitionKey Describes a key in the input data which is used for partitioning the input data. /// Settings which determine whether to read watermark events. + /// Messaging catalog configuration. /// Keeps track of any properties unknown to the library. /// /// Describes an input data source that contains stream data. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , and . /// - internal StreamInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, IDictionary serializedAdditionalRawData, StreamInputDataSource datasource) : base(inputPropertiesType, serialization, diagnostics, etag, compression, partitionKey, watermarkSettings, serializedAdditionalRawData) + internal StreamInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, string messagingCatalogConfiguration, IDictionary serializedAdditionalRawData, StreamInputDataSource datasource) : base(inputPropertiesType, serialization, diagnostics, etag, compression, partitionKey, watermarkSettings, messagingCatalogConfiguration, serializedAdditionalRawData) { Datasource = datasource; InputPropertiesType = inputPropertiesType ?? "Stream"; diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.Serialization.cs index c953db534efc..0eb64a85ea6e 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.Serialization.cs @@ -58,6 +58,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("watermarkSettings"u8); writer.WriteObjectValue(WatermarkSettings, options); } + if (Optional.IsDefined(MessagingCatalogConfiguration)) + { + writer.WritePropertyName("messagingCatalogConfiguration"u8); + writer.WriteStringValue(MessagingCatalogConfiguration); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.cs index bf8a64d05ae5..f3f516389ccc 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobInputProperties.cs @@ -59,15 +59,16 @@ protected StreamingJobInputProperties() /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// Describes how input data is compressed. /// partitionKey Describes a key in the input data which is used for partitioning the input data. /// Settings which determine whether to read watermark events. + /// Messaging catalog configuration. /// Keeps track of any properties unknown to the library. - internal StreamingJobInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, IDictionary serializedAdditionalRawData) + internal StreamingJobInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, string messagingCatalogConfiguration, IDictionary serializedAdditionalRawData) { InputPropertiesType = inputPropertiesType; Serialization = serialization; @@ -76,6 +77,7 @@ internal StreamingJobInputProperties(string inputPropertiesType, StreamAnalytics Compression = compression; PartitionKey = partitionKey; WatermarkSettings = watermarkSettings; + MessagingCatalogConfiguration = messagingCatalogConfiguration; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -84,7 +86,7 @@ internal StreamingJobInputProperties(string inputPropertiesType, StreamAnalytics /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// public StreamAnalyticsDataSerialization Serialization { get; set; } /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. @@ -124,5 +126,8 @@ public StreamingJobInputWatermarkMode? WatermarkMode WatermarkSettings.WatermarkMode = value; } } + + /// Messaging catalog configuration. + public string MessagingCatalogConfiguration { get; set; } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.Serialization.cs index 5df47398d0f8..12e9d44e3ac8 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.Serialization.cs @@ -75,6 +75,7 @@ internal static StreamingJobOutputDataSource DeserializeStreamingJobOutputDataSo case "Microsoft.DataLake/Accounts": return DataLakeStoreOutputDataSource.DeserializeDataLakeStoreOutputDataSource(element, options); case "Microsoft.DBForPostgreSQL/servers/databases": return PostgreSQLOutputDataSource.DeserializePostgreSQLOutputDataSource(element, options); case "Microsoft.EventHub/EventHub": return EventHubV2OutputDataSource.DeserializeEventHubV2OutputDataSource(element, options); + case "Microsoft.Kusto/clusters/databases": return AzureDataExplorerOutputDataSource.DeserializeAzureDataExplorerOutputDataSource(element, options); case "Microsoft.ServiceBus/EventHub": return EventHubOutputDataSource.DeserializeEventHubOutputDataSource(element, options); case "Microsoft.ServiceBus/Queue": return ServiceBusQueueOutputDataSource.DeserializeServiceBusQueueOutputDataSource(element, options); case "Microsoft.ServiceBus/Topic": return ServiceBusTopicOutputDataSource.DeserializeServiceBusTopicOutputDataSource(element, options); @@ -85,6 +86,7 @@ internal static StreamingJobOutputDataSource DeserializeStreamingJobOutputDataSo case "Microsoft.Storage/Table": return TableOutputDataSource.DeserializeTableOutputDataSource(element, options); case "PowerBI": return PowerBIOutputDataSource.DeserializePowerBIOutputDataSource(element, options); case "Raw": return RawOutputDatasource.DeserializeRawOutputDatasource(element, options); + case "Reflex": return ReflexOutputDataSource.DeserializeReflexOutputDataSource(element, options); } } return UnknownOutputDataSource.DeserializeUnknownOutputDataSource(element, options); diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.cs index 5dc75d66f4eb..39d576063ae4 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobOutputDataSource.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.StreamAnalytics.Models /// /// Describes the data source that output will be written to. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , and . + /// The available derived classes include , , , , , , , , , , , , , , , and . /// public abstract partial class StreamingJobOutputDataSource { diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.Serialization.cs index e0d72a06bb6e..051b0ab7452d 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.Serialization.cs @@ -93,7 +93,7 @@ internal static StreamingJobRefreshConfiguration DeserializeStreamingJobRefreshC string dateFormat = default; string timeFormat = default; string refreshInterval = default; - DataRefreshType? refreshType = default; + UpdatableUdfRefreshType? refreshType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -124,7 +124,7 @@ internal static StreamingJobRefreshConfiguration DeserializeStreamingJobRefreshC { continue; } - refreshType = new DataRefreshType(property.Value.GetString()); + refreshType = new UpdatableUdfRefreshType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.cs index 60853ffc981f..89404de7445d 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/StreamingJobRefreshConfiguration.cs @@ -57,7 +57,7 @@ public StreamingJobRefreshConfiguration() /// The refresh interval. /// This property indicates which data refresh option to use, Blocking or Nonblocking. /// Keeps track of any properties unknown to the library. - internal StreamingJobRefreshConfiguration(string pathPattern, string dateFormat, string timeFormat, string refreshInterval, DataRefreshType? refreshType, IDictionary serializedAdditionalRawData) + internal StreamingJobRefreshConfiguration(string pathPattern, string dateFormat, string timeFormat, string refreshInterval, UpdatableUdfRefreshType? refreshType, IDictionary serializedAdditionalRawData) { PathPattern = pathPattern; DateFormat = dateFormat; @@ -76,6 +76,6 @@ internal StreamingJobRefreshConfiguration(string pathPattern, string dateFormat, /// The refresh interval. public string RefreshInterval { get; set; } /// This property indicates which data refresh option to use, Blocking or Nonblocking. - public DataRefreshType? RefreshType { get; set; } + public UpdatableUdfRefreshType? RefreshType { get; set; } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.Serialization.cs index 59b18518d77b..55a762eb7721 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.Serialization.cs @@ -58,6 +58,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("watermarkSettings"u8); writer.WriteObjectValue(WatermarkSettings, options); } + if (Optional.IsDefined(MessagingCatalogConfiguration)) + { + writer.WritePropertyName("messagingCatalogConfiguration"u8); + writer.WriteStringValue(MessagingCatalogConfiguration); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -103,6 +108,7 @@ internal static UnknownInputProperties DeserializeUnknownInputProperties(JsonEle StreamingCompression compression = default; string partitionKey = default; StreamingJobInputWatermarkProperties watermarkSettings = default; + string messagingCatalogConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -162,6 +168,11 @@ internal static UnknownInputProperties DeserializeUnknownInputProperties(JsonEle watermarkSettings = StreamingJobInputWatermarkProperties.DeserializeStreamingJobInputWatermarkProperties(property.Value, options); continue; } + if (property.NameEquals("messagingCatalogConfiguration"u8)) + { + messagingCatalogConfiguration = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -176,6 +187,7 @@ internal static UnknownInputProperties DeserializeUnknownInputProperties(JsonEle compression, partitionKey, watermarkSettings, + messagingCatalogConfiguration, serializedAdditionalRawData); } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.cs index 661de2293db0..9b4537b19f23 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UnknownInputProperties.cs @@ -18,15 +18,16 @@ internal partial class UnknownInputProperties : StreamingJobInputProperties /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the input. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// Describes how input data is compressed. /// partitionKey Describes a key in the input data which is used for partitioning the input data. /// Settings which determine whether to read watermark events. + /// Messaging catalog configuration. /// Keeps track of any properties unknown to the library. - internal UnknownInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, IDictionary serializedAdditionalRawData) : base(inputPropertiesType, serialization, diagnostics, etag, compression, partitionKey, watermarkSettings, serializedAdditionalRawData) + internal UnknownInputProperties(string inputPropertiesType, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, StreamingCompression compression, string partitionKey, StreamingJobInputWatermarkProperties watermarkSettings, string messagingCatalogConfiguration, IDictionary serializedAdditionalRawData) : base(inputPropertiesType, serialization, diagnostics, etag, compression, partitionKey, watermarkSettings, messagingCatalogConfiguration, serializedAdditionalRawData) { InputPropertiesType = inputPropertiesType ?? "Unknown"; } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UpdatableUdfRefreshType.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UpdatableUdfRefreshType.cs new file mode 100644 index 000000000000..28bb5f4466a3 --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/Models/UpdatableUdfRefreshType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.StreamAnalytics.Models +{ + /// This property indicates which data refresh option to use, Blocking or Nonblocking. + public readonly partial struct UpdatableUdfRefreshType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpdatableUdfRefreshType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BlockingValue = "Blocking"; + private const string NonblockingValue = "Nonblocking"; + + /// Blocking. + public static UpdatableUdfRefreshType Blocking { get; } = new UpdatableUdfRefreshType(BlockingValue); + /// Nonblocking. + public static UpdatableUdfRefreshType Nonblocking { get; } = new UpdatableUdfRefreshType(NonblockingValue); + /// Determines if two values are the same. + public static bool operator ==(UpdatableUdfRefreshType left, UpdatableUdfRefreshType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpdatableUdfRefreshType left, UpdatableUdfRefreshType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator UpdatableUdfRefreshType(string value) => new UpdatableUdfRefreshType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpdatableUdfRefreshType other && Equals(other); + /// + public bool Equals(UpdatableUdfRefreshType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/SkuRestOperations.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/SkuRestOperations.cs new file mode 100644 index 000000000000..5d45a9321bfe --- /dev/null +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/SkuRestOperations.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.StreamAnalytics.Models; + +namespace Azure.ResourceManager.StreamAnalytics +{ + internal partial class SkuRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SkuRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SkuRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2021-10-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.StreamAnalytics/streamingjobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/skus", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.StreamAnalytics/streamingjobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/skus", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of available SKUs about the specified streaming job. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the streaming job. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GetStreamingJobSkuResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GetStreamingJobSkuResults.DeserializeGetStreamingJobSkuResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of available SKUs about the specified streaming job. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the streaming job. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GetStreamingJobSkuResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GetStreamingJobSkuResults.DeserializeGetStreamingJobSkuResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of available SKUs about the specified streaming job. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the streaming job. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GetStreamingJobSkuResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GetStreamingJobSkuResults.DeserializeGetStreamingJobSkuResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of available SKUs about the specified streaming job. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the streaming job. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GetStreamingJobSkuResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GetStreamingJobSkuResults.DeserializeGetStreamingJobSkuResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/StreamingJobsRestOperations.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/StreamingJobsRestOperations.cs index 398777e91c6c..3e6f22b13a0b 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/StreamingJobsRestOperations.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/RestOperations/StreamingJobsRestOperations.cs @@ -864,6 +864,7 @@ public async Task ScaleAsync(string subscriptionId, string resourceGro await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -889,6 +890,7 @@ public Response Scale(string subscriptionId, string resourceGroupName, string jo _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.Serialization.cs index 127c4fe92f0d..41c20ea2fae7 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.Serialization.cs @@ -121,7 +121,7 @@ internal static StreamAnalyticsClusterData DeserializeStreamAnalyticsClusterData AzureLocation location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + Core.ResourceType type = default; SystemData systemData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -185,7 +185,7 @@ internal static StreamAnalyticsClusterData DeserializeStreamAnalyticsClusterData } if (property.NameEquals("type"u8)) { - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData"u8)) diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.cs index 7166ac119993..ada0295ee1e7 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterData.cs @@ -68,7 +68,7 @@ public StreamAnalyticsClusterData(AzureLocation location) : base(location) /// The current entity tag for the cluster. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// The properties associated with a Stream Analytics cluster. /// Keeps track of any properties unknown to the library. - internal StreamAnalyticsClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, StreamAnalyticsClusterSku sku, ETag? etag, StreamAnalyticsClusterProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal StreamAnalyticsClusterData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, StreamAnalyticsClusterSku sku, ETag? etag, StreamAnalyticsClusterProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; ETag = etag; diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs index 6463a733c042..0445419c518c 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsClusterResource.cs @@ -41,7 +41,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly StreamAnalyticsClusterData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.StreamAnalytics/clusters"; + public static readonly Core.ResourceType ResourceType = "Microsoft.StreamAnalytics/clusters"; /// Initializes a new instance of the class for mocking. protected StreamAnalyticsClusterResource() diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.Serialization.cs index 2952cd7a04c6..96f1e794c78d 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.Serialization.cs @@ -107,7 +107,7 @@ internal static StreamAnalyticsPrivateEndpointData DeserializeStreamAnalyticsPri ETag? etag = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + Core.ResourceType type = default; SystemData systemData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -144,7 +144,7 @@ internal static StreamAnalyticsPrivateEndpointData DeserializeStreamAnalyticsPri } if (property.NameEquals("type"u8)) { - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData"u8)) diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.cs index f317e2401f04..b4981c8b0b15 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamAnalyticsPrivateEndpointData.cs @@ -64,7 +64,7 @@ public StreamAnalyticsPrivateEndpointData() /// The properties associated with a private endpoint. /// Unique opaque string (generally a GUID) that represents the metadata state of the resource (private endpoint) and changes whenever the resource is updated. Required on PUT (CreateOrUpdate) requests. /// Keeps track of any properties unknown to the library. - internal StreamAnalyticsPrivateEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, StreamAnalyticsPrivateEndpointProperties properties, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal StreamAnalyticsPrivateEndpointData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, StreamAnalyticsPrivateEndpointProperties properties, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; ETag = etag; diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.Serialization.cs index b5f63cd11373..36cbe157245c 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.Serialization.cs @@ -28,6 +28,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter } writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); @@ -69,10 +74,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) + if (Optional.IsDefined(SkuPropertiesSku)) { writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku, options); + writer.WriteObjectValue(SkuPropertiesSku, options); } if (options.Format != "W" && Optional.IsDefined(JobId)) { @@ -218,6 +223,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteNull("cluster"); } } + if (Optional.IsDefined(SubnetResourceId)) + { + writer.WritePropertyName("subnetResourceId"u8); + writer.WriteStringValue(SubnetResourceId); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -257,14 +267,15 @@ internal static StreamingJobData DeserializeStreamingJobData(JsonElement element { return null; } + StreamAnalyticsSku sku = default; ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + Core.ResourceType type = default; SystemData systemData = default; - StreamAnalyticsSku sku = default; + StreamAnalyticsSku sku0 = default; Guid? jobId = default; string provisioningState = default; string jobState = default; @@ -288,10 +299,20 @@ internal static StreamingJobData DeserializeStreamingJobData(JsonElement element StreamingJobContentStoragePolicy? contentStoragePolicy = default; StreamingJobExternal externals = default; ClusterInfo cluster = default; + string subnetResourceId = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = StreamAnalyticsSku.DeserializeStreamAnalyticsSku(property.Value, options); + continue; + } if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -333,7 +354,7 @@ internal static StreamingJobData DeserializeStreamingJobData(JsonElement element } if (property.NameEquals("type"u8)) { - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("systemData"u8)) @@ -360,7 +381,7 @@ internal static StreamingJobData DeserializeStreamingJobData(JsonElement element { continue; } - sku = StreamAnalyticsSku.DeserializeStreamAnalyticsSku(property0.Value, options); + sku0 = StreamAnalyticsSku.DeserializeStreamAnalyticsSku(property0.Value, options); continue; } if (property0.NameEquals("jobId"u8)) @@ -579,6 +600,11 @@ internal static StreamingJobData DeserializeStreamingJobData(JsonElement element cluster = ClusterInfo.DeserializeClusterInfo(property0.Value, options); continue; } + if (property0.NameEquals("subnetResourceId"u8)) + { + subnetResourceId = property0.Value.GetString(); + continue; + } } continue; } @@ -595,8 +621,9 @@ internal static StreamingJobData DeserializeStreamingJobData(JsonElement element systemData, tags ?? new ChangeTrackingDictionary(), location, - identity, sku, + identity, + sku0, jobId, provisioningState, jobState, @@ -620,6 +647,7 @@ internal static StreamingJobData DeserializeStreamingJobData(JsonElement element contentStoragePolicy, externals, cluster, + subnetResourceId, serializedAdditionalRawData); } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.cs index 6c783cbebdd6..6c8924af6efb 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobData.cs @@ -67,8 +67,9 @@ public StreamingJobData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Describes the managed identity assigned to this job that can be used to authenticate with inputs and outputs. Current supported identity types: SystemAssigned, UserAssigned, SystemAssigned,UserAssigned. /// Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. + /// Describes the managed identity assigned to this job that can be used to authenticate with inputs and outputs. Current supported identity types: SystemAssigned, UserAssigned, SystemAssigned,UserAssigned. + /// Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. /// A GUID uniquely identifying the streaming job. This GUID is generated upon creation of the streaming job. /// Describes the provisioning status of the streaming job. /// Describes the state of the streaming job. @@ -92,11 +93,13 @@ public StreamingJobData(AzureLocation location) : base(location) /// Valid values are JobStorageAccount and SystemAccount. If set to JobStorageAccount, this requires the user to also specify jobStorageAccount property. . /// The storage account where the custom code artifacts are located. /// The cluster which streaming jobs will run on. + /// The subnet resource id that the user can link their streaming job to. /// Keeps track of any properties unknown to the library. - internal StreamingJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, StreamAnalyticsSku sku, Guid? jobId, string provisioningState, string jobState, StreamingJobType? jobType, StreamingJobOutputStartMode? outputStartMode, DateTimeOffset? outputStartOn, DateTimeOffset? lastOutputEventOn, EventsOutOfOrderPolicy? eventsOutOfOrderPolicy, StreamingJobOutputErrorPolicy? outputErrorPolicy, int? eventsOutOfOrderMaxDelayInSeconds, int? eventsLateArrivalMaxDelayInSeconds, AzureLocation? dataLocalion, StreamingJobCompatibilityLevel? compatibilityLevel, DateTimeOffset? createdOn, IList inputs, StreamingJobTransformationData transformation, IList outputs, IList functions, ETag? etag, StreamingJobStorageAccount jobStorageAccount, StreamingJobContentStoragePolicy? contentStoragePolicy, StreamingJobExternal externals, ClusterInfo cluster, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal StreamingJobData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, StreamAnalyticsSku sku, ManagedServiceIdentity identity, StreamAnalyticsSku skuPropertiesSku, Guid? jobId, string provisioningState, string jobState, StreamingJobType? jobType, StreamingJobOutputStartMode? outputStartMode, DateTimeOffset? outputStartOn, DateTimeOffset? lastOutputEventOn, EventsOutOfOrderPolicy? eventsOutOfOrderPolicy, StreamingJobOutputErrorPolicy? outputErrorPolicy, int? eventsOutOfOrderMaxDelayInSeconds, int? eventsLateArrivalMaxDelayInSeconds, AzureLocation? dataLocalion, StreamingJobCompatibilityLevel? compatibilityLevel, DateTimeOffset? createdOn, IList inputs, StreamingJobTransformationData transformation, IList outputs, IList functions, ETag? etag, StreamingJobStorageAccount jobStorageAccount, StreamingJobContentStoragePolicy? contentStoragePolicy, StreamingJobExternal externals, ClusterInfo cluster, string subnetResourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Identity = identity; Sku = sku; + Identity = identity; + SkuPropertiesSku = skuPropertiesSku; JobId = jobId; ProvisioningState = provisioningState; JobState = jobState; @@ -120,6 +123,7 @@ internal StreamingJobData(ResourceIdentifier id, string name, ResourceType resou ContentStoragePolicy = contentStoragePolicy; Externals = externals; Cluster = cluster; + SubnetResourceId = subnetResourceId; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -128,22 +132,12 @@ internal StreamingJobData() { } + /// Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. + public StreamAnalyticsSku Sku { get; set; } /// Describes the managed identity assigned to this job that can be used to authenticate with inputs and outputs. Current supported identity types: SystemAssigned, UserAssigned, SystemAssigned,UserAssigned. public ManagedServiceIdentity Identity { get; set; } /// Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests. - internal StreamAnalyticsSku Sku { get; set; } - /// The name of the SKU. Required on PUT (CreateOrReplace) requests. - public StreamAnalyticsSkuName? SkuName - { - get => Sku is null ? default : Sku.Name; - set - { - if (Sku is null) - Sku = new StreamAnalyticsSku(); - Sku.Name = value; - } - } - + public StreamAnalyticsSku SkuPropertiesSku { get; set; } /// A GUID uniquely identifying the streaming job. This GUID is generated upon creation of the streaming job. public Guid? JobId { get; } /// Describes the provisioning status of the streaming job. @@ -201,5 +195,8 @@ public ResourceIdentifier ClusterId Cluster.Id = value; } } + + /// The subnet resource id that the user can link their streaming job to. + public string SubnetResourceId { get; set; } } } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.Serialization.cs index e2f6742155fa..3efc93c46d02 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.Serialization.cs @@ -88,7 +88,7 @@ internal static StreamingJobFunctionData DeserializeStreamingJobFunctionData(Jso StreamingJobFunctionProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType? type = default; + Core.ResourceType? type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -122,7 +122,7 @@ internal static StreamingJobFunctionData DeserializeStreamingJobFunctionData(Jso { continue; } - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.cs index 0890fc2a9b97..eab7fe93796b 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionData.cs @@ -33,7 +33,7 @@ public StreamingJobFunctionData() /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - internal StreamingJobFunctionData(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, StreamingJobFunctionProperties properties) : base(id, name, resourceType, serializedAdditionalRawData) + internal StreamingJobFunctionData(ResourceIdentifier id, string name, Core.ResourceType? resourceType, IDictionary serializedAdditionalRawData, StreamingJobFunctionProperties properties) : base(id, name, resourceType, serializedAdditionalRawData) { Properties = properties; } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionResource.cs index 79482470e5a2..af30b1da6d4f 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobFunctionResource.cs @@ -39,7 +39,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly StreamingJobFunctionData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs/functions"; + public static readonly Core.ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs/functions"; /// Initializes a new instance of the class for mocking. protected StreamingJobFunctionResource() diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.Serialization.cs index 9e712af8478f..aac2b5766c3d 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.Serialization.cs @@ -88,7 +88,7 @@ internal static StreamingJobInputData DeserializeStreamingJobInputData(JsonEleme StreamingJobInputProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType? type = default; + Core.ResourceType? type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -122,7 +122,7 @@ internal static StreamingJobInputData DeserializeStreamingJobInputData(JsonEleme { continue; } - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.cs index adee6c902c7c..39fd527a8ef4 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputData.cs @@ -33,7 +33,7 @@ public StreamingJobInputData() /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - internal StreamingJobInputData(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, StreamingJobInputProperties properties) : base(id, name, resourceType, serializedAdditionalRawData) + internal StreamingJobInputData(ResourceIdentifier id, string name, Core.ResourceType? resourceType, IDictionary serializedAdditionalRawData, StreamingJobInputProperties properties) : base(id, name, resourceType, serializedAdditionalRawData) { Properties = properties; } diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputResource.cs index 0c5e6ebed019..a0ed10514274 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobInputResource.cs @@ -39,7 +39,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly StreamingJobInputData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs/inputs"; + public static readonly Core.ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs/inputs"; /// Initializes a new instance of the class for mocking. protected StreamingJobInputResource() diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.Serialization.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.Serialization.cs index 5d7a42b71fae..08567f81c8c7 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.Serialization.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.Serialization.cs @@ -130,10 +130,10 @@ internal static StreamingJobOutputData DeserializeStreamingJobOutputData(JsonEle } ResourceIdentifier id = default; string name = default; - ResourceType? type = default; + Core.ResourceType? type = default; StreamingJobOutputDataSource datasource = default; TimeSpan? timeWindow = default; - float? sizeWindow = default; + int? sizeWindow = default; StreamAnalyticsDataSerialization serialization = default; StreamingJobDiagnostics diagnostics = default; ETag? etag = default; @@ -163,7 +163,7 @@ internal static StreamingJobOutputData DeserializeStreamingJobOutputData(JsonEle { continue; } - type = new ResourceType(property.Value.GetString()); + type = new Core.ResourceType(property.Value.GetString()); continue; } if (property.NameEquals("properties"u8)) @@ -199,7 +199,7 @@ internal static StreamingJobOutputData DeserializeStreamingJobOutputData(JsonEle { continue; } - sizeWindow = property0.Value.GetSingle(); + sizeWindow = property0.Value.GetInt32(); continue; } if (property0.NameEquals("serialization"u8)) diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.cs index 56c883285de3..f08850e2cb3c 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputData.cs @@ -32,20 +32,20 @@ public StreamingJobOutputData() /// /// Describes the data source that output will be written to. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , and . + /// The available derived classes include , , , , , , , , , , , , , , , and . /// /// The time frame for filtering Stream Analytics job outputs. /// The size window to constrain a Stream Analytics output to. /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. /// The current entity tag for the output. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. /// A list of the last output event times for each output partition. The index of the array corresponds to the partition number. /// Settings which determine whether to send watermarks to downstream. - internal StreamingJobOutputData(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, StreamingJobOutputDataSource datasource, TimeSpan? timeFrame, float? sizeWindow, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, IReadOnlyList lastOutputEventTimestamps, StreamingJobOutputWatermarkProperties watermarkSettings) : base(id, name, resourceType, serializedAdditionalRawData) + internal StreamingJobOutputData(ResourceIdentifier id, string name, Core.ResourceType? resourceType, IDictionary serializedAdditionalRawData, StreamingJobOutputDataSource datasource, TimeSpan? timeFrame, int? sizeWindow, StreamAnalyticsDataSerialization serialization, StreamingJobDiagnostics diagnostics, ETag? etag, IReadOnlyList lastOutputEventTimestamps, StreamingJobOutputWatermarkProperties watermarkSettings) : base(id, name, resourceType, serializedAdditionalRawData) { Datasource = datasource; TimeFrame = timeFrame; @@ -60,17 +60,17 @@ internal StreamingJobOutputData(ResourceIdentifier id, string name, ResourceType /// /// Describes the data source that output will be written to. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , and . + /// The available derived classes include , , , , , , , , , , , , , , , and . /// public StreamingJobOutputDataSource Datasource { get; set; } /// The time frame for filtering Stream Analytics job outputs. public TimeSpan? TimeFrame { get; set; } /// The size window to constrain a Stream Analytics output to. - public float? SizeWindow { get; set; } + public int? SizeWindow { get; set; } /// /// Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// public StreamAnalyticsDataSerialization Serialization { get; set; } /// Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention. diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputResource.cs index c5a3c4c1bc4e..785446739803 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobOutputResource.cs @@ -39,7 +39,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly StreamingJobOutputData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs/outputs"; + public static readonly Core.ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs/outputs"; /// Initializes a new instance of the class for mocking. protected StreamingJobOutputResource() diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs index dc0411fcc3f7..312cdae2fa81 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobResource.cs @@ -10,6 +10,7 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Resources; @@ -37,10 +38,12 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _streamingJobClientDiagnostics; private readonly StreamingJobsRestOperations _streamingJobRestClient; + private readonly ClientDiagnostics _skuClientDiagnostics; + private readonly SkuRestOperations _skuRestClient; private readonly StreamingJobData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs"; + public static readonly Core.ResourceType ResourceType = "Microsoft.StreamAnalytics/streamingjobs"; /// Initializes a new instance of the class for mocking. protected StreamingJobResource() @@ -64,6 +67,8 @@ internal StreamingJobResource(ArmClient client, ResourceIdentifier id) : base(cl _streamingJobClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.StreamAnalytics", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string streamingJobApiVersion); _streamingJobRestClient = new StreamingJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, streamingJobApiVersion); + _skuClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.StreamAnalytics", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _skuRestClient = new SkuRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -874,6 +879,58 @@ public virtual ArmOperation Scale(WaitUntil waitUntil, ScaleStreamingJobContent } } + /// + /// Gets a list of available SKUs about the specified streaming job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/skus + /// + /// + /// Operation Id + /// Sku_List + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSkusAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _skuRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _skuRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => GetStreamingJobSkuResult.DeserializeGetStreamingJobSkuResult(e), _skuClientDiagnostics, Pipeline, "StreamingJobResource.GetSkus", "value", "nextLink", cancellationToken); + } + + /// + /// Gets a list of available SKUs about the specified streaming job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/skus + /// + /// + /// Operation Id + /// Sku_List + /// + /// + /// Default Api Version + /// 2021-10-01-preview + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSkus(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _skuRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _skuRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => GetStreamingJobSkuResult.DeserializeGetStreamingJobSkuResult(e), _skuClientDiagnostics, Pipeline, "StreamingJobResource.GetSkus", "value", "nextLink", cancellationToken); + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobTransformationData.cs b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobTransformationData.cs index 19e48b7b68f8..165874661d8c 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobTransformationData.cs +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/Generated/StreamingJobTransformationData.cs @@ -33,7 +33,7 @@ public StreamingJobTransformationData() /// Specifies the valid streaming units a streaming job can scale to. /// Specifies the query that will be run in the streaming job. You can learn more about the Stream Analytics Query Language (SAQL) here: https://msdn.microsoft.com/library/azure/dn834998 . Required on PUT (CreateOrReplace) requests. /// The current entity tag for the transformation. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. - internal StreamingJobTransformationData(ResourceIdentifier id, string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData, int? streamingUnits, IList validStreamingUnits, string query, ETag? etag) : base(id, name, resourceType, serializedAdditionalRawData) + internal StreamingJobTransformationData(ResourceIdentifier id, string name, Core.ResourceType? resourceType, IDictionary serializedAdditionalRawData, int? streamingUnits, IList validStreamingUnits, string query, ETag? etag) : base(id, name, resourceType, serializedAdditionalRawData) { StreamingUnits = streamingUnits; ValidStreamingUnits = validStreamingUnits; diff --git a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/autorest.md b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/autorest.md index ee7bd2ae4797..c4e9fba40714 100644 --- a/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/autorest.md +++ b/sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: StreamAnalytics namespace: Azure.ResourceManager.StreamAnalytics -require: https://github.com/Azure/azure-rest-api-specs/blob/692cb8b5eb71505afa267cfbbee322d520eb15ff/specification/streamanalytics/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.md tag: package-2021-10-preview output-folder: $(this-folder)/Generated clear-output-folder: true