diff --git a/eng/CodeGeneration.targets b/eng/CodeGeneration.targets index e1454815ebbc..59907dc2e51a 100644 --- a/eng/CodeGeneration.targets +++ b/eng/CodeGeneration.targets @@ -3,7 +3,7 @@ <_AutoRestVersion>https://github.com/Azure/autorest/releases/download/autorest-3.0.6223/autorest-3.0.6223.tgz <_AutoRestCoreVersion>3.0.6283 - <_AutoRestCSharpVersion>https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200622.3/autorest-csharp-v3-3.0.0-dev.20200622.3.tgz + <_AutoRestCSharpVersion>https://github.com/Azure/autorest.csharp/releases/download/3.0.0-dev.20200625.1/autorest-csharp-v3-3.0.0-dev.20200625.1.tgz <_SupportsCodeGeneration Condition="'$(IsClientLibrary)' == 'true'">true <_DefaultInputName Condition="Exists('$(MSBuildProjectDirectory)/autorest.md')">$(MSBuildProjectDirectory)/autorest.md $(_DefaultInputName) @@ -44,3 +44,4 @@ + diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs index 1ddd6de39d38..2a5af5728f4a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceSshConfiguration.cs @@ -23,7 +23,7 @@ public ContainerServiceSshConfiguration(IEnumerable Initializes a new instance of ContainerServiceSshConfiguration. diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs index 88f94cdbdeaa..fb5704a0797a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs @@ -23,7 +23,7 @@ public VirtualMachineScaleSetVMInstanceRequiredIDs(IEnumerable instanceI throw new ArgumentNullException(nameof(instanceIds)); } - InstanceIds = instanceIds.ToArray(); + InstanceIds = instanceIds.ToList(); } /// Initializes a new instance of VirtualMachineScaleSetVMInstanceRequiredIDs. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEvent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEvent.Serialization.cs new file mode 100644 index 000000000000..b5cb515a4ef1 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEvent.Serialization.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Models +{ + public partial class CloudEvent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + writer.WritePropertyName("source"); + writer.WriteStringValue(Source); + if (Data != null) + { + writer.WritePropertyName("data"); + writer.WriteObjectValue(Data); + } + writer.WritePropertyName("type"); + writer.WriteStringValue(Type); + if (Time != null) + { + writer.WritePropertyName("time"); + writer.WriteStringValue(Time.Value, "O"); + } + writer.WritePropertyName("specversion"); + writer.WriteStringValue(Specversion); + if (Dataschema != null) + { + writer.WritePropertyName("dataschema"); + writer.WriteStringValue(Dataschema); + } + if (Datacontenttype != null) + { + writer.WritePropertyName("datacontenttype"); + writer.WriteStringValue(Datacontenttype); + } + if (Subject != null) + { + writer.WritePropertyName("subject"); + writer.WriteStringValue(Subject); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEvent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEvent.cs new file mode 100644 index 000000000000..38c5210fa335 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/CloudEvent.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.Models +{ + /// Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. + public partial class CloudEvent + { + /// Initializes a new instance of CloudEvent. + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + /// Type of event related to the originating occurrence. + /// The version of the CloudEvents specification which the event uses. + public CloudEvent(string id, string source, string type, string specversion) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + if (type == null) + { + throw new ArgumentNullException(nameof(type)); + } + if (specversion == null) + { + throw new ArgumentNullException(nameof(specversion)); + } + + Id = id; + Source = source; + Type = type; + Specversion = specversion; + } + + /// Initializes a new instance of CloudEvent. + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + /// Event data specific to the event type. + /// Type of event related to the originating occurrence. + /// The time (in UTC) the event was generated, in RFC3339 format. + /// The version of the CloudEvents specification which the event uses. + /// Identifies the schema that data adheres to. + /// Content type of data value. + /// This describes the subject of the event in the context of the event producer (identified by source). + internal CloudEvent(string id, string source, object data, string type, DateTimeOffset? time, string specversion, string dataschema, string datacontenttype, string subject) + { + Id = id; + Source = source; + Data = data; + Type = type; + Time = time; + Specversion = specversion; + Dataschema = dataschema; + Datacontenttype = datacontenttype; + Subject = subject; + } + + /// An identifier for the event. The combination of id and source must be unique for each distinct event. + public string Id { get; } + /// Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. + public string Source { get; } + /// Event data specific to the event type. + public object Data { get; set; } + /// Type of event related to the originating occurrence. + public string Type { get; } + /// The time (in UTC) the event was generated, in RFC3339 format. + public DateTimeOffset? Time { get; set; } + /// The version of the CloudEvents specification which the event uses. + public string Specversion { get; } + /// Identifies the schema that data adheres to. + public string Dataschema { get; set; } + /// Content type of data value. + public string Datacontenttype { get; set; } + /// This describes the subject of the event in the context of the event producer (identified by source). + public string Subject { get; set; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEvent.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEvent.Serialization.cs new file mode 100644 index 000000000000..ef68d1115aae --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEvent.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.Models +{ + public partial class EventGridEvent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + if (Topic != null) + { + writer.WritePropertyName("topic"); + writer.WriteStringValue(Topic); + } + writer.WritePropertyName("subject"); + writer.WriteStringValue(Subject); + writer.WritePropertyName("data"); + writer.WriteObjectValue(Data); + writer.WritePropertyName("eventType"); + writer.WriteStringValue(EventType); + writer.WritePropertyName("eventTime"); + writer.WriteStringValue(EventTime, "O"); + if (MetadataVersion != null) + { + writer.WritePropertyName("metadataVersion"); + writer.WriteStringValue(MetadataVersion); + } + writer.WritePropertyName("dataVersion"); + writer.WriteStringValue(DataVersion); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEvent.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEvent.cs new file mode 100644 index 000000000000..91520419b743 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/EventGridEvent.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.Models +{ + /// Properties of an event published to an Event Grid topic using the EventGrid Schema. + public partial class EventGridEvent + { + /// Initializes a new instance of EventGridEvent. + /// An unique identifier for the event. + /// A resource path relative to the topic path. + /// Event data specific to the event type. + /// The type of the event that occurred. + /// The time (in UTC) the event was generated. + /// The schema version of the data object. + public EventGridEvent(string id, string subject, object data, string eventType, DateTimeOffset eventTime, string dataVersion) + { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (subject == null) + { + throw new ArgumentNullException(nameof(subject)); + } + if (data == null) + { + throw new ArgumentNullException(nameof(data)); + } + if (eventType == null) + { + throw new ArgumentNullException(nameof(eventType)); + } + if (dataVersion == null) + { + throw new ArgumentNullException(nameof(dataVersion)); + } + + Id = id; + Subject = subject; + Data = data; + EventType = eventType; + EventTime = eventTime; + DataVersion = dataVersion; + } + + /// Initializes a new instance of EventGridEvent. + /// An unique identifier for the event. + /// The resource path of the event source. + /// A resource path relative to the topic path. + /// Event data specific to the event type. + /// The type of the event that occurred. + /// The time (in UTC) the event was generated. + /// The schema version of the event metadata. + /// The schema version of the data object. + internal EventGridEvent(string id, string topic, string subject, object data, string eventType, DateTimeOffset eventTime, string metadataVersion, string dataVersion) + { + Id = id; + Topic = topic; + Subject = subject; + Data = data; + EventType = eventType; + EventTime = eventTime; + MetadataVersion = metadataVersion; + DataVersion = dataVersion; + } + + /// An unique identifier for the event. + public string Id { get; } + /// The resource path of the event source. + public string Topic { get; set; } + /// A resource path relative to the topic path. + public string Subject { get; } + /// Event data specific to the event type. + public object Data { get; } + /// The type of the event that occurred. + public string EventType { get; } + /// The time (in UTC) the event was generated. + public DateTimeOffset EventTime { get; } + /// The schema version of the event metadata. + public string MetadataVersion { get; } + /// The schema version of the data object. + public string DataVersion { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionDeletedEventData.cs new file mode 100644 index 000000000000..4b8a25c3cd68 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionDeletedEventData.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.Models +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent. + internal partial class SubscriptionDeletedEventData + { + /// Initializes a new instance of SubscriptionDeletedEventData. + internal SubscriptionDeletedEventData() + { + } + + /// Initializes a new instance of SubscriptionDeletedEventData. + /// The Azure resource ID of the deleted event subscription. + internal SubscriptionDeletedEventData(string eventSubscriptionId) + { + EventSubscriptionId = eventSubscriptionId; + } + + /// The Azure resource ID of the deleted event subscription. + public string EventSubscriptionId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationEventData.cs new file mode 100644 index 000000000000..40f21ae9a26d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationEventData.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.Models +{ + /// Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent. + internal partial class SubscriptionValidationEventData + { + /// Initializes a new instance of SubscriptionValidationEventData. + internal SubscriptionValidationEventData() + { + } + + /// Initializes a new instance of SubscriptionValidationEventData. + /// The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). + /// The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). + internal SubscriptionValidationEventData(string validationCode, string validationUrl) + { + ValidationCode = validationCode; + ValidationUrl = validationUrl; + } + + /// The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). + public string ValidationCode { get; } + /// The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview). + public string ValidationUrl { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationResponse.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationResponse.cs new file mode 100644 index 000000000000..a30cbf3869ae --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/SubscriptionValidationResponse.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.Models +{ + /// To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response. + internal partial class SubscriptionValidationResponse + { + /// Initializes a new instance of SubscriptionValidationResponse. + internal SubscriptionValidationResponse() + { + } + + /// Initializes a new instance of SubscriptionValidationResponse. + /// The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. + internal SubscriptionValidationResponse(string validationResponse) + { + ValidationResponse = validationResponse; + } + + /// The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. + public string ValidationResponse { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/ServiceClient.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/ServiceClient.cs new file mode 100644 index 000000000000..6e62db3f848c --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/ServiceClient.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core.Pipeline; +using Azure.Messaging.EventGrid.Models; + +namespace Azure.Messaging.EventGrid +{ + /// The Service service client. + public partial class ServiceClient + { + private readonly ClientDiagnostics _clientDiagnostics; + private readonly HttpPipeline _pipeline; + internal ServiceRestClient RestClient { get; } + /// Initializes a new instance of ServiceClient for mocking. + protected ServiceClient() + { + } + /// Initializes a new instance of ServiceClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Api Version. + internal ServiceClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "2018-01-01") + { + RestClient = new ServiceRestClient(clientDiagnostics, pipeline, apiVersion); + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public virtual async Task PublishEventsAsync(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ServiceClient.PublishEvents"); + scope.Start(); + try + { + return await RestClient.PublishEventsAsync(topicHostname, events, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public virtual Response PublishEvents(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ServiceClient.PublishEvents"); + scope.Start(); + try + { + return RestClient.PublishEvents(topicHostname, events, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public virtual async Task PublishCloudEventEventsAsync(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ServiceClient.PublishCloudEventEvents"); + scope.Start(); + try + { + return await RestClient.PublishCloudEventEventsAsync(topicHostname, events, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public virtual Response PublishCloudEventEvents(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ServiceClient.PublishCloudEventEvents"); + scope.Start(); + try + { + return RestClient.PublishCloudEventEvents(topicHostname, events, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public virtual async Task PublishCustomEventEventsAsync(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ServiceClient.PublishCustomEventEvents"); + scope.Start(); + try + { + return await RestClient.PublishCustomEventEventsAsync(topicHostname, events, cancellationToken).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public virtual Response PublishCustomEventEvents(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + using var scope = _clientDiagnostics.CreateScope("ServiceClient.PublishCustomEventEvents"); + scope.Start(); + try + { + return RestClient.PublishCustomEventEvents(topicHostname, events, cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/ServiceRestClient.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/ServiceRestClient.cs new file mode 100644 index 000000000000..0cde8432ba64 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/ServiceRestClient.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Messaging.EventGrid.Models; + +namespace Azure.Messaging.EventGrid +{ + internal partial class ServiceRestClient + { + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of ServiceRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Api Version. + /// This occurs when one of the required arguments is null. + public ServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "2018-01-01") + { + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreatePublishEventsRequest(string topicHostname, IEnumerable events) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw("https://", false); + uri.AppendRaw(topicHostname, false); + uri.AppendPath("/api/events", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in events) + { + content.JsonWriter.WriteObjectValue(item); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + return message; + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public async Task PublishEventsAsync(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + if (topicHostname == null) + { + throw new ArgumentNullException(nameof(topicHostname)); + } + if (events == null) + { + throw new ArgumentNullException(nameof(events)); + } + + using var message = CreatePublishEventsRequest(topicHostname, events); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public Response PublishEvents(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + if (topicHostname == null) + { + throw new ArgumentNullException(nameof(topicHostname)); + } + if (events == null) + { + throw new ArgumentNullException(nameof(events)); + } + + using var message = CreatePublishEventsRequest(topicHostname, events); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreatePublishCloudEventEventsRequest(string topicHostname, IEnumerable events) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw("https://", false); + uri.AppendRaw(topicHostname, false); + uri.AppendPath("/api/events", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/cloudevents-batch+json; charset=utf-8"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in events) + { + content.JsonWriter.WriteObjectValue(item); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + return message; + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public async Task PublishCloudEventEventsAsync(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + if (topicHostname == null) + { + throw new ArgumentNullException(nameof(topicHostname)); + } + if (events == null) + { + throw new ArgumentNullException(nameof(events)); + } + + using var message = CreatePublishCloudEventEventsRequest(topicHostname, events); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public Response PublishCloudEventEvents(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + if (topicHostname == null) + { + throw new ArgumentNullException(nameof(topicHostname)); + } + if (events == null) + { + throw new ArgumentNullException(nameof(events)); + } + + using var message = CreatePublishCloudEventEventsRequest(topicHostname, events); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreatePublishCustomEventEventsRequest(string topicHostname, IEnumerable events) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw("https://", false); + uri.AppendRaw(topicHostname, false); + uri.AppendPath("/api/events", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in events) + { + content.JsonWriter.WriteObjectValue(item); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + return message; + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public async Task PublishCustomEventEventsAsync(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + if (topicHostname == null) + { + throw new ArgumentNullException(nameof(topicHostname)); + } + if (events == null) + { + throw new ArgumentNullException(nameof(events)); + } + + using var message = CreatePublishCustomEventEventsRequest(topicHostname, events); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Publishes a batch of events to an Azure Event Grid topic. + /// The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + /// An array of events to be published to Event Grid. + /// The cancellation token to use. + public Response PublishCustomEventEvents(string topicHostname, IEnumerable events, CancellationToken cancellationToken = default) + { + if (topicHostname == null) + { + throw new ArgumentNullException(nameof(topicHostname)); + } + if (events == null) + { + throw new ArgumentNullException(nameof(events)); + } + + using var message = CreatePublishCustomEventEventsRequest(topicHostname, events); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultAccessPolicyProperties.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultAccessPolicyProperties.cs index 96b0c44c6e12..cf981b743684 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultAccessPolicyProperties.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultAccessPolicyProperties.cs @@ -23,7 +23,7 @@ public VaultAccessPolicyProperties(IEnumerable accessPolicies throw new ArgumentNullException(nameof(accessPolicies)); } - AccessPolicies = accessPolicies.ToArray(); + AccessPolicies = accessPolicies.ToList(); } /// Initializes a new instance of VaultAccessPolicyProperties. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs index 186578db2c57..56fd1bf31e4e 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs @@ -29,7 +29,7 @@ public ApplicationGatewayFirewallRuleGroup(string ruleGroupName, IEnumerable Initializes a new instance of ApplicationGatewayFirewallRuleGroup. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ConnectionMonitorTestGroup.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ConnectionMonitorTestGroup.cs index ceba4072b3db..d80f95306a4b 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ConnectionMonitorTestGroup.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ConnectionMonitorTestGroup.cs @@ -39,9 +39,9 @@ public ConnectionMonitorTestGroup(string name, IEnumerable testConfigura } Name = name; - TestConfigurations = testConfigurations.ToArray(); - Sources = sources.ToArray(); - Destinations = destinations.ToArray(); + TestConfigurations = testConfigurations.ToList(); + Sources = sources.ToList(); + Destinations = destinations.ToList(); } /// Initializes a new instance of ConnectionMonitorTestGroup. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/HubRoute.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/HubRoute.cs index 0e8986050406..93a2c627d5af 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/HubRoute.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/HubRoute.cs @@ -45,7 +45,7 @@ public HubRoute(string name, string destinationType, IEnumerable destina Name = name; DestinationType = destinationType; - Destinations = destinations.ToArray(); + Destinations = destinations.ToList(); NextHopType = nextHopType; NextHop = nextHop; } diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ManagedRulesDefinition.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ManagedRulesDefinition.cs index 394a55f2cb65..9365ef09625c 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ManagedRulesDefinition.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/ManagedRulesDefinition.cs @@ -23,7 +23,7 @@ public ManagedRulesDefinition(IEnumerable managedRuleSets) throw new ArgumentNullException(nameof(managedRuleSets)); } - ManagedRuleSets = managedRuleSets.ToArray(); + ManagedRuleSets = managedRuleSets.ToList(); } /// Initializes a new instance of ManagedRulesDefinition. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/MatchCondition.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/MatchCondition.cs index f0870c228ba5..42f8ef315a0b 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/MatchCondition.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/MatchCondition.cs @@ -29,9 +29,9 @@ public MatchCondition(IEnumerable matchVariables, WebApplicationF throw new ArgumentNullException(nameof(matchValues)); } - MatchVariables = matchVariables.ToArray(); + MatchVariables = matchVariables.ToList(); Operator = @operator; - MatchValues = matchValues.ToArray(); + MatchValues = matchValues.ToList(); } /// Initializes a new instance of MatchCondition. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs index c36c9c10913e..e5b0048daab3 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs @@ -29,7 +29,7 @@ public NetworkConfigurationDiagnosticParameters(string targetResourceId, IEnumer } TargetResourceId = targetResourceId; - Profiles = profiles.ToArray(); + Profiles = profiles.ToList(); } /// Initializes a new instance of NetworkConfigurationDiagnosticParameters. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/TrafficSelectorPolicy.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/TrafficSelectorPolicy.cs index 835c111663b1..64484b3c3c45 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/TrafficSelectorPolicy.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/TrafficSelectorPolicy.cs @@ -28,8 +28,8 @@ public TrafficSelectorPolicy(IEnumerable localAddressRanges, IEnumerable throw new ArgumentNullException(nameof(remoteAddressRanges)); } - LocalAddressRanges = localAddressRanges.ToArray(); - RemoteAddressRanges = remoteAddressRanges.ToArray(); + LocalAddressRanges = localAddressRanges.ToList(); + RemoteAddressRanges = remoteAddressRanges.ToList(); } /// Initializes a new instance of TrafficSelectorPolicy. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/WebApplicationFirewallCustomRule.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/WebApplicationFirewallCustomRule.cs index 57f9ab648b89..f1025a4d294c 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/WebApplicationFirewallCustomRule.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/WebApplicationFirewallCustomRule.cs @@ -28,7 +28,7 @@ public WebApplicationFirewallCustomRule(int priority, WebApplicationFirewallRule Priority = priority; RuleType = ruleType; - MatchConditions = matchConditions.ToArray(); + MatchConditions = matchConditions.ToList(); Action = action; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ApplicationDefinition.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ApplicationDefinition.cs index e1b4b7bf0b8f..f4c400fe27cb 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ApplicationDefinition.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ApplicationDefinition.cs @@ -25,7 +25,7 @@ public ApplicationDefinition(ApplicationLockLevel lockLevel, IEnumerable Initializes a new instance of ApplicationDefinition. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonGramTokenFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonGramTokenFilter.cs index 33e3b6cad5fe..f995b62274d3 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonGramTokenFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CommonGramTokenFilter.cs @@ -28,7 +28,7 @@ public CommonGramTokenFilter(string name, IEnumerable commonWords) : bas throw new ArgumentNullException(nameof(commonWords)); } - CommonWords = commonWords.ToArray(); + CommonWords = commonWords.ToList(); ODataType = "#Microsoft.Azure.Search.CommonGramTokenFilter"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/CorsOptions.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/CorsOptions.cs index bfb37bff104a..2425163b0a60 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/CorsOptions.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/CorsOptions.cs @@ -23,7 +23,7 @@ public CorsOptions(IEnumerable allowedOrigins) throw new ArgumentNullException(nameof(allowedOrigins)); } - AllowedOrigins = allowedOrigins.ToArray(); + AllowedOrigins = allowedOrigins.ToList(); } /// Initializes a new instance of CorsOptions. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/DictionaryDecompounderTokenFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/DictionaryDecompounderTokenFilter.cs index 1ebea33973fb..00f1fe7397f5 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/DictionaryDecompounderTokenFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/DictionaryDecompounderTokenFilter.cs @@ -28,7 +28,7 @@ public DictionaryDecompounderTokenFilter(string name, IEnumerable wordLi throw new ArgumentNullException(nameof(wordList)); } - WordList = wordList.ToArray(); + WordList = wordList.ToList(); ODataType = "#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexBatch.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexBatch.cs index 231592a89d15..96c6bc3d35d3 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexBatch.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/IndexBatch.cs @@ -23,7 +23,7 @@ public IndexBatch(IEnumerable actions) throw new ArgumentNullException(nameof(actions)); } - Actions = actions.ToArray(); + Actions = actions.ToList(); } /// Initializes a new instance of IndexBatch. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeepTokenFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeepTokenFilter.cs index c10700e42849..5d6896544e59 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeepTokenFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeepTokenFilter.cs @@ -28,7 +28,7 @@ public KeepTokenFilter(string name, IEnumerable keepWords) : base(name) throw new ArgumentNullException(nameof(keepWords)); } - KeepWords = keepWords.ToArray(); + KeepWords = keepWords.ToList(); ODataType = "#Microsoft.Azure.Search.KeepTokenFilter"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeywordMarkerTokenFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeywordMarkerTokenFilter.cs index 8734c8ef5ea3..7727052f7033 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/KeywordMarkerTokenFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/KeywordMarkerTokenFilter.cs @@ -28,7 +28,7 @@ public KeywordMarkerTokenFilter(string name, IEnumerable keywords) : bas throw new ArgumentNullException(nameof(keywords)); } - Keywords = keywords.ToArray(); + Keywords = keywords.ToList(); ODataType = "#Microsoft.Azure.Search.KeywordMarkerTokenFilter"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/MappingCharFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/MappingCharFilter.cs index cabd7fb0fa77..d441ece0cdff 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/MappingCharFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/MappingCharFilter.cs @@ -28,7 +28,7 @@ public MappingCharFilter(string name, IEnumerable mappings) : base(name) throw new ArgumentNullException(nameof(mappings)); } - Mappings = mappings.ToArray(); + Mappings = mappings.ToList(); ODataType = "#Microsoft.Azure.Search.MappingCharFilter"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/PatternCaptureTokenFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/PatternCaptureTokenFilter.cs index be3034acd171..dabf8af261ab 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/PatternCaptureTokenFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/PatternCaptureTokenFilter.cs @@ -28,7 +28,7 @@ public PatternCaptureTokenFilter(string name, IEnumerable patterns) : ba throw new ArgumentNullException(nameof(patterns)); } - Patterns = patterns.ToArray(); + Patterns = patterns.ToList(); ODataType = "#Microsoft.Azure.Search.PatternCaptureTokenFilter"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs index ebd2e51ff773..bc6bdf79737c 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SearchIndexerSkillset.cs @@ -29,7 +29,7 @@ public SearchIndexerSkillset(string name, IEnumerable skills } Name = name; - Skills = skills.ToArray(); + Skills = skills.ToList(); } /// Initializes a new instance of SearchIndexerSkillset. diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/StemmerOverrideTokenFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/StemmerOverrideTokenFilter.cs index 067520821780..3bb02cd12453 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/StemmerOverrideTokenFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/StemmerOverrideTokenFilter.cs @@ -28,7 +28,7 @@ public StemmerOverrideTokenFilter(string name, IEnumerable rules) : base throw new ArgumentNullException(nameof(rules)); } - Rules = rules.ToArray(); + Rules = rules.ToList(); ODataType = "#Microsoft.Azure.Search.StemmerOverrideTokenFilter"; } diff --git a/sdk/search/Azure.Search.Documents/src/Generated/Models/SynonymTokenFilter.cs b/sdk/search/Azure.Search.Documents/src/Generated/Models/SynonymTokenFilter.cs index e9b7cf6cbd7e..d78a84ef1a73 100644 --- a/sdk/search/Azure.Search.Documents/src/Generated/Models/SynonymTokenFilter.cs +++ b/sdk/search/Azure.Search.Documents/src/Generated/Models/SynonymTokenFilter.cs @@ -28,7 +28,7 @@ public SynonymTokenFilter(string name, IEnumerable synonyms) : base(name throw new ArgumentNullException(nameof(synonyms)); } - Synonyms = synonyms.ToArray(); + Synonyms = synonyms.ToList(); ODataType = "#Microsoft.Azure.Search.SynonymTokenFilter"; } diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/BlobRestoreParameters.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/BlobRestoreParameters.cs index 3da79d32af70..d4c853efbd29 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/BlobRestoreParameters.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/BlobRestoreParameters.cs @@ -25,7 +25,7 @@ public BlobRestoreParameters(DateTimeOffset timeToRestore, IEnumerable Initializes a new instance of BlobRestoreParameters. diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/CorsRule.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/CorsRule.cs index 05f28b673c90..3ffc0ee2c239 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/CorsRule.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/CorsRule.cs @@ -39,11 +39,11 @@ public CorsRule(IEnumerable allowedOrigins, IEnumerable Initializes a new instance of CorsRule. diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/LegalHold.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/LegalHold.cs index c1dda63986b0..50d7d1105541 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/LegalHold.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/LegalHold.cs @@ -23,7 +23,7 @@ public LegalHold(IEnumerable tags) throw new ArgumentNullException(nameof(tags)); } - Tags = tags.ToArray(); + Tags = tags.ToList(); } /// Initializes a new instance of LegalHold. diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicyFilter.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicyFilter.cs index 41bd0ce74996..4e6577ce54a5 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicyFilter.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicyFilter.cs @@ -23,7 +23,7 @@ public ManagementPolicyFilter(IEnumerable blobTypes) throw new ArgumentNullException(nameof(blobTypes)); } - BlobTypes = blobTypes.ToArray(); + BlobTypes = blobTypes.ToList(); } /// Initializes a new instance of ManagementPolicyFilter. diff --git a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicySchema.cs b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicySchema.cs index 524ff2dc6513..8c5394f73684 100644 --- a/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicySchema.cs +++ b/sdk/storage/Azure.ResourceManager.Storage/src/Generated/Models/ManagementPolicySchema.cs @@ -23,7 +23,7 @@ public ManagementPolicySchema(IEnumerable rules) throw new ArgumentNullException(nameof(rules)); } - Rules = rules.ToArray(); + Rules = rules.ToList(); } /// Initializes a new instance of ManagementPolicySchema. diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ActivityDependency.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ActivityDependency.cs index f246498c9b71..1817051f09e7 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ActivityDependency.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ActivityDependency.cs @@ -30,7 +30,7 @@ public ActivityDependency(string activity, IEnumerable depe } Activity = activity; - DependencyConditions = dependencyConditions.ToArray(); + DependencyConditions = dependencyConditions.ToList(); AdditionalProperties = new Dictionary(); } diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ForEachActivity.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ForEachActivity.cs index 493e9a003454..9fba8ca380c7 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ForEachActivity.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/ForEachActivity.cs @@ -34,7 +34,7 @@ public ForEachActivity(string name, Expression items, IEnumerable acti } Items = items; - Activities = activities.ToArray(); + Activities = activities.ToList(); Type = "ForEach"; } diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/HDInsightStreamingActivity.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/HDInsightStreamingActivity.cs index abd3f37a3ec5..761a455e2254 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/HDInsightStreamingActivity.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/HDInsightStreamingActivity.cs @@ -52,7 +52,7 @@ public HDInsightStreamingActivity(string name, object mapper, object reducer, ob Reducer = reducer; Input = input; Output = output; - FilePaths = filePaths.ToArray(); + FilePaths = filePaths.ToList(); Type = "HDInsightStreaming"; } diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Notebook.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Notebook.cs index f9e41e3e9921..5451586c2c39 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Notebook.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Notebook.cs @@ -34,7 +34,7 @@ public Notebook(NotebookMetadata metadata, int nbformat, int nbformatMinor, IEnu Metadata = metadata; Nbformat = nbformat; NbformatMinor = nbformatMinor; - Cells = cells.ToArray(); + Cells = cells.ToList(); AdditionalProperties = new Dictionary(); } diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/NotebookCell.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/NotebookCell.cs index 5690ad9643e3..7d8a653be3e2 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/NotebookCell.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/NotebookCell.cs @@ -36,7 +36,7 @@ public NotebookCell(string cellType, object metadata, IEnumerable source CellType = cellType; Metadata = metadata; - Source = source.ToArray(); + Source = source.ToList(); AdditionalProperties = new Dictionary(); } diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/RunQueryFilter.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/RunQueryFilter.cs index b598b2c5885c..810f43173090 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/RunQueryFilter.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/RunQueryFilter.cs @@ -27,7 +27,7 @@ public RunQueryFilter(RunQueryFilterOperand operand, RunQueryFilterOperator @ope Operand = operand; Operator = @operator; - Values = values.ToArray(); + Values = values.ToList(); } /// Initializes a new instance of RunQueryFilter. diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/UntilActivity.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/UntilActivity.cs index d5b6c4a37aca..0e6c36674e0c 100644 --- a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/UntilActivity.cs +++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/UntilActivity.cs @@ -34,7 +34,7 @@ public UntilActivity(string name, Expression expression, IEnumerable a } Expression = expression; - Activities = activities.ToArray(); + Activities = activities.ToList(); Type = "Until"; } diff --git a/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/KeyCredentialsUpdateParameters.cs b/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/KeyCredentialsUpdateParameters.cs index f90a1b95337f..5c2789f15952 100644 --- a/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/KeyCredentialsUpdateParameters.cs +++ b/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/KeyCredentialsUpdateParameters.cs @@ -23,7 +23,7 @@ public KeyCredentialsUpdateParameters(IEnumerable value) throw new ArgumentNullException(nameof(value)); } - Value = value.ToArray(); + Value = value.ToList(); } /// Initializes a new instance of KeyCredentialsUpdateParameters. diff --git a/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/PasswordCredentialsUpdateParameters.cs b/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/PasswordCredentialsUpdateParameters.cs index cc0dad0fc84d..d97af271a20c 100644 --- a/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/PasswordCredentialsUpdateParameters.cs +++ b/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/PasswordCredentialsUpdateParameters.cs @@ -23,7 +23,7 @@ public PasswordCredentialsUpdateParameters(IEnumerable value throw new ArgumentNullException(nameof(value)); } - Value = value.ToArray(); + Value = value.ToList(); } /// Initializes a new instance of PasswordCredentialsUpdateParameters. diff --git a/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/RequiredResourceAccess.cs b/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/RequiredResourceAccess.cs index ddd8137ac860..ca59b461fab8 100644 --- a/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/RequiredResourceAccess.cs +++ b/sdk/testcommon/Azure.Graph.Rbac/src/Generated/Models/RequiredResourceAccess.cs @@ -24,7 +24,7 @@ public RequiredResourceAccess(IEnumerable resourceAccess) throw new ArgumentNullException(nameof(resourceAccess)); } - ResourceAccess = resourceAccess.ToArray(); + ResourceAccess = resourceAccess.ToList(); AdditionalProperties = new Dictionary(); } diff --git a/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/ContainerServiceSshConfiguration.cs b/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/ContainerServiceSshConfiguration.cs index 0a983d2ea956..89dbbb5ea5ca 100644 --- a/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/ContainerServiceSshConfiguration.cs +++ b/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/ContainerServiceSshConfiguration.cs @@ -23,7 +23,7 @@ public ContainerServiceSshConfiguration(IEnumerable Initializes a new instance of ContainerServiceSshConfiguration. diff --git a/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs b/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs index 957e0011f776..6a9b8960ef6c 100644 --- a/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs +++ b/sdk/testcommon/Azure.Management.Compute.2019_12/src/Generated/Models/VirtualMachineScaleSetVMInstanceRequiredIDs.cs @@ -23,7 +23,7 @@ public VirtualMachineScaleSetVMInstanceRequiredIDs(IEnumerable instanceI throw new ArgumentNullException(nameof(instanceIds)); } - InstanceIds = instanceIds.ToArray(); + InstanceIds = instanceIds.ToList(); } /// Initializes a new instance of VirtualMachineScaleSetVMInstanceRequiredIDs. diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs index ad89babbab42..bc2fc08395c7 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ApplicationGatewayFirewallRuleGroup.cs @@ -29,7 +29,7 @@ public ApplicationGatewayFirewallRuleGroup(string ruleGroupName, IEnumerable Initializes a new instance of ApplicationGatewayFirewallRuleGroup. diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ConnectionMonitorTestGroup.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ConnectionMonitorTestGroup.cs index 1a5b62b168e0..08bc95961db6 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ConnectionMonitorTestGroup.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ConnectionMonitorTestGroup.cs @@ -39,9 +39,9 @@ public ConnectionMonitorTestGroup(string name, IEnumerable testConfigura } Name = name; - TestConfigurations = testConfigurations.ToArray(); - Sources = sources.ToArray(); - Destinations = destinations.ToArray(); + TestConfigurations = testConfigurations.ToList(); + Sources = sources.ToList(); + Destinations = destinations.ToList(); } /// Initializes a new instance of ConnectionMonitorTestGroup. diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/HubRoute.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/HubRoute.cs index a2bcbed560c7..840340e1b7ef 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/HubRoute.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/HubRoute.cs @@ -45,7 +45,7 @@ public HubRoute(string name, string destinationType, IEnumerable destina Name = name; DestinationType = destinationType; - Destinations = destinations.ToArray(); + Destinations = destinations.ToList(); NextHopType = nextHopType; NextHop = nextHop; } diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ManagedRulesDefinition.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ManagedRulesDefinition.cs index 2b58adc5f342..5f145588ee00 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ManagedRulesDefinition.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/ManagedRulesDefinition.cs @@ -23,7 +23,7 @@ public ManagedRulesDefinition(IEnumerable managedRuleSets) throw new ArgumentNullException(nameof(managedRuleSets)); } - ManagedRuleSets = managedRuleSets.ToArray(); + ManagedRuleSets = managedRuleSets.ToList(); } /// Initializes a new instance of ManagedRulesDefinition. diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/MatchCondition.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/MatchCondition.cs index f3e606f1a1b8..5bb209d949b3 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/MatchCondition.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/MatchCondition.cs @@ -29,9 +29,9 @@ public MatchCondition(IEnumerable matchVariables, WebApplicationF throw new ArgumentNullException(nameof(matchValues)); } - MatchVariables = matchVariables.ToArray(); + MatchVariables = matchVariables.ToList(); Operator = @operator; - MatchValues = matchValues.ToArray(); + MatchValues = matchValues.ToList(); } /// Initializes a new instance of MatchCondition. diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs index c065a8450091..301c70e1cb4b 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/NetworkConfigurationDiagnosticParameters.cs @@ -29,7 +29,7 @@ public NetworkConfigurationDiagnosticParameters(string targetResourceId, IEnumer } TargetResourceId = targetResourceId; - Profiles = profiles.ToArray(); + Profiles = profiles.ToList(); } /// Initializes a new instance of NetworkConfigurationDiagnosticParameters. diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/TrafficSelectorPolicy.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/TrafficSelectorPolicy.cs index 86ac98c4d6d3..d164e7614d45 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/TrafficSelectorPolicy.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/TrafficSelectorPolicy.cs @@ -28,8 +28,8 @@ public TrafficSelectorPolicy(IEnumerable localAddressRanges, IEnumerable throw new ArgumentNullException(nameof(remoteAddressRanges)); } - LocalAddressRanges = localAddressRanges.ToArray(); - RemoteAddressRanges = remoteAddressRanges.ToArray(); + LocalAddressRanges = localAddressRanges.ToList(); + RemoteAddressRanges = remoteAddressRanges.ToList(); } /// Initializes a new instance of TrafficSelectorPolicy. diff --git a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/WebApplicationFirewallCustomRule.cs b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/WebApplicationFirewallCustomRule.cs index 2093fd5a3293..fd896fbf6e06 100644 --- a/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/WebApplicationFirewallCustomRule.cs +++ b/sdk/testcommon/Azure.Management.Network.2020_04/src/Generated/Models/WebApplicationFirewallCustomRule.cs @@ -28,7 +28,7 @@ public WebApplicationFirewallCustomRule(int priority, WebApplicationFirewallRule Priority = priority; RuleType = ruleType; - MatchConditions = matchConditions.ToArray(); + MatchConditions = matchConditions.ToList(); Action = action; } diff --git a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/BlobRestoreParameters.cs b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/BlobRestoreParameters.cs index ae201189318e..8195dfc13e7e 100644 --- a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/BlobRestoreParameters.cs +++ b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/BlobRestoreParameters.cs @@ -25,7 +25,7 @@ public BlobRestoreParameters(DateTimeOffset timeToRestore, IEnumerable Initializes a new instance of BlobRestoreParameters. diff --git a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/CorsRule.cs b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/CorsRule.cs index 721d2ead4b76..9ffbfdd00cc9 100644 --- a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/CorsRule.cs +++ b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/CorsRule.cs @@ -39,11 +39,11 @@ public CorsRule(IEnumerable allowedOrigins, IEnumerable Initializes a new instance of CorsRule. diff --git a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/LegalHold.cs b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/LegalHold.cs index 9824a781fbc4..666a334e5a4b 100644 --- a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/LegalHold.cs +++ b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/LegalHold.cs @@ -23,7 +23,7 @@ public LegalHold(IEnumerable tags) throw new ArgumentNullException(nameof(tags)); } - Tags = tags.ToArray(); + Tags = tags.ToList(); } /// Initializes a new instance of LegalHold. diff --git a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicyFilter.cs b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicyFilter.cs index fbe40faefb87..569a5d69e684 100644 --- a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicyFilter.cs +++ b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicyFilter.cs @@ -23,7 +23,7 @@ public ManagementPolicyFilter(IEnumerable blobTypes) throw new ArgumentNullException(nameof(blobTypes)); } - BlobTypes = blobTypes.ToArray(); + BlobTypes = blobTypes.ToList(); } /// Initializes a new instance of ManagementPolicyFilter. diff --git a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicySchema.cs b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicySchema.cs index 505aac1e354d..03bf4179c9dc 100644 --- a/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicySchema.cs +++ b/sdk/testcommon/Azure.Management.Storage.2019_06/src/Generated/Models/ManagementPolicySchema.cs @@ -23,7 +23,7 @@ public ManagementPolicySchema(IEnumerable rules) throw new ArgumentNullException(nameof(rules)); } - Rules = rules.ToArray(); + Rules = rules.ToList(); } /// Initializes a new instance of ManagementPolicySchema.