From 1e3b013b9f75e63adbd739e99ab9c65be9363050 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 9 Mar 2021 00:47:31 +0000 Subject: [PATCH] Update AutoRest C# version to 3.0.0-beta.20210308.3 --- eng/Packages.Data.props | 2 +- .../EncryptionProperties.Serialization.cs | 13 +- ...csChatEventBaseProperties.Serialization.cs | 62 +++++++++ .../Models/AcsChatEventBaseProperties.cs | 36 +++++ ...atMessageDeletedEventData.Serialization.cs | 124 +++++++++++++++++ .../Models/AcsChatMessageDeletedEventData.cs | 39 ++++++ ...hatMessageEditedEventData.Serialization.cs | 130 ++++++++++++++++++ .../Models/AcsChatMessageEditedEventData.cs | 43 ++++++ ...essageEventBaseProperties.Serialization.cs | 113 +++++++++++++++ .../AcsChatMessageEventBaseProperties.cs | 53 +++++++ ...tMessageReceivedEventData.Serialization.cs | 119 ++++++++++++++++ .../Models/AcsChatMessageReceivedEventData.cs | 39 ++++++ ...dCreatedWithUserEventData.Serialization.cs | 128 +++++++++++++++++ .../AcsChatThreadCreatedWithUserEventData.cs | 47 +++++++ ...ThreadEventBaseProperties.Serialization.cs | 84 +++++++++++ .../AcsChatThreadEventBaseProperties.cs | 37 +++++ ...esUpdatedPerUserEventData.Serialization.cs | 123 +++++++++++++++++ ...ThreadPropertiesUpdatedPerUserEventData.cs | 46 +++++++ ...dWithUserDeletedEventData.Serialization.cs | 106 ++++++++++++++ .../AcsChatThreadWithUserDeletedEventData.cs | 39 ++++++ .../AlertingResultQuery.Serialization.cs | 2 +- .../Generated/Models/AlertingResultQuery.cs | 2 +- .../Models/AnomalyAlert.Serialization.cs | 25 +++- .../src/Generated/Models/AnomalyAlert.cs | 11 +- ...AlertingConfigurationList.Serialization.cs | 2 +- .../AnomalyAlertingConfigurationList.cs | 2 +- ...etectionConfigurationList.Serialization.cs | 2 +- .../AnomalyDetectionConfigurationList.cs | 2 +- .../AnomalyDimensionQuery.Serialization.cs | 2 +- .../Generated/Models/AnomalyDimensionQuery.cs | 2 +- .../AnomalyFeedbackValue.Serialization.cs | 2 +- .../Generated/Models/AnomalyFeedbackValue.cs | 2 +- .../Models/AnomalyProperty.Serialization.cs | 2 +- .../src/Generated/Models/AnomalyProperty.cs | 2 +- ...plicationInsightsDataFeed.Serialization.cs | 17 +-- .../AzureApplicationInsightsDataFeed.cs | 2 +- ...tionInsightsDataFeedPatch.Serialization.cs | 2 +- .../AzureApplicationInsightsDataFeedPatch.cs | 2 +- ...licationInsightsParameter.Serialization.cs | 66 ++------- .../AzureApplicationInsightsParameter.cs | 22 ++- .../Models/AzureBlobDataFeed.Serialization.cs | 17 +-- .../src/Generated/Models/AzureBlobDataFeed.cs | 2 +- .../AzureBlobDataFeedPatch.Serialization.cs | 2 +- .../Models/AzureBlobDataFeedPatch.cs | 2 +- .../AzureBlobParameter.Serialization.cs | 50 +------ .../Generated/Models/AzureBlobParameter.cs | 18 ++- .../AzureCosmosDBDataFeed.Serialization.cs | 17 +-- .../Generated/Models/AzureCosmosDBDataFeed.cs | 2 +- ...zureCosmosDBDataFeedPatch.Serialization.cs | 2 +- .../Models/AzureCosmosDBDataFeedPatch.cs | 2 +- .../AzureCosmosDBParameter.Serialization.cs | 66 ++------- .../Models/AzureCosmosDBParameter.cs | 22 ++- ...AzureDataExplorerDataFeed.Serialization.cs | 17 +-- .../Models/AzureDataExplorerDataFeed.cs | 2 +- ...DataExplorerDataFeedPatch.Serialization.cs | 2 +- .../Models/AzureDataExplorerDataFeedPatch.cs | 2 +- ...taLakeStorageGen2DataFeed.Serialization.cs | 17 +-- .../AzureDataLakeStorageGen2DataFeed.cs | 2 +- ...eStorageGen2DataFeedPatch.Serialization.cs | 2 +- .../AzureDataLakeStorageGen2DataFeedPatch.cs | 2 +- ...aLakeStorageGen2Parameter.Serialization.cs | 82 ++--------- .../AzureDataLakeStorageGen2Parameter.cs | 26 +++- .../AzureTableDataFeed.Serialization.cs | 17 +-- .../Generated/Models/AzureTableDataFeed.cs | 2 +- .../AzureTableDataFeedPatch.Serialization.cs | 2 +- .../Models/AzureTableDataFeedPatch.cs | 2 +- .../AzureTableParameter.Serialization.cs | 50 +------ .../Generated/Models/AzureTableParameter.cs | 18 ++- .../ChangePointFeedbackValue.Serialization.cs | 2 +- .../Models/ChangePointFeedbackValue.cs | 2 +- .../CommentFeedbackValue.Serialization.cs | 2 +- .../Generated/Models/CommentFeedbackValue.cs | 2 +- .../Models/DataFeedDetail.Serialization.cs | 15 +- ...DataFeedIngestionProgress.Serialization.cs | 8 +- .../DataFeedIngestionStatus.Serialization.cs | 18 ++- .../Models/DataFeedIngestionStatus.cs | 11 +- ...ionAnomalyFilterCondition.Serialization.cs | 2 +- .../Models/DetectionAnomalyFilterCondition.cs | 2 +- ...tectionAnomalyResultQuery.Serialization.cs | 2 +- .../Models/DetectionAnomalyResultQuery.cs | 2 +- ...onIncidentFilterCondition.Serialization.cs | 2 +- .../DetectionIncidentFilterCondition.cs | 2 +- ...ectionIncidentResultQuery.Serialization.cs | 2 +- .../Models/DetectionIncidentResultQuery.cs | 2 +- .../DetectionSeriesQuery.Serialization.cs | 2 +- .../Generated/Models/DetectionSeriesQuery.cs | 2 +- .../ElasticsearchDataFeed.Serialization.cs | 17 +-- .../Generated/Models/ElasticsearchDataFeed.cs | 2 +- ...lasticsearchDataFeedPatch.Serialization.cs | 2 +- .../Models/ElasticsearchDataFeedPatch.cs | 2 +- .../ElasticsearchParameter.Serialization.cs | 66 ++------- .../Models/ElasticsearchParameter.cs | 22 ++- .../EmailHookInfoPatch.Serialization.cs | 2 +- .../Generated/Models/EmailHookInfoPatch.cs | 2 +- .../EmailHookParameter.Serialization.cs | 2 +- .../Generated/Models/EmailHookParameter.cs | 2 +- .../Models/EnrichmentStatus.Serialization.cs | 13 +- .../src/Generated/Models/EnrichmentStatus.cs | 15 +- ...richmentStatusQueryOption.Serialization.cs | 2 +- .../Models/EnrichmentStatusQueryOption.cs | 2 +- .../HttpRequestDataFeed.Serialization.cs | 17 +-- .../Generated/Models/HttpRequestDataFeed.cs | 2 +- .../HttpRequestDataFeedPatch.Serialization.cs | 2 +- .../Models/HttpRequestDataFeedPatch.cs | 2 +- .../HttpRequestParameter.Serialization.cs | 66 ++------- .../Generated/Models/HttpRequestParameter.cs | 22 ++- .../Models/IncidentProperty.Serialization.cs | 2 +- .../src/Generated/Models/IncidentProperty.cs | 2 +- .../Models/InfluxDBDataFeed.Serialization.cs | 17 +-- .../src/Generated/Models/InfluxDBDataFeed.cs | 2 +- .../InfluxDBDataFeedPatch.Serialization.cs | 2 +- .../Generated/Models/InfluxDBDataFeedPatch.cs | 2 +- .../Models/InfluxDBParameter.Serialization.cs | 82 ++--------- .../src/Generated/Models/InfluxDBParameter.cs | 26 +++- ...stionProgressResetOptions.Serialization.cs | 2 +- .../Models/IngestionProgressResetOptions.cs | 2 +- ...gestionStatusQueryOptions.Serialization.cs | 2 +- .../Models/IngestionStatusQueryOptions.cs | 2 +- .../MetricAnomalyFeedback.Serialization.cs | 29 +--- .../MetricCommentFeedback.Serialization.cs | 30 ++-- .../Models/MetricDataList.Serialization.cs | 2 +- .../src/Generated/Models/MetricDataList.cs | 2 +- .../MetricDataQueryOptions.Serialization.cs | 2 +- .../Models/MetricDataQueryOptions.cs | 2 +- ...tricDimensionQueryOptions.Serialization.cs | 2 +- .../Models/MetricDimensionQueryOptions.cs | 2 +- .../MetricFeedbackFilter.Serialization.cs | 2 +- .../Generated/Models/MetricFeedbackFilter.cs | 2 +- .../Models/MetricSeriesData.Serialization.cs | 23 +++- .../src/Generated/Models/MetricSeriesData.cs | 26 +--- .../MetricSeriesDefinition.Serialization.cs | 11 +- .../Models/MetricSeriesDefinition.cs | 18 +-- .../MetricSeriesQueryOptions.Serialization.cs | 2 +- .../Models/MetricSeriesQueryOptions.cs | 2 +- .../Models/MongoDBDataFeed.Serialization.cs | 17 +-- .../src/Generated/Models/MongoDBDataFeed.cs | 2 +- .../MongoDBDataFeedPatch.Serialization.cs | 2 +- .../Generated/Models/MongoDBDataFeedPatch.cs | 2 +- .../Models/MongoDBParameter.Serialization.cs | 50 +------ .../src/Generated/Models/MongoDBParameter.cs | 18 ++- .../Models/MySqlDataFeed.Serialization.cs | 17 +-- .../src/Generated/Models/MySqlDataFeed.cs | 2 +- .../MySqlDataFeedPatch.Serialization.cs | 2 +- .../Generated/Models/MySqlDataFeedPatch.cs | 2 +- .../PeriodFeedbackValue.Serialization.cs | 2 +- .../Generated/Models/PeriodFeedbackValue.cs | 2 +- .../PostgreSqlDataFeed.Serialization.cs | 17 +-- .../Generated/Models/PostgreSqlDataFeed.cs | 2 +- .../PostgreSqlDataFeedPatch.Serialization.cs | 2 +- .../Models/PostgreSqlDataFeedPatch.cs | 2 +- .../Models/RootCauseList.Serialization.cs | 2 +- .../src/Generated/Models/RootCauseList.cs | 2 +- .../Models/SQLServerDataFeed.Serialization.cs | 17 +-- .../src/Generated/Models/SQLServerDataFeed.cs | 2 +- .../SQLServerDataFeedPatch.Serialization.cs | 2 +- .../Models/SQLServerDataFeedPatch.cs | 2 +- .../Models/SeriesIdentity.Serialization.cs | 2 +- .../src/Generated/Models/SeriesIdentity.cs | 2 +- .../Models/SeriesResultList.Serialization.cs | 2 +- .../src/Generated/Models/SeriesResultList.cs | 2 +- .../SeverityFilterCondition.Serialization.cs | 2 +- .../Models/SeverityFilterCondition.cs | 2 +- .../SqlSourceParameter.Serialization.cs | 34 +---- .../Generated/Models/SqlSourceParameter.cs | 14 +- .../Models/UsageStats.Serialization.cs | 2 +- .../src/Generated/Models/UsageStats.cs | 2 +- .../WebhookHookInfoPatch.Serialization.cs | 2 +- .../Generated/Models/WebhookHookInfoPatch.cs | 2 +- .../src/Generated/ContainerRestClient.cs | 1 - .../src/Generated/ServiceRestClient.cs | 1 - .../DetectedLanguageInternal.Serialization.cs | 10 -- .../Models/DetectedLanguageInternal.cs | 12 ++ .../Models/DocumentEntities.Serialization.cs | 2 +- .../src/Generated/Models/DocumentEntities.cs | 2 +- .../Models/DocumentError.Serialization.cs | 2 +- .../src/Generated/Models/DocumentError.cs | 2 +- .../DocumentKeyPhrases.Serialization.cs | 2 +- .../Generated/Models/DocumentKeyPhrases.cs | 2 +- .../Models/DocumentLanguage.Serialization.cs | 2 +- .../src/Generated/Models/DocumentLanguage.cs | 2 +- .../DocumentLinkedEntities.Serialization.cs | 2 +- .../Models/DocumentLinkedEntities.cs | 2 +- .../Models/EntitiesResult.Serialization.cs | 2 +- .../src/Generated/Models/EntitiesResult.cs | 2 +- .../Models/EntitiesTask.Serialization.cs | 2 +- .../src/Generated/Models/EntitiesTask.cs | 2 +- .../Generated/Models/Entity.Serialization.cs | 2 +- .../src/Generated/Models/Entity.cs | 2 +- .../EntityLinkingResult.Serialization.cs | 2 +- .../Generated/Models/EntityLinkingResult.cs | 2 +- .../Models/EntityLinkingTask.Serialization.cs | 2 +- .../src/Generated/Models/EntityLinkingTask.cs | 2 +- .../Models/JobDescriptor.Serialization.cs | 2 +- .../src/Generated/Models/JobDescriptor.cs | 2 +- .../Models/JobManifest.Serialization.cs | 2 +- .../src/Generated/Models/JobManifest.cs | 2 +- .../Models/KeyPhraseResult.Serialization.cs | 2 +- .../src/Generated/Models/KeyPhraseResult.cs | 2 +- .../Models/KeyPhrasesTask.Serialization.cs | 2 +- .../src/Generated/Models/KeyPhrasesTask.cs | 2 +- .../LanguageBatchInput.Serialization.cs | 2 +- .../Generated/Models/LanguageBatchInput.cs | 2 +- .../Models/LanguageInput.Serialization.cs | 24 +--- .../src/Generated/Models/LanguageInput.cs | 14 +- .../Models/LanguageResult.Serialization.cs | 2 +- .../src/Generated/Models/LanguageResult.cs | 2 +- .../MultiLanguageBatchInput.Serialization.cs | 2 +- .../Models/MultiLanguageBatchInput.cs | 2 +- .../MultiLanguageInput.Serialization.cs | 2 +- .../Generated/Models/MultiLanguageInput.cs | 2 +- .../PiiDocumentEntities.Serialization.cs | 2 +- .../Generated/Models/PiiDocumentEntities.cs | 2 +- .../Generated/Models/PiiTask.Serialization.cs | 2 +- .../src/Generated/Models/PiiTask.cs | 2 +- .../Models/SentimentResponse.Serialization.cs | 2 +- .../src/Generated/Models/SentimentResponse.cs | 2 +- ...argetConfidenceScoreLabel.Serialization.cs | 2 +- .../Models/TargetConfidenceScoreLabel.cs | 2 +- .../Models/TargetRelation.Serialization.cs | 2 +- .../src/Generated/Models/TargetRelation.cs | 2 +- ...pdateModelSettingsRequest.Serialization.cs | 2 +- .../Models/UpdateModelSettingsRequest.cs | 2 +- 222 files changed, 2015 insertions(+), 1022 deletions(-) create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.Serialization.cs create mode 100644 sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.cs diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 15773960760fb..c659de8861aea 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -122,7 +122,7 @@ All should have PrivateAssets="All" set so they don't become pacakge dependencies --> - + diff --git a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/EncryptionProperties.Serialization.cs b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/EncryptionProperties.Serialization.cs index 72bf76ae53acd..f4dc80cff3d15 100644 --- a/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/EncryptionProperties.Serialization.cs +++ b/sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/src/Generated/Models/EncryptionProperties.Serialization.cs @@ -17,15 +17,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); if (Optional.IsDefined(KeyVaultProperties)) { - if (KeyVaultProperties != null) - { - writer.WritePropertyName("keyVaultProperties"); - writer.WriteObjectValue(KeyVaultProperties); - } - else - { - writer.WriteNull("keyVaultProperties"); - } + writer.WritePropertyName("keyVaultProperties"); + writer.WriteObjectValue(KeyVaultProperties); } writer.WriteEndObject(); } @@ -39,7 +32,7 @@ internal static EncryptionProperties DeserializeEncryptionProperties(JsonElement { if (property.Value.ValueKind == JsonValueKind.Null) { - keyVaultProperties = null; + property.ThrowNonNullablePropertyIsNull(); continue; } keyVaultProperties = KeyVaultProperties.DeserializeKeyVaultProperties(property.Value); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.Serialization.cs new file mode 100644 index 0000000000000..b29b3cf06d6d2 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatEventBasePropertiesConverter))] + public partial class AcsChatEventBaseProperties + { + internal static AcsChatEventBaseProperties DeserializeAcsChatEventBaseProperties(JsonElement element) + { + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatEventBaseProperties(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value); + } + + internal partial class AcsChatEventBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatEventBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatEventBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatEventBaseProperties(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.cs new file mode 100644 index 0000000000000..27560ad8f0e7f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatEventBaseProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all chat events. + public partial class AcsChatEventBaseProperties + { + /// Initializes a new instance of AcsChatEventBaseProperties. + internal AcsChatEventBaseProperties() + { + } + + /// Initializes a new instance of AcsChatEventBaseProperties. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + internal AcsChatEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId) + { + RecipientCommunicationIdentifier = recipientCommunicationIdentifier; + TransactionId = transactionId; + ThreadId = threadId; + } + + /// The communication identifier of the target user. + public CommunicationIdentifierModel RecipientCommunicationIdentifier { get; } + /// The transaction id will be used as co-relation vector. + public string TransactionId { get; } + /// The chat thread id. + public string ThreadId { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.Serialization.cs new file mode 100644 index 0000000000000..2ea45fe808fda --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatMessageDeletedEventDataConverter))] + public partial class AcsChatMessageDeletedEventData + { + internal static AcsChatMessageDeletedEventData DeserializeAcsChatMessageDeletedEventData(JsonElement element) + { + Optional deleteTime = default; + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deleteTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + deleteTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageDeletedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), Optional.ToNullable(deleteTime)); + } + + internal partial class AcsChatMessageDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageDeletedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.cs new file mode 100644 index 0000000000000..712ed1e81f740 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageDeletedEventData.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. + public partial class AcsChatMessageDeletedEventData : AcsChatMessageEventBaseProperties + { + /// Initializes a new instance of AcsChatMessageDeletedEventData. + internal AcsChatMessageDeletedEventData() + { + } + + /// Initializes a new instance of AcsChatMessageDeletedEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + /// The time at which the message was deleted. + internal AcsChatMessageDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + { + DeleteTime = deleteTime; + } + + /// The time at which the message was deleted. + public DateTimeOffset? DeleteTime { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.Serialization.cs new file mode 100644 index 0000000000000..49eb6c710ae42 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.Serialization.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatMessageEditedEventDataConverter))] + public partial class AcsChatMessageEditedEventData + { + internal static AcsChatMessageEditedEventData DeserializeAcsChatMessageEditedEventData(JsonElement element) + { + Optional messageBody = default; + Optional editTime = default; + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageBody")) + { + messageBody = property.Value.GetString(); + continue; + } + if (property.NameEquals("editTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + editTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageEditedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value, Optional.ToNullable(editTime)); + } + + internal partial class AcsChatMessageEditedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageEditedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageEditedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEditedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.cs new file mode 100644 index 0000000000000..8000fc1626d05 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEditedEventData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEdited event. + public partial class AcsChatMessageEditedEventData : AcsChatMessageEventBaseProperties + { + /// Initializes a new instance of AcsChatMessageEditedEventData. + internal AcsChatMessageEditedEventData() + { + } + + /// Initializes a new instance of AcsChatMessageEditedEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + /// The body of the chat message. + /// The time at which the message was edited. + internal AcsChatMessageEditedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody, DateTimeOffset? editTime) : base(recipientCommunicationIdentifier, transactionId, threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + { + MessageBody = messageBody; + EditTime = editTime; + } + + /// The body of the chat message. + public string MessageBody { get; } + /// The time at which the message was edited. + public DateTimeOffset? EditTime { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.Serialization.cs new file mode 100644 index 0000000000000..237a3af54bf10 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.Serialization.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatMessageEventBasePropertiesConverter))] + public partial class AcsChatMessageEventBaseProperties + { + internal static AcsChatMessageEventBaseProperties DeserializeAcsChatMessageEventBaseProperties(JsonElement element) + { + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageEventBaseProperties(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version)); + } + + internal partial class AcsChatMessageEventBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageEventBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageEventBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageEventBaseProperties(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.cs new file mode 100644 index 0000000000000..9374bf1aa61ad --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageEventBaseProperties.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all chat message events. + public partial class AcsChatMessageEventBaseProperties : AcsChatEventBaseProperties + { + /// Initializes a new instance of AcsChatMessageEventBaseProperties. + internal AcsChatMessageEventBaseProperties() + { + } + + /// Initializes a new instance of AcsChatMessageEventBaseProperties. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + internal AcsChatMessageEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId) + { + MessageId = messageId; + SenderCommunicationIdentifier = senderCommunicationIdentifier; + SenderDisplayName = senderDisplayName; + ComposeTime = composeTime; + Type = type; + Version = version; + } + + /// The chat message id. + public string MessageId { get; } + /// The communication identifier of the sender. + public CommunicationIdentifierModel SenderCommunicationIdentifier { get; } + /// The display name of the sender. + public string SenderDisplayName { get; } + /// The original compose time of the message. + public DateTimeOffset? ComposeTime { get; } + /// The type of the message. + public string Type { get; } + /// The version of the message. + public long? Version { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.Serialization.cs new file mode 100644 index 0000000000000..c4277956225a6 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatMessageReceivedEventDataConverter))] + public partial class AcsChatMessageReceivedEventData + { + internal static AcsChatMessageReceivedEventData DeserializeAcsChatMessageReceivedEventData(JsonElement element) + { + Optional messageBody = default; + Optional messageId = default; + Optional senderCommunicationIdentifier = default; + Optional senderDisplayName = default; + Optional composeTime = default; + Optional type = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("messageBody")) + { + messageBody = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageId")) + { + messageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("senderCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + senderCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("senderDisplayName")) + { + senderDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("composeTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + composeTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("type")) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatMessageReceivedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, messageId.Value, senderCommunicationIdentifier.Value, senderDisplayName.Value, Optional.ToNullable(composeTime), type.Value, Optional.ToNullable(version), messageBody.Value); + } + + internal partial class AcsChatMessageReceivedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatMessageReceivedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatMessageReceivedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatMessageReceivedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.cs new file mode 100644 index 0000000000000..712b2a9665469 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatMessageReceivedEventData.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event. + public partial class AcsChatMessageReceivedEventData : AcsChatMessageEventBaseProperties + { + /// Initializes a new instance of AcsChatMessageReceivedEventData. + internal AcsChatMessageReceivedEventData() + { + } + + /// Initializes a new instance of AcsChatMessageReceivedEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The chat message id. + /// The communication identifier of the sender. + /// The display name of the sender. + /// The original compose time of the message. + /// The type of the message. + /// The version of the message. + /// The body of the chat message. + internal AcsChatMessageReceivedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, string messageId, CommunicationIdentifierModel senderCommunicationIdentifier, string senderDisplayName, DateTimeOffset? composeTime, string type, long? version, string messageBody) : base(recipientCommunicationIdentifier, transactionId, threadId, messageId, senderCommunicationIdentifier, senderDisplayName, composeTime, type, version) + { + MessageBody = messageBody; + } + + /// The body of the chat message. + public string MessageBody { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.Serialization.cs new file mode 100644 index 0000000000000..aa189cdb0b59e --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatThreadCreatedWithUserEventDataConverter))] + public partial class AcsChatThreadCreatedWithUserEventData + { + internal static AcsChatThreadCreatedWithUserEventData DeserializeAcsChatThreadCreatedWithUserEventData(JsonElement element) + { + Optional createdByCommunicationIdentifier = default; + Optional> properties = default; + Optional> participants = default; + Optional createTime = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createdByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + properties = dictionary; + continue; + } + if (property.NameEquals("participants")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AcsChatThreadParticipantProperties.DeserializeAcsChatThreadParticipantProperties(item)); + } + participants = array; + continue; + } + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatThreadCreatedWithUserEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), createdByCommunicationIdentifier.Value, Optional.ToDictionary(properties), Optional.ToList(participants)); + } + + internal partial class AcsChatThreadCreatedWithUserEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadCreatedWithUserEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadCreatedWithUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadCreatedWithUserEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.cs new file mode 100644 index 0000000000000..92654cd6b4aa0 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadCreatedWithUserEventData.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; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. + public partial class AcsChatThreadCreatedWithUserEventData : AcsChatThreadEventBaseProperties + { + /// Initializes a new instance of AcsChatThreadCreatedWithUserEventData. + internal AcsChatThreadCreatedWithUserEventData() + { + Properties = new ChangeTrackingDictionary(); + Participants = new ChangeTrackingList(); + } + + /// Initializes a new instance of AcsChatThreadCreatedWithUserEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The communication identifier of the user who created the thread. + /// The thread properties. + /// The list of properties of participants who are part of the thread. + internal AcsChatThreadCreatedWithUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel createdByCommunicationIdentifier, IReadOnlyDictionary properties, IReadOnlyList participants) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) + { + CreatedByCommunicationIdentifier = createdByCommunicationIdentifier; + Properties = properties; + Participants = participants; + } + + /// The communication identifier of the user who created the thread. + public CommunicationIdentifierModel CreatedByCommunicationIdentifier { get; } + /// The thread properties. + public IReadOnlyDictionary Properties { get; } + /// The list of properties of participants who are part of the thread. + public IReadOnlyList Participants { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.Serialization.cs new file mode 100644 index 0000000000000..a6c60226bde28 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatThreadEventBasePropertiesConverter))] + public partial class AcsChatThreadEventBaseProperties + { + internal static AcsChatThreadEventBaseProperties DeserializeAcsChatThreadEventBaseProperties(JsonElement element) + { + Optional createTime = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatThreadEventBaseProperties(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version)); + } + + internal partial class AcsChatThreadEventBasePropertiesConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadEventBaseProperties model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadEventBaseProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadEventBaseProperties(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.cs new file mode 100644 index 0000000000000..b4aad4a5af7e6 --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadEventBaseProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of common properties of all chat thread events. + public partial class AcsChatThreadEventBaseProperties : AcsChatEventBaseProperties + { + /// Initializes a new instance of AcsChatThreadEventBaseProperties. + internal AcsChatThreadEventBaseProperties() + { + } + + /// Initializes a new instance of AcsChatThreadEventBaseProperties. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + internal AcsChatThreadEventBaseProperties(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version) : base(recipientCommunicationIdentifier, transactionId, threadId) + { + CreateTime = createTime; + Version = version; + } + + /// The original creation time of the thread. + public DateTimeOffset? CreateTime { get; } + /// The version of the thread. + public long? Version { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs new file mode 100644 index 0000000000000..de4014293537a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.Serialization.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatThreadPropertiesUpdatedPerUserEventDataConverter))] + public partial class AcsChatThreadPropertiesUpdatedPerUserEventData + { + internal static AcsChatThreadPropertiesUpdatedPerUserEventData DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(JsonElement element) + { + Optional editedByCommunicationIdentifier = default; + Optional editTime = default; + Optional> properties = default; + Optional createTime = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("editedByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + editedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("editTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + editTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetObject()); + } + properties = dictionary; + continue; + } + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatThreadPropertiesUpdatedPerUserEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), editedByCommunicationIdentifier.Value, Optional.ToNullable(editTime), Optional.ToDictionary(properties)); + } + + internal partial class AcsChatThreadPropertiesUpdatedPerUserEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadPropertiesUpdatedPerUserEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadPropertiesUpdatedPerUserEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadPropertiesUpdatedPerUserEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.cs new file mode 100644 index 0000000000000..6fb96769eea0d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadPropertiesUpdatedPerUserEventData.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. + public partial class AcsChatThreadPropertiesUpdatedPerUserEventData : AcsChatThreadEventBaseProperties + { + /// Initializes a new instance of AcsChatThreadPropertiesUpdatedPerUserEventData. + internal AcsChatThreadPropertiesUpdatedPerUserEventData() + { + Properties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AcsChatThreadPropertiesUpdatedPerUserEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The communication identifier of the user who updated the thread properties. + /// The time at which the properties of the thread were updated. + /// The updated thread properties. + internal AcsChatThreadPropertiesUpdatedPerUserEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel editedByCommunicationIdentifier, DateTimeOffset? editTime, IReadOnlyDictionary properties) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) + { + EditedByCommunicationIdentifier = editedByCommunicationIdentifier; + EditTime = editTime; + Properties = properties; + } + + /// The communication identifier of the user who updated the thread properties. + public CommunicationIdentifierModel EditedByCommunicationIdentifier { get; } + /// The time at which the properties of the thread were updated. + public DateTimeOffset? EditTime { get; } + /// The updated thread properties. + public IReadOnlyDictionary Properties { get; } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.Serialization.cs new file mode 100644 index 0000000000000..4c2383686fe3d --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.Core; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + [JsonConverter(typeof(AcsChatThreadWithUserDeletedEventDataConverter))] + public partial class AcsChatThreadWithUserDeletedEventData + { + internal static AcsChatThreadWithUserDeletedEventData DeserializeAcsChatThreadWithUserDeletedEventData(JsonElement element) + { + Optional deletedByCommunicationIdentifier = default; + Optional deleteTime = default; + Optional createTime = default; + Optional version = default; + Optional recipientCommunicationIdentifier = default; + Optional transactionId = default; + Optional threadId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deletedByCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + deletedByCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("deleteTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + deleteTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("createTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + createTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("version")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + version = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recipientCommunicationIdentifier")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + recipientCommunicationIdentifier = CommunicationIdentifierModel.DeserializeCommunicationIdentifierModel(property.Value); + continue; + } + if (property.NameEquals("transactionId")) + { + transactionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("threadId")) + { + threadId = property.Value.GetString(); + continue; + } + } + return new AcsChatThreadWithUserDeletedEventData(recipientCommunicationIdentifier.Value, transactionId.Value, threadId.Value, Optional.ToNullable(createTime), Optional.ToNullable(version), deletedByCommunicationIdentifier.Value, Optional.ToNullable(deleteTime)); + } + + internal partial class AcsChatThreadWithUserDeletedEventDataConverter : JsonConverter + { + public override void Write(Utf8JsonWriter writer, AcsChatThreadWithUserDeletedEventData model, JsonSerializerOptions options) + { + writer.WriteObjectValue(model); + } + public override AcsChatThreadWithUserDeletedEventData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + return DeserializeAcsChatThreadWithUserDeletedEventData(document.RootElement); + } + } + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.cs new file mode 100644 index 0000000000000..ae12d8b62461f --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/AcsChatThreadWithUserDeletedEventData.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadWithUserDeleted event. + public partial class AcsChatThreadWithUserDeletedEventData : AcsChatThreadEventBaseProperties + { + /// Initializes a new instance of AcsChatThreadWithUserDeletedEventData. + internal AcsChatThreadWithUserDeletedEventData() + { + } + + /// Initializes a new instance of AcsChatThreadWithUserDeletedEventData. + /// The communication identifier of the target user. + /// The transaction id will be used as co-relation vector. + /// The chat thread id. + /// The original creation time of the thread. + /// The version of the thread. + /// The communication identifier of the user who deleted the thread. + /// The deletion time of the thread. + internal AcsChatThreadWithUserDeletedEventData(CommunicationIdentifierModel recipientCommunicationIdentifier, string transactionId, string threadId, DateTimeOffset? createTime, long? version, CommunicationIdentifierModel deletedByCommunicationIdentifier, DateTimeOffset? deleteTime) : base(recipientCommunicationIdentifier, transactionId, threadId, createTime, version) + { + DeletedByCommunicationIdentifier = deletedByCommunicationIdentifier; + DeleteTime = deleteTime; + } + + /// The communication identifier of the user who deleted the thread. + public CommunicationIdentifierModel DeletedByCommunicationIdentifier { get; } + /// The deletion time of the thread. + public DateTimeOffset? DeleteTime { get; } + } +} diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.Serialization.cs index a443e09737711..6e33995e5d3e9 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AlertingResultQuery : IUtf8JsonSerializable + public partial class AlertingResultQuery : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.cs index 20568989da294..a1b64a1f725cb 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AlertingResultQuery.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AlertingResultQuery. - internal partial class AlertingResultQuery + public partial class AlertingResultQuery { /// Initializes a new instance of AlertingResultQuery. /// start time. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.Serialization.cs index 6ec1e71f8cc1d..3f2e13d2bdd2d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.Serialization.cs @@ -15,10 +15,10 @@ public partial class AnomalyAlert { internal static AnomalyAlert DeserializeAnomalyAlert(JsonElement element) { - string alertId = default; - DateTimeOffset timestamp = default; - DateTimeOffset createdTime = default; - DateTimeOffset modifiedTime = default; + Optional alertId = default; + Optional timestamp = default; + Optional createdTime = default; + Optional modifiedTime = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("alertId")) @@ -28,21 +28,36 @@ internal static AnomalyAlert DeserializeAnomalyAlert(JsonElement element) } if (property.NameEquals("timestamp")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("createdTime")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } createdTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("modifiedTime")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } modifiedTime = property.Value.GetDateTimeOffset("O"); continue; } } - return new AnomalyAlert(alertId, timestamp, createdTime, modifiedTime); + return new AnomalyAlert(alertId.Value, timestamp, createdTime, modifiedTime); } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.cs index 32d4f66386590..2393fac1225ff 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlert.cs @@ -12,19 +12,18 @@ namespace Azure.AI.MetricsAdvisor.Models /// The AlertResult. public partial class AnomalyAlert { + /// Initializes a new instance of AnomalyAlert. + internal AnomalyAlert() + { + } + /// Initializes a new instance of AnomalyAlert. /// alert id. /// anomaly time. /// created time. /// modified time. - /// is null. internal AnomalyAlert(string id, DateTimeOffset timestamp, DateTimeOffset createdTime, DateTimeOffset modifiedTime) { - if (id == null) - { - throw new ArgumentNullException(nameof(id)); - } - Id = id; Timestamp = timestamp; CreatedTime = createdTime; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.Serialization.cs index 8aaef89ff8e56..8fbb8204f741c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AnomalyAlertingConfigurationList + public partial class AnomalyAlertingConfigurationList { internal static AnomalyAlertingConfigurationList DeserializeAnomalyAlertingConfigurationList(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.cs index a8eb1579054fc..8fdd3571ee6ee 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyAlertingConfigurationList.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AnomalyAlertingConfigurationList. - internal partial class AnomalyAlertingConfigurationList + public partial class AnomalyAlertingConfigurationList { /// Initializes a new instance of AnomalyAlertingConfigurationList. /// . diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.Serialization.cs index 0b7be3e97faca..f679cd970ca98 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AnomalyDetectionConfigurationList + public partial class AnomalyDetectionConfigurationList { internal static AnomalyDetectionConfigurationList DeserializeAnomalyDetectionConfigurationList(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.cs index 9060ebd4edca4..c7d12d8276f1f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDetectionConfigurationList.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AnomalyDetectionConfigurationList. - internal partial class AnomalyDetectionConfigurationList + public partial class AnomalyDetectionConfigurationList { /// Initializes a new instance of AnomalyDetectionConfigurationList. /// . diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.Serialization.cs index 843695973dd7c..fbd3db3396c29 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AnomalyDimensionQuery : IUtf8JsonSerializable + public partial class AnomalyDimensionQuery : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.cs index 8d3e2b0076cb1..d5be96b6bc1b1 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyDimensionQuery.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AnomalyDimensionQuery. - internal partial class AnomalyDimensionQuery + public partial class AnomalyDimensionQuery { /// Initializes a new instance of AnomalyDimensionQuery. /// start time. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.Serialization.cs index 0cc4298dfec3b..6f80de055c1eb 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AnomalyFeedbackValue : IUtf8JsonSerializable + public partial class AnomalyFeedbackValue : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.cs index 94102e12124b1..e59a993af0b22 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyFeedbackValue.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AnomalyFeedbackValue. - internal partial class AnomalyFeedbackValue + public partial class AnomalyFeedbackValue { /// Initializes a new instance of AnomalyFeedbackValue. /// . diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.Serialization.cs index e79fee83d27fc..aabb1407906a6 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AnomalyProperty + public partial class AnomalyProperty { internal static AnomalyProperty DeserializeAnomalyProperty(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.cs index f0bef75aac675..da544a401325d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AnomalyProperty.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AnomalyProperty. - internal partial class AnomalyProperty + public partial class AnomalyProperty { /// Initializes a new instance of AnomalyProperty. /// anomaly severity. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.Serialization.cs index 17eae0dcc09f5..f0bd06c719bd3 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureApplicationInsightsDataFeed : IUtf8JsonSerializable + public partial class AzureApplicationInsightsDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static AzureApplicationInsightsDataFeed DeserializeAzureApplicationInsi string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static AzureApplicationInsightsDataFeed DeserializeAzureApplicationInsi { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.cs index 3d4be3f4c4f58..8eb1d36d5e611 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureApplicationInsightsDataFeed. - internal partial class AzureApplicationInsightsDataFeed : DataFeedDetail + public partial class AzureApplicationInsightsDataFeed : DataFeedDetail { /// Initializes a new instance of AzureApplicationInsightsDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.Serialization.cs index 5e5e490450977..8315cea416327 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureApplicationInsightsDataFeedPatch : IUtf8JsonSerializable + public partial class AzureApplicationInsightsDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.cs index 8615f39929170..620a9cb555f07 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureApplicationInsightsDataFeedPatch. - internal partial class AzureApplicationInsightsDataFeedPatch : DataFeedDetailPatch + public partial class AzureApplicationInsightsDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of AzureApplicationInsightsDataFeedPatch. public AzureApplicationInsightsDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.Serialization.cs index 2dfa510e68d20..39f1773a8f56f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.Serialization.cs @@ -10,47 +10,19 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureApplicationInsightsParameter : IUtf8JsonSerializable + public partial class AzureApplicationInsightsParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (AzureCloud != null) - { - writer.WritePropertyName("azureCloud"); - writer.WriteStringValue(AzureCloud); - } - else - { - writer.WriteNull("azureCloud"); - } - if (ApplicationId != null) - { - writer.WritePropertyName("applicationId"); - writer.WriteStringValue(ApplicationId); - } - else - { - writer.WriteNull("applicationId"); - } - if (ApiKey != null) - { - writer.WritePropertyName("apiKey"); - writer.WriteStringValue(ApiKey); - } - else - { - writer.WriteNull("apiKey"); - } - if (Query != null) - { - writer.WritePropertyName("query"); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } + writer.WritePropertyName("azureCloud"); + writer.WriteStringValue(AzureCloud); + writer.WritePropertyName("applicationId"); + writer.WriteStringValue(ApplicationId); + writer.WritePropertyName("apiKey"); + writer.WriteStringValue(ApiKey); + writer.WritePropertyName("query"); + writer.WriteStringValue(Query); writer.WriteEndObject(); } @@ -64,41 +36,21 @@ internal static AzureApplicationInsightsParameter DeserializeAzureApplicationIns { if (property.NameEquals("azureCloud")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - azureCloud = null; - continue; - } azureCloud = property.Value.GetString(); continue; } if (property.NameEquals("applicationId")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - applicationId = null; - continue; - } applicationId = property.Value.GetString(); continue; } if (property.NameEquals("apiKey")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - apiKey = null; - continue; - } apiKey = property.Value.GetString(); continue; } if (property.NameEquals("query")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } query = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.cs index fddfb7c0b89ef..7dad3019c9b5a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureApplicationInsightsParameter.cs @@ -5,18 +5,38 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The AzureApplicationInsightsParameter. - internal partial class AzureApplicationInsightsParameter + public partial class AzureApplicationInsightsParameter { /// Initializes a new instance of AzureApplicationInsightsParameter. /// Azure cloud environment. /// Azure Application Insights ID. /// API Key. /// Query. + /// , , , or is null. public AzureApplicationInsightsParameter(string azureCloud, string applicationId, string apiKey, string query) { + if (azureCloud == null) + { + throw new ArgumentNullException(nameof(azureCloud)); + } + if (applicationId == null) + { + throw new ArgumentNullException(nameof(applicationId)); + } + if (apiKey == null) + { + throw new ArgumentNullException(nameof(apiKey)); + } + if (query == null) + { + throw new ArgumentNullException(nameof(query)); + } + AzureCloud = azureCloud; ApplicationId = applicationId; ApiKey = apiKey; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.Serialization.cs index a2598dfa831bd..93e2439a6b89e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureBlobDataFeed : IUtf8JsonSerializable + public partial class AzureBlobDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static AzureBlobDataFeed DeserializeAzureBlobDataFeed(JsonElement eleme string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static AzureBlobDataFeed DeserializeAzureBlobDataFeed(JsonElement eleme { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.cs index d6ef3552edc0e..0097faf0a99eb 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureBlobDataFeed. - internal partial class AzureBlobDataFeed : DataFeedDetail + public partial class AzureBlobDataFeed : DataFeedDetail { /// Initializes a new instance of AzureBlobDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.Serialization.cs index 453543d8baa72..5c83cd71d5643 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureBlobDataFeedPatch : IUtf8JsonSerializable + public partial class AzureBlobDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.cs index 795087637f623..21d216511c95d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureBlobDataFeedPatch. - internal partial class AzureBlobDataFeedPatch : DataFeedDetailPatch + public partial class AzureBlobDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of AzureBlobDataFeedPatch. public AzureBlobDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.Serialization.cs index 8d2ca73a0383c..bf7c79426e05c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.Serialization.cs @@ -10,38 +10,17 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureBlobParameter : IUtf8JsonSerializable + public partial class AzureBlobParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (ConnectionString != null) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - else - { - writer.WriteNull("connectionString"); - } - if (Container != null) - { - writer.WritePropertyName("container"); - writer.WriteStringValue(Container); - } - else - { - writer.WriteNull("container"); - } - if (BlobTemplate != null) - { - writer.WritePropertyName("blobTemplate"); - writer.WriteStringValue(BlobTemplate); - } - else - { - writer.WriteNull("blobTemplate"); - } + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + writer.WritePropertyName("container"); + writer.WriteStringValue(Container); + writer.WritePropertyName("blobTemplate"); + writer.WriteStringValue(BlobTemplate); writer.WriteEndObject(); } @@ -54,31 +33,16 @@ internal static AzureBlobParameter DeserializeAzureBlobParameter(JsonElement ele { if (property.NameEquals("connectionString")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connectionString = null; - continue; - } connectionString = property.Value.GetString(); continue; } if (property.NameEquals("container")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - container = null; - continue; - } container = property.Value.GetString(); continue; } if (property.NameEquals("blobTemplate")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - blobTemplate = null; - continue; - } blobTemplate = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.cs index e6680f04cd5d6..6e36778098d3c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureBlobParameter.cs @@ -5,17 +5,33 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The AzureBlobParameter. - internal partial class AzureBlobParameter + public partial class AzureBlobParameter { /// Initializes a new instance of AzureBlobParameter. /// Azure Blob connection string. /// Container. /// Blob Template. + /// , , or is null. public AzureBlobParameter(string connectionString, string container, string blobTemplate) { + if (connectionString == null) + { + throw new ArgumentNullException(nameof(connectionString)); + } + if (container == null) + { + throw new ArgumentNullException(nameof(container)); + } + if (blobTemplate == null) + { + throw new ArgumentNullException(nameof(blobTemplate)); + } + ConnectionString = connectionString; Container = container; BlobTemplate = blobTemplate; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.Serialization.cs index a307adadee829..480c3df94dc5b 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureCosmosDBDataFeed : IUtf8JsonSerializable + public partial class AzureCosmosDBDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static AzureCosmosDBDataFeed DeserializeAzureCosmosDBDataFeed(JsonEleme string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static AzureCosmosDBDataFeed DeserializeAzureCosmosDBDataFeed(JsonEleme { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.cs index ba098cd1d621c..6a3c6ce1847a6 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureCosmosDBDataFeed. - internal partial class AzureCosmosDBDataFeed : DataFeedDetail + public partial class AzureCosmosDBDataFeed : DataFeedDetail { /// Initializes a new instance of AzureCosmosDBDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.Serialization.cs index d8179bd5033a3..a711fb40dc5be 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureCosmosDBDataFeedPatch : IUtf8JsonSerializable + public partial class AzureCosmosDBDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.cs index c4ff4bef79bfc..0e6007e9d9e7a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureCosmosDBDataFeedPatch. - internal partial class AzureCosmosDBDataFeedPatch : DataFeedDetailPatch + public partial class AzureCosmosDBDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of AzureCosmosDBDataFeedPatch. public AzureCosmosDBDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.Serialization.cs index fc1a57e2bedd4..74ef6ab8bef39 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.Serialization.cs @@ -10,47 +10,19 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureCosmosDBParameter : IUtf8JsonSerializable + public partial class AzureCosmosDBParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (ConnectionString != null) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - else - { - writer.WriteNull("connectionString"); - } - if (SqlQuery != null) - { - writer.WritePropertyName("sqlQuery"); - writer.WriteStringValue(SqlQuery); - } - else - { - writer.WriteNull("sqlQuery"); - } - if (Database != null) - { - writer.WritePropertyName("database"); - writer.WriteStringValue(Database); - } - else - { - writer.WriteNull("database"); - } - if (CollectionId != null) - { - writer.WritePropertyName("collectionId"); - writer.WriteStringValue(CollectionId); - } - else - { - writer.WriteNull("collectionId"); - } + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + writer.WritePropertyName("sqlQuery"); + writer.WriteStringValue(SqlQuery); + writer.WritePropertyName("database"); + writer.WriteStringValue(Database); + writer.WritePropertyName("collectionId"); + writer.WriteStringValue(CollectionId); writer.WriteEndObject(); } @@ -64,41 +36,21 @@ internal static AzureCosmosDBParameter DeserializeAzureCosmosDBParameter(JsonEle { if (property.NameEquals("connectionString")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connectionString = null; - continue; - } connectionString = property.Value.GetString(); continue; } if (property.NameEquals("sqlQuery")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - sqlQuery = null; - continue; - } sqlQuery = property.Value.GetString(); continue; } if (property.NameEquals("database")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - database = null; - continue; - } database = property.Value.GetString(); continue; } if (property.NameEquals("collectionId")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - collectionId = null; - continue; - } collectionId = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.cs index 8734111de8a51..8c14de4fc17dd 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureCosmosDBParameter.cs @@ -5,18 +5,38 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The AzureCosmosDBParameter. - internal partial class AzureCosmosDBParameter + public partial class AzureCosmosDBParameter { /// Initializes a new instance of AzureCosmosDBParameter. /// Azure CosmosDB connection string. /// Query script. /// Database name. /// Collection id. + /// , , , or is null. public AzureCosmosDBParameter(string connectionString, string sqlQuery, string database, string collectionId) { + if (connectionString == null) + { + throw new ArgumentNullException(nameof(connectionString)); + } + if (sqlQuery == null) + { + throw new ArgumentNullException(nameof(sqlQuery)); + } + if (database == null) + { + throw new ArgumentNullException(nameof(database)); + } + if (collectionId == null) + { + throw new ArgumentNullException(nameof(collectionId)); + } + ConnectionString = connectionString; SqlQuery = sqlQuery; Database = database; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.Serialization.cs index 3a6c629d5975d..1f6143d125255 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureDataExplorerDataFeed : IUtf8JsonSerializable + public partial class AzureDataExplorerDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static AzureDataExplorerDataFeed DeserializeAzureDataExplorerDataFeed(J string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static AzureDataExplorerDataFeed DeserializeAzureDataExplorerDataFeed(J { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.cs index 3b087d7e73d4f..64cf128d02fd5 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureDataExplorerDataFeed. - internal partial class AzureDataExplorerDataFeed : DataFeedDetail + public partial class AzureDataExplorerDataFeed : DataFeedDetail { /// Initializes a new instance of AzureDataExplorerDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.Serialization.cs index e5ca1057b6bed..3baaee3cd15ef 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureDataExplorerDataFeedPatch : IUtf8JsonSerializable + public partial class AzureDataExplorerDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.cs index 6cd61b4aa6723..27021bef70f45 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataExplorerDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureDataExplorerDataFeedPatch. - internal partial class AzureDataExplorerDataFeedPatch : DataFeedDetailPatch + public partial class AzureDataExplorerDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of AzureDataExplorerDataFeedPatch. public AzureDataExplorerDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.Serialization.cs index b007bedefb58d..83884561f302d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureDataLakeStorageGen2DataFeed : IUtf8JsonSerializable + public partial class AzureDataLakeStorageGen2DataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static AzureDataLakeStorageGen2DataFeed DeserializeAzureDataLakeStorage string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static AzureDataLakeStorageGen2DataFeed DeserializeAzureDataLakeStorage { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.cs index b58bb87619868..3b32a3cf8f168 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureDataLakeStorageGen2DataFeed. - internal partial class AzureDataLakeStorageGen2DataFeed : DataFeedDetail + public partial class AzureDataLakeStorageGen2DataFeed : DataFeedDetail { /// Initializes a new instance of AzureDataLakeStorageGen2DataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.Serialization.cs index c8d8faec375b9..e6cdc9b8b128f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureDataLakeStorageGen2DataFeedPatch : IUtf8JsonSerializable + public partial class AzureDataLakeStorageGen2DataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.cs index 650e70f6bea59..7f18f20c8b292 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2DataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureDataLakeStorageGen2DataFeedPatch. - internal partial class AzureDataLakeStorageGen2DataFeedPatch : DataFeedDetailPatch + public partial class AzureDataLakeStorageGen2DataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of AzureDataLakeStorageGen2DataFeedPatch. public AzureDataLakeStorageGen2DataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.Serialization.cs index 8b59a135dc99e..fde148d87ab1c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.Serialization.cs @@ -10,56 +10,21 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureDataLakeStorageGen2Parameter : IUtf8JsonSerializable + public partial class AzureDataLakeStorageGen2Parameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (AccountName != null) - { - writer.WritePropertyName("accountName"); - writer.WriteStringValue(AccountName); - } - else - { - writer.WriteNull("accountName"); - } - if (AccountKey != null) - { - writer.WritePropertyName("accountKey"); - writer.WriteStringValue(AccountKey); - } - else - { - writer.WriteNull("accountKey"); - } - if (FileSystemName != null) - { - writer.WritePropertyName("fileSystemName"); - writer.WriteStringValue(FileSystemName); - } - else - { - writer.WriteNull("fileSystemName"); - } - if (DirectoryTemplate != null) - { - writer.WritePropertyName("directoryTemplate"); - writer.WriteStringValue(DirectoryTemplate); - } - else - { - writer.WriteNull("directoryTemplate"); - } - if (FileTemplate != null) - { - writer.WritePropertyName("fileTemplate"); - writer.WriteStringValue(FileTemplate); - } - else - { - writer.WriteNull("fileTemplate"); - } + writer.WritePropertyName("accountName"); + writer.WriteStringValue(AccountName); + writer.WritePropertyName("accountKey"); + writer.WriteStringValue(AccountKey); + writer.WritePropertyName("fileSystemName"); + writer.WriteStringValue(FileSystemName); + writer.WritePropertyName("directoryTemplate"); + writer.WriteStringValue(DirectoryTemplate); + writer.WritePropertyName("fileTemplate"); + writer.WriteStringValue(FileTemplate); writer.WriteEndObject(); } @@ -74,51 +39,26 @@ internal static AzureDataLakeStorageGen2Parameter DeserializeAzureDataLakeStorag { if (property.NameEquals("accountName")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - accountName = null; - continue; - } accountName = property.Value.GetString(); continue; } if (property.NameEquals("accountKey")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - accountKey = null; - continue; - } accountKey = property.Value.GetString(); continue; } if (property.NameEquals("fileSystemName")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fileSystemName = null; - continue; - } fileSystemName = property.Value.GetString(); continue; } if (property.NameEquals("directoryTemplate")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - directoryTemplate = null; - continue; - } directoryTemplate = property.Value.GetString(); continue; } if (property.NameEquals("fileTemplate")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - fileTemplate = null; - continue; - } fileTemplate = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.cs index 9f7dff6a3a3b4..7bfb21decc928 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureDataLakeStorageGen2Parameter.cs @@ -5,10 +5,12 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The AzureDataLakeStorageGen2Parameter. - internal partial class AzureDataLakeStorageGen2Parameter + public partial class AzureDataLakeStorageGen2Parameter { /// Initializes a new instance of AzureDataLakeStorageGen2Parameter. /// Account name. @@ -16,8 +18,30 @@ internal partial class AzureDataLakeStorageGen2Parameter /// File system name (Container). /// Directory template. /// File template. + /// , , , , or is null. public AzureDataLakeStorageGen2Parameter(string accountName, string accountKey, string fileSystemName, string directoryTemplate, string fileTemplate) { + if (accountName == null) + { + throw new ArgumentNullException(nameof(accountName)); + } + if (accountKey == null) + { + throw new ArgumentNullException(nameof(accountKey)); + } + if (fileSystemName == null) + { + throw new ArgumentNullException(nameof(fileSystemName)); + } + if (directoryTemplate == null) + { + throw new ArgumentNullException(nameof(directoryTemplate)); + } + if (fileTemplate == null) + { + throw new ArgumentNullException(nameof(fileTemplate)); + } + AccountName = accountName; AccountKey = accountKey; FileSystemName = fileSystemName; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.Serialization.cs index c5bc227784143..ed322bcbe8e58 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureTableDataFeed : IUtf8JsonSerializable + public partial class AzureTableDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static AzureTableDataFeed DeserializeAzureTableDataFeed(JsonElement ele string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static AzureTableDataFeed DeserializeAzureTableDataFeed(JsonElement ele { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.cs index 499434b1dd0d0..563444de3191a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureTableDataFeed. - internal partial class AzureTableDataFeed : DataFeedDetail + public partial class AzureTableDataFeed : DataFeedDetail { /// Initializes a new instance of AzureTableDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.Serialization.cs index a4212694a9e62..784434bec5ea1 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureTableDataFeedPatch : IUtf8JsonSerializable + public partial class AzureTableDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.cs index c5f903baaa7ad..77d8ae5bc3dbe 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The AzureTableDataFeedPatch. - internal partial class AzureTableDataFeedPatch : DataFeedDetailPatch + public partial class AzureTableDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of AzureTableDataFeedPatch. public AzureTableDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.Serialization.cs index de146e6cd199b..6a20adbcfaf7c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.Serialization.cs @@ -10,38 +10,17 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class AzureTableParameter : IUtf8JsonSerializable + public partial class AzureTableParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (ConnectionString != null) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - else - { - writer.WriteNull("connectionString"); - } - if (Table != null) - { - writer.WritePropertyName("table"); - writer.WriteStringValue(Table); - } - else - { - writer.WriteNull("table"); - } - if (Query != null) - { - writer.WritePropertyName("query"); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + writer.WritePropertyName("table"); + writer.WriteStringValue(Table); + writer.WritePropertyName("query"); + writer.WriteStringValue(Query); writer.WriteEndObject(); } @@ -54,31 +33,16 @@ internal static AzureTableParameter DeserializeAzureTableParameter(JsonElement e { if (property.NameEquals("connectionString")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connectionString = null; - continue; - } connectionString = property.Value.GetString(); continue; } if (property.NameEquals("table")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - table = null; - continue; - } table = property.Value.GetString(); continue; } if (property.NameEquals("query")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } query = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.cs index dcd9f3b5f4266..341c890e37f3d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/AzureTableParameter.cs @@ -5,17 +5,33 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The AzureTableParameter. - internal partial class AzureTableParameter + public partial class AzureTableParameter { /// Initializes a new instance of AzureTableParameter. /// Azure Table connection string. /// Table name. /// Query script. + /// , , or is null. public AzureTableParameter(string connectionString, string table, string query) { + if (connectionString == null) + { + throw new ArgumentNullException(nameof(connectionString)); + } + if (table == null) + { + throw new ArgumentNullException(nameof(table)); + } + if (query == null) + { + throw new ArgumentNullException(nameof(query)); + } + ConnectionString = connectionString; Table = table; Query = query; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.Serialization.cs index 8fd39639c4e2c..9c0f92deb7425 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class ChangePointFeedbackValue : IUtf8JsonSerializable + public partial class ChangePointFeedbackValue : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.cs index ecd7e116d9c7f..bb76e12373113 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ChangePointFeedbackValue.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The ChangePointFeedbackValue. - internal partial class ChangePointFeedbackValue + public partial class ChangePointFeedbackValue { /// Initializes a new instance of ChangePointFeedbackValue. /// . diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.Serialization.cs index 77ee818055af5..3493a9d276369 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class CommentFeedbackValue : IUtf8JsonSerializable + public partial class CommentFeedbackValue : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.cs index 18ef7d53a390d..df6db771f8818 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/CommentFeedbackValue.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The CommentFeedbackValue. - internal partial class CommentFeedbackValue + public partial class CommentFeedbackValue { /// Initializes a new instance of CommentFeedbackValue. /// the comment string. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedDetail.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedDetail.Serialization.cs index 7e95033de0815..e5fb11ca4de24 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedDetail.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedDetail.Serialization.cs @@ -30,15 +30,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -178,7 +171,7 @@ internal static DataFeedDetail DeserializeDataFeedDetail(JsonElement element) string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -232,7 +225,7 @@ internal static DataFeedDetail DeserializeDataFeedDetail(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionProgress.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionProgress.Serialization.cs index 0afa3ae85592e..3546f3f2d1f3e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionProgress.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionProgress.Serialization.cs @@ -15,15 +15,15 @@ public partial class DataFeedIngestionProgress { internal static DataFeedIngestionProgress DeserializeDataFeedIngestionProgress(JsonElement element) { - Optional latestSuccessTimestamp = default; - Optional latestActiveTimestamp = default; + Optional latestSuccessTimestamp = default; + Optional latestActiveTimestamp = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("latestSuccessTimestamp")) { if (property.Value.ValueKind == JsonValueKind.Null) { - latestSuccessTimestamp = null; + property.ThrowNonNullablePropertyIsNull(); continue; } latestSuccessTimestamp = property.Value.GetDateTimeOffset("O"); @@ -33,7 +33,7 @@ internal static DataFeedIngestionProgress DeserializeDataFeedIngestionProgress(J { if (property.Value.ValueKind == JsonValueKind.Null) { - latestActiveTimestamp = null; + property.ThrowNonNullablePropertyIsNull(); continue; } latestActiveTimestamp = property.Value.GetDateTimeOffset("O"); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.Serialization.cs index aa65eaec9aeeb..be21a7d32e6f4 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.Serialization.cs @@ -15,18 +15,28 @@ public partial class DataFeedIngestionStatus { internal static DataFeedIngestionStatus DeserializeDataFeedIngestionStatus(JsonElement element) { - DateTimeOffset timestamp = default; - IngestionStatusType status = default; - string message = default; + Optional timestamp = default; + Optional status = default; + Optional message = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("timestamp")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("status")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } status = new IngestionStatusType(property.Value.GetString()); continue; } @@ -36,7 +46,7 @@ internal static DataFeedIngestionStatus DeserializeDataFeedIngestionStatus(JsonE continue; } } - return new DataFeedIngestionStatus(timestamp, status, message); + return new DataFeedIngestionStatus(timestamp, status, message.Value); } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.cs index 7bf8518736250..7d1a42a075090 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DataFeedIngestionStatus.cs @@ -12,18 +12,17 @@ namespace Azure.AI.MetricsAdvisor.Models /// The IngestionStatus. public partial class DataFeedIngestionStatus { + /// Initializes a new instance of DataFeedIngestionStatus. + internal DataFeedIngestionStatus() + { + } + /// Initializes a new instance of DataFeedIngestionStatus. /// data slice timestamp. /// latest ingestion task status for this data slice. /// the trimmed message of last ingestion job. - /// is null. internal DataFeedIngestionStatus(DateTimeOffset timestamp, IngestionStatusType status, string message) { - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - Timestamp = timestamp; Status = status; Message = message; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.Serialization.cs index 8a93fd0c61cb3..42bb370f5afe3 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class DetectionAnomalyFilterCondition : IUtf8JsonSerializable + public partial class DetectionAnomalyFilterCondition : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.cs index 2e75e1cab8922..5db83a3ba2e0e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyFilterCondition.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The DetectionAnomalyFilterCondition. - internal partial class DetectionAnomalyFilterCondition + public partial class DetectionAnomalyFilterCondition { /// Initializes a new instance of DetectionAnomalyFilterCondition. public DetectionAnomalyFilterCondition() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.Serialization.cs index a27049abc537d..d68a716a03081 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class DetectionAnomalyResultQuery : IUtf8JsonSerializable + public partial class DetectionAnomalyResultQuery : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.cs index b2789fe1a7453..746c961d224db 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionAnomalyResultQuery.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The DetectionAnomalyResultQuery. - internal partial class DetectionAnomalyResultQuery + public partial class DetectionAnomalyResultQuery { /// Initializes a new instance of DetectionAnomalyResultQuery. /// start time. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.Serialization.cs index 8670f753c042f..a021593e21b3e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class DetectionIncidentFilterCondition : IUtf8JsonSerializable + public partial class DetectionIncidentFilterCondition : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.cs index aeab004609ab3..9b7b0ce2493bb 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentFilterCondition.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The DetectionIncidentFilterCondition. - internal partial class DetectionIncidentFilterCondition + public partial class DetectionIncidentFilterCondition { /// Initializes a new instance of DetectionIncidentFilterCondition. public DetectionIncidentFilterCondition() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.Serialization.cs index 18eb84eb4d9b8..abacd3a1a5834 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class DetectionIncidentResultQuery : IUtf8JsonSerializable + public partial class DetectionIncidentResultQuery : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.cs index 05ff2d4ded728..fc9fed152b099 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionIncidentResultQuery.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The DetectionIncidentResultQuery. - internal partial class DetectionIncidentResultQuery + public partial class DetectionIncidentResultQuery { /// Initializes a new instance of DetectionIncidentResultQuery. /// start time. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.Serialization.cs index c0675aab07638..3f8bc3c23d13a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class DetectionSeriesQuery : IUtf8JsonSerializable + public partial class DetectionSeriesQuery : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.cs index 858fe099b097f..3b0119b3efb6a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/DetectionSeriesQuery.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The DetectionSeriesQuery. - internal partial class DetectionSeriesQuery + public partial class DetectionSeriesQuery { /// Initializes a new instance of DetectionSeriesQuery. /// start time. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.Serialization.cs index b9f3b01bdd450..51cda14b203cb 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class ElasticsearchDataFeed : IUtf8JsonSerializable + public partial class ElasticsearchDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static ElasticsearchDataFeed DeserializeElasticsearchDataFeed(JsonEleme string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static ElasticsearchDataFeed DeserializeElasticsearchDataFeed(JsonEleme { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.cs index 94715d05213c4..ad0be84a8a933 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The ElasticsearchDataFeed. - internal partial class ElasticsearchDataFeed : DataFeedDetail + public partial class ElasticsearchDataFeed : DataFeedDetail { /// Initializes a new instance of ElasticsearchDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.Serialization.cs index 1fc3fc61a045d..09fa9c21c719c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class ElasticsearchDataFeedPatch : IUtf8JsonSerializable + public partial class ElasticsearchDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.cs index 481a6043e183d..de1e3264b0808 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The ElasticsearchDataFeedPatch. - internal partial class ElasticsearchDataFeedPatch : DataFeedDetailPatch + public partial class ElasticsearchDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of ElasticsearchDataFeedPatch. public ElasticsearchDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.Serialization.cs index 39d163f7f97d1..1aacec9eb1059 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.Serialization.cs @@ -10,47 +10,19 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class ElasticsearchParameter : IUtf8JsonSerializable + public partial class ElasticsearchParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Host != null) - { - writer.WritePropertyName("host"); - writer.WriteStringValue(Host); - } - else - { - writer.WriteNull("host"); - } - if (Port != null) - { - writer.WritePropertyName("port"); - writer.WriteStringValue(Port); - } - else - { - writer.WriteNull("port"); - } - if (AuthHeader != null) - { - writer.WritePropertyName("authHeader"); - writer.WriteStringValue(AuthHeader); - } - else - { - writer.WriteNull("authHeader"); - } - if (Query != null) - { - writer.WritePropertyName("query"); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } + writer.WritePropertyName("host"); + writer.WriteStringValue(Host); + writer.WritePropertyName("port"); + writer.WriteStringValue(Port); + writer.WritePropertyName("authHeader"); + writer.WriteStringValue(AuthHeader); + writer.WritePropertyName("query"); + writer.WriteStringValue(Query); writer.WriteEndObject(); } @@ -64,41 +36,21 @@ internal static ElasticsearchParameter DeserializeElasticsearchParameter(JsonEle { if (property.NameEquals("host")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - host = null; - continue; - } host = property.Value.GetString(); continue; } if (property.NameEquals("port")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - port = null; - continue; - } port = property.Value.GetString(); continue; } if (property.NameEquals("authHeader")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - authHeader = null; - continue; - } authHeader = property.Value.GetString(); continue; } if (property.NameEquals("query")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } query = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.cs index dcb5b1ec8269c..7cf0856989ed7 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/ElasticsearchParameter.cs @@ -5,18 +5,38 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The ElasticsearchParameter. - internal partial class ElasticsearchParameter + public partial class ElasticsearchParameter { /// Initializes a new instance of ElasticsearchParameter. /// Host. /// Port. /// Authorization header. /// Query. + /// , , , or is null. public ElasticsearchParameter(string host, string port, string authHeader, string query) { + if (host == null) + { + throw new ArgumentNullException(nameof(host)); + } + if (port == null) + { + throw new ArgumentNullException(nameof(port)); + } + if (authHeader == null) + { + throw new ArgumentNullException(nameof(authHeader)); + } + if (query == null) + { + throw new ArgumentNullException(nameof(query)); + } + Host = host; Port = port; AuthHeader = authHeader; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.Serialization.cs index 37f0ef3393a72..4e1b451802893 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class EmailHookInfoPatch : IUtf8JsonSerializable + public partial class EmailHookInfoPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.cs index 8a55331827a40..a2021ebca04bf 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookInfoPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The EmailHookInfoPatch. - internal partial class EmailHookInfoPatch : HookInfoPatch + public partial class EmailHookInfoPatch : HookInfoPatch { /// Initializes a new instance of EmailHookInfoPatch. public EmailHookInfoPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.Serialization.cs index 526038c2d5bae..8c265e783a6e3 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class EmailHookParameter : IUtf8JsonSerializable + public partial class EmailHookParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.cs index 94aacd61ddee5..584ba8069a222 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EmailHookParameter.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The EmailHookParameter. - internal partial class EmailHookParameter + public partial class EmailHookParameter { /// Initializes a new instance of EmailHookParameter. /// Email TO: list. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.Serialization.cs index 6f2670291a468..c0ea060e6625d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.Serialization.cs @@ -15,13 +15,18 @@ public partial class EnrichmentStatus { internal static EnrichmentStatus DeserializeEnrichmentStatus(JsonElement element) { - DateTimeOffset timestamp = default; - string status = default; - string message = default; + Optional timestamp = default; + Optional status = default; + Optional message = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("timestamp")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } timestamp = property.Value.GetDateTimeOffset("O"); continue; } @@ -36,7 +41,7 @@ internal static EnrichmentStatus DeserializeEnrichmentStatus(JsonElement element continue; } } - return new EnrichmentStatus(timestamp, status, message); + return new EnrichmentStatus(timestamp, status.Value, message.Value); } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.cs index 3a83508c36f9e..723b789f710f4 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatus.cs @@ -12,22 +12,17 @@ namespace Azure.AI.MetricsAdvisor.Models /// The EnrichmentStatus. public partial class EnrichmentStatus { + /// Initializes a new instance of EnrichmentStatus. + internal EnrichmentStatus() + { + } + /// Initializes a new instance of EnrichmentStatus. /// data slice timestamp. /// latest enrichment status for this data slice. /// the trimmed message describes details of the enrichment status. - /// or is null. internal EnrichmentStatus(DateTimeOffset timestamp, string status, string message) { - if (status == null) - { - throw new ArgumentNullException(nameof(status)); - } - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - Timestamp = timestamp; Status = status; Message = message; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.Serialization.cs index b18d5c818ca25..24b3404e63b42 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class EnrichmentStatusQueryOption : IUtf8JsonSerializable + public partial class EnrichmentStatusQueryOption : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.cs index 2a0dffb5d023a..0764451520e60 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/EnrichmentStatusQueryOption.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The EnrichmentStatusQueryOption. - internal partial class EnrichmentStatusQueryOption + public partial class EnrichmentStatusQueryOption { /// Initializes a new instance of EnrichmentStatusQueryOption. /// the start point of time range to query anomaly detection status. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.Serialization.cs index b75238f88eb14..c91f12f95f194 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class HttpRequestDataFeed : IUtf8JsonSerializable + public partial class HttpRequestDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static HttpRequestDataFeed DeserializeHttpRequestDataFeed(JsonElement e string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static HttpRequestDataFeed DeserializeHttpRequestDataFeed(JsonElement e { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.cs index 90d9e2c000ec8..5d1cfe63b18ff 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The HttpRequestDataFeed. - internal partial class HttpRequestDataFeed : DataFeedDetail + public partial class HttpRequestDataFeed : DataFeedDetail { /// Initializes a new instance of HttpRequestDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.Serialization.cs index 79b81fb1571e6..bfca7f02689e8 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class HttpRequestDataFeedPatch : IUtf8JsonSerializable + public partial class HttpRequestDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.cs index db57d98ee13fa..6b3917726f726 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The HttpRequestDataFeedPatch. - internal partial class HttpRequestDataFeedPatch : DataFeedDetailPatch + public partial class HttpRequestDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of HttpRequestDataFeedPatch. public HttpRequestDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.Serialization.cs index a742e761a8468..f552ab3b153c1 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.Serialization.cs @@ -10,47 +10,19 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class HttpRequestParameter : IUtf8JsonSerializable + public partial class HttpRequestParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Url != null) - { - writer.WritePropertyName("url"); - writer.WriteStringValue(Url); - } - else - { - writer.WriteNull("url"); - } - if (HttpHeader != null) - { - writer.WritePropertyName("httpHeader"); - writer.WriteStringValue(HttpHeader); - } - else - { - writer.WriteNull("httpHeader"); - } - if (HttpMethod != null) - { - writer.WritePropertyName("httpMethod"); - writer.WriteStringValue(HttpMethod); - } - else - { - writer.WriteNull("httpMethod"); - } - if (Payload != null) - { - writer.WritePropertyName("payload"); - writer.WriteStringValue(Payload); - } - else - { - writer.WriteNull("payload"); - } + writer.WritePropertyName("url"); + writer.WriteStringValue(Url); + writer.WritePropertyName("httpHeader"); + writer.WriteStringValue(HttpHeader); + writer.WritePropertyName("httpMethod"); + writer.WriteStringValue(HttpMethod); + writer.WritePropertyName("payload"); + writer.WriteStringValue(Payload); writer.WriteEndObject(); } @@ -64,41 +36,21 @@ internal static HttpRequestParameter DeserializeHttpRequestParameter(JsonElement { if (property.NameEquals("url")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - url = null; - continue; - } url = property.Value.GetString(); continue; } if (property.NameEquals("httpHeader")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - httpHeader = null; - continue; - } httpHeader = property.Value.GetString(); continue; } if (property.NameEquals("httpMethod")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - httpMethod = null; - continue; - } httpMethod = property.Value.GetString(); continue; } if (property.NameEquals("payload")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - payload = null; - continue; - } payload = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.cs index be694b4e75475..ab93a73bb1a22 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/HttpRequestParameter.cs @@ -5,18 +5,38 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The HttpRequestParameter. - internal partial class HttpRequestParameter + public partial class HttpRequestParameter { /// Initializes a new instance of HttpRequestParameter. /// HTTP URL. /// HTTP header. /// HTTP method. /// HTTP reuqest body. + /// , , , or is null. public HttpRequestParameter(string url, string httpHeader, string httpMethod, string payload) { + if (url == null) + { + throw new ArgumentNullException(nameof(url)); + } + if (httpHeader == null) + { + throw new ArgumentNullException(nameof(httpHeader)); + } + if (httpMethod == null) + { + throw new ArgumentNullException(nameof(httpMethod)); + } + if (payload == null) + { + throw new ArgumentNullException(nameof(payload)); + } + Url = url; HttpHeader = httpHeader; HttpMethod = httpMethod; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.Serialization.cs index ae19c4e08e0b3..e6517414d8d63 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class IncidentProperty + public partial class IncidentProperty { internal static IncidentProperty DeserializeIncidentProperty(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.cs index 43b712c5c8d2f..909ad8b5317ea 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IncidentProperty.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The IncidentProperty. - internal partial class IncidentProperty + public partial class IncidentProperty { /// Initializes a new instance of IncidentProperty. /// max severity of latest anomalies in the incident. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.Serialization.cs index 5a8ec323e266f..e03fcf9012033 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class InfluxDBDataFeed : IUtf8JsonSerializable + public partial class InfluxDBDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static InfluxDBDataFeed DeserializeInfluxDBDataFeed(JsonElement element string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static InfluxDBDataFeed DeserializeInfluxDBDataFeed(JsonElement element { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.cs index 73b1edad8fc7e..de03b77724054 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The InfluxDBDataFeed. - internal partial class InfluxDBDataFeed : DataFeedDetail + public partial class InfluxDBDataFeed : DataFeedDetail { /// Initializes a new instance of InfluxDBDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.Serialization.cs index 37454a757055a..e5dc6796be72d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class InfluxDBDataFeedPatch : IUtf8JsonSerializable + public partial class InfluxDBDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.cs index 358ed388d9ea8..8e9fc7d4ff623 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The InfluxDBDataFeedPatch. - internal partial class InfluxDBDataFeedPatch : DataFeedDetailPatch + public partial class InfluxDBDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of InfluxDBDataFeedPatch. public InfluxDBDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.Serialization.cs index f3b28abbd6ec4..2ea77383627b1 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.Serialization.cs @@ -10,56 +10,21 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class InfluxDBParameter : IUtf8JsonSerializable + public partial class InfluxDBParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (ConnectionString != null) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - else - { - writer.WriteNull("connectionString"); - } - if (Database != null) - { - writer.WritePropertyName("database"); - writer.WriteStringValue(Database); - } - else - { - writer.WriteNull("database"); - } - if (UserName != null) - { - writer.WritePropertyName("userName"); - writer.WriteStringValue(UserName); - } - else - { - writer.WriteNull("userName"); - } - if (Password != null) - { - writer.WritePropertyName("password"); - writer.WriteStringValue(Password); - } - else - { - writer.WriteNull("password"); - } - if (Query != null) - { - writer.WritePropertyName("query"); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + writer.WritePropertyName("database"); + writer.WriteStringValue(Database); + writer.WritePropertyName("userName"); + writer.WriteStringValue(UserName); + writer.WritePropertyName("password"); + writer.WriteStringValue(Password); + writer.WritePropertyName("query"); + writer.WriteStringValue(Query); writer.WriteEndObject(); } @@ -74,51 +39,26 @@ internal static InfluxDBParameter DeserializeInfluxDBParameter(JsonElement eleme { if (property.NameEquals("connectionString")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connectionString = null; - continue; - } connectionString = property.Value.GetString(); continue; } if (property.NameEquals("database")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - database = null; - continue; - } database = property.Value.GetString(); continue; } if (property.NameEquals("userName")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - userName = null; - continue; - } userName = property.Value.GetString(); continue; } if (property.NameEquals("password")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - password = null; - continue; - } password = property.Value.GetString(); continue; } if (property.NameEquals("query")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } query = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.cs index ff96728c6e4ed..fba2d33acd55b 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/InfluxDBParameter.cs @@ -5,10 +5,12 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The InfluxDBParameter. - internal partial class InfluxDBParameter + public partial class InfluxDBParameter { /// Initializes a new instance of InfluxDBParameter. /// InfluxDB connection string. @@ -16,8 +18,30 @@ internal partial class InfluxDBParameter /// Database access user. /// Database access password. /// Query script. + /// , , , , or is null. public InfluxDBParameter(string connectionString, string database, string userName, string password, string query) { + if (connectionString == null) + { + throw new ArgumentNullException(nameof(connectionString)); + } + if (database == null) + { + throw new ArgumentNullException(nameof(database)); + } + if (userName == null) + { + throw new ArgumentNullException(nameof(userName)); + } + if (password == null) + { + throw new ArgumentNullException(nameof(password)); + } + if (query == null) + { + throw new ArgumentNullException(nameof(query)); + } + ConnectionString = connectionString; Database = database; UserName = userName; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.Serialization.cs index 70cf9d41d3bd7..c0d96732bfa07 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class IngestionProgressResetOptions : IUtf8JsonSerializable + public partial class IngestionProgressResetOptions : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.cs index cadb76eb7e049..23057faafb942 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionProgressResetOptions.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The IngestionProgressResetOptions. - internal partial class IngestionProgressResetOptions + public partial class IngestionProgressResetOptions { /// Initializes a new instance of IngestionProgressResetOptions. /// the start point of time range to reset data ingestion status. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.Serialization.cs index e678915a8beb0..ecdad52ce6b17 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class IngestionStatusQueryOptions : IUtf8JsonSerializable + public partial class IngestionStatusQueryOptions : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.cs index 06b94d11d546f..1eb021892061d 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/IngestionStatusQueryOptions.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The IngestionStatusQueryOptions. - internal partial class IngestionStatusQueryOptions + public partial class IngestionStatusQueryOptions { /// Initializes a new instance of IngestionStatusQueryOptions. /// the start point of time range to query data ingestion status. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricAnomalyFeedback.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricAnomalyFeedback.Serialization.cs index 5e44db163ce00..84ba7551a6789 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricAnomalyFeedback.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricAnomalyFeedback.Serialization.cs @@ -24,27 +24,13 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteObjectValue(ValueInternal); if (Optional.IsDefined(AnomalyDetectionConfigurationId)) { - if (AnomalyDetectionConfigurationId != null) - { - writer.WritePropertyName("anomalyDetectionConfigurationId"); - writer.WriteStringValue(AnomalyDetectionConfigurationId); - } - else - { - writer.WriteNull("anomalyDetectionConfigurationId"); - } + writer.WritePropertyName("anomalyDetectionConfigurationId"); + writer.WriteStringValue(AnomalyDetectionConfigurationId); } if (Optional.IsDefined(AnomalyDetectionConfigurationSnapshot)) { - if (AnomalyDetectionConfigurationSnapshot != null) - { - writer.WritePropertyName("anomalyDetectionConfigurationSnapshot"); - writer.WriteObjectValue(AnomalyDetectionConfigurationSnapshot); - } - else - { - writer.WriteNull("anomalyDetectionConfigurationSnapshot"); - } + writer.WritePropertyName("anomalyDetectionConfigurationSnapshot"); + writer.WriteObjectValue(AnomalyDetectionConfigurationSnapshot); } writer.WritePropertyName("feedbackType"); writer.WriteStringValue(Type.ToString()); @@ -87,11 +73,6 @@ internal static MetricAnomalyFeedback DeserializeMetricAnomalyFeedback(JsonEleme } if (property.NameEquals("anomalyDetectionConfigurationId")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - anomalyDetectionConfigurationId = null; - continue; - } anomalyDetectionConfigurationId = property.Value.GetString(); continue; } @@ -99,7 +80,7 @@ internal static MetricAnomalyFeedback DeserializeMetricAnomalyFeedback(JsonEleme { if (property.Value.ValueKind == JsonValueKind.Null) { - anomalyDetectionConfigurationSnapshot = null; + property.ThrowNonNullablePropertyIsNull(); continue; } anomalyDetectionConfigurationSnapshot = AnomalyDetectionConfiguration.DeserializeAnomalyDetectionConfiguration(property.Value); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricCommentFeedback.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricCommentFeedback.Serialization.cs index 425598e0ff3cc..d95df87c11356 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricCommentFeedback.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricCommentFeedback.Serialization.cs @@ -18,27 +18,13 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); if (Optional.IsDefined(StartTime)) { - if (StartTime != null) - { - writer.WritePropertyName("startTime"); - writer.WriteStringValue(StartTime.Value, "O"); - } - else - { - writer.WriteNull("startTime"); - } + writer.WritePropertyName("startTime"); + writer.WriteStringValue(StartTime.Value, "O"); } if (Optional.IsDefined(EndTime)) { - if (EndTime != null) - { - writer.WritePropertyName("endTime"); - writer.WriteStringValue(EndTime.Value, "O"); - } - else - { - writer.WriteNull("endTime"); - } + writer.WritePropertyName("endTime"); + writer.WriteStringValue(EndTime.Value, "O"); } writer.WritePropertyName("value"); writer.WriteObjectValue(ValueInternal); @@ -53,8 +39,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static MetricCommentFeedback DeserializeMetricCommentFeedback(JsonElement element) { - Optional startTime = default; - Optional endTime = default; + Optional startTime = default; + Optional endTime = default; CommentFeedbackValue value = default; FeedbackType feedbackType = default; Optional feedbackId = default; @@ -68,7 +54,7 @@ internal static MetricCommentFeedback DeserializeMetricCommentFeedback(JsonEleme { if (property.Value.ValueKind == JsonValueKind.Null) { - startTime = null; + property.ThrowNonNullablePropertyIsNull(); continue; } startTime = property.Value.GetDateTimeOffset("O"); @@ -78,7 +64,7 @@ internal static MetricCommentFeedback DeserializeMetricCommentFeedback(JsonEleme { if (property.Value.ValueKind == JsonValueKind.Null) { - endTime = null; + property.ThrowNonNullablePropertyIsNull(); continue; } endTime = property.Value.GetDateTimeOffset("O"); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.Serialization.cs index faec053995edd..3fa459fd44c14 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MetricDataList + public partial class MetricDataList { internal static MetricDataList DeserializeMetricDataList(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.cs index fe559995517c7..aba68a1a8911e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataList.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MetricDataList. - internal partial class MetricDataList + public partial class MetricDataList { /// Initializes a new instance of MetricDataList. internal MetricDataList() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.Serialization.cs index c72622bc0cb0a..d417c633e249e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MetricDataQueryOptions : IUtf8JsonSerializable + public partial class MetricDataQueryOptions : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.cs index 3e4548cbd2308..775bd947f4d10 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDataQueryOptions.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MetricDataQueryOptions. - internal partial class MetricDataQueryOptions + public partial class MetricDataQueryOptions { /// Initializes a new instance of MetricDataQueryOptions. /// start time of query a time series data, and format should be yyyy-MM-ddThh:mm:ssZ. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.Serialization.cs index 8ca7436c87f6b..2e6c93077f51a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MetricDimensionQueryOptions : IUtf8JsonSerializable + public partial class MetricDimensionQueryOptions : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.cs index 9544d9e5a15eb..b25d562e6a631 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricDimensionQueryOptions.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MetricDimensionQueryOptions. - internal partial class MetricDimensionQueryOptions + public partial class MetricDimensionQueryOptions { /// Initializes a new instance of MetricDimensionQueryOptions. /// dimension name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.Serialization.cs index fcb1aef7a9611..cc9802e562d7f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MetricFeedbackFilter : IUtf8JsonSerializable + public partial class MetricFeedbackFilter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.cs index 1651d9ec1c373..691bed700ed5e 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricFeedbackFilter.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MetricFeedbackFilter. - internal partial class MetricFeedbackFilter + public partial class MetricFeedbackFilter { /// Initializes a new instance of MetricFeedbackFilter. /// filter feedbacks by metric id. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.Serialization.cs index 841530b7c7e60..1c99556db2ee0 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.Serialization.cs @@ -16,18 +16,28 @@ public partial class MetricSeriesData { internal static MetricSeriesData DeserializeMetricSeriesData(JsonElement element) { - MetricSeriesDefinition id = default; - IReadOnlyList timestampList = default; - IReadOnlyList valueList = default; + Optional id = default; + Optional> timestampList = default; + Optional> valueList = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } id = MetricSeriesDefinition.DeserializeMetricSeriesDefinition(property.Value); continue; } if (property.NameEquals("timestampList")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -38,6 +48,11 @@ internal static MetricSeriesData DeserializeMetricSeriesData(JsonElement element } if (property.NameEquals("valueList")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -47,7 +62,7 @@ internal static MetricSeriesData DeserializeMetricSeriesData(JsonElement element continue; } } - return new MetricSeriesData(id, timestampList, valueList); + return new MetricSeriesData(id.Value, Optional.ToList(timestampList), Optional.ToList(valueList)); } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.cs index 19f88d2b36b0f..fae3a1eb02d1f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesData.cs @@ -7,7 +7,7 @@ using System; using System.Collections.Generic; -using System.Linq; +using Azure.Core; namespace Azure.AI.MetricsAdvisor.Models { @@ -15,28 +15,10 @@ namespace Azure.AI.MetricsAdvisor.Models public partial class MetricSeriesData { /// Initializes a new instance of MetricSeriesData. - /// . - /// timestamps of the data related to this time series. - /// values of the data related to this time series. - /// , , or is null. - internal MetricSeriesData(MetricSeriesDefinition definition, IEnumerable timestamps, IEnumerable values) + internal MetricSeriesData() { - if (definition == null) - { - throw new ArgumentNullException(nameof(definition)); - } - if (timestamps == null) - { - throw new ArgumentNullException(nameof(timestamps)); - } - if (values == null) - { - throw new ArgumentNullException(nameof(values)); - } - - Definition = definition; - Timestamps = timestamps.ToList(); - Values = values.ToList(); + Timestamps = new ChangeTrackingList(); + Values = new ChangeTrackingList(); } /// Initializes a new instance of MetricSeriesData. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.Serialization.cs index 503f4ee6da363..6036c85a7beae 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.Serialization.cs @@ -15,8 +15,8 @@ public partial class MetricSeriesDefinition { internal static MetricSeriesDefinition DeserializeMetricSeriesDefinition(JsonElement element) { - string metricId = default; - IReadOnlyDictionary dimension = default; + Optional metricId = default; + Optional> dimension = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("metricId")) @@ -26,6 +26,11 @@ internal static MetricSeriesDefinition DeserializeMetricSeriesDefinition(JsonEle } if (property.NameEquals("dimension")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } Dictionary dictionary = new Dictionary(); foreach (var property0 in property.Value.EnumerateObject()) { @@ -35,7 +40,7 @@ internal static MetricSeriesDefinition DeserializeMetricSeriesDefinition(JsonEle continue; } } - return new MetricSeriesDefinition(metricId, dimension); + return new MetricSeriesDefinition(metricId.Value, Optional.ToDictionary(dimension)); } } } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.cs index 5a4c25b6a1a1a..18ac1b8b1ab90 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesDefinition.cs @@ -5,29 +5,25 @@ #nullable disable -using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.AI.MetricsAdvisor.Models { /// The MetricSeriesItem. public partial class MetricSeriesDefinition { + /// Initializes a new instance of MetricSeriesDefinition. + internal MetricSeriesDefinition() + { + Dimension = new ChangeTrackingDictionary(); + } + /// Initializes a new instance of MetricSeriesDefinition. /// metric unique id. /// dimension name and value pair. - /// or is null. internal MetricSeriesDefinition(string metricId, IReadOnlyDictionary dimension) { - if (metricId == null) - { - throw new ArgumentNullException(nameof(metricId)); - } - if (dimension == null) - { - throw new ArgumentNullException(nameof(dimension)); - } - MetricId = metricId; Dimension = dimension; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.Serialization.cs index dc890b573d3dd..9ebc2f23b9691 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MetricSeriesQueryOptions : IUtf8JsonSerializable + public partial class MetricSeriesQueryOptions : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.cs index aa1b462ccf265..7be8a8901da3b 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MetricSeriesQueryOptions.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MetricSeriesQueryOptions. - internal partial class MetricSeriesQueryOptions + public partial class MetricSeriesQueryOptions { /// Initializes a new instance of MetricSeriesQueryOptions. /// query series ingested after this time, the format should be yyyy-MM-ddTHH:mm:ssZ. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.Serialization.cs index 5ce5bf1039eae..0ef42ba407a83 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MongoDBDataFeed : IUtf8JsonSerializable + public partial class MongoDBDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static MongoDBDataFeed DeserializeMongoDBDataFeed(JsonElement element) string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static MongoDBDataFeed DeserializeMongoDBDataFeed(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.cs index a7fc0ea1ea8e7..6b08b86e4a9cb 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MongoDBDataFeed. - internal partial class MongoDBDataFeed : DataFeedDetail + public partial class MongoDBDataFeed : DataFeedDetail { /// Initializes a new instance of MongoDBDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.Serialization.cs index e0838288c6fdb..3c81918ab0433 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MongoDBDataFeedPatch : IUtf8JsonSerializable + public partial class MongoDBDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.cs index b65f2ae7e5020..f99ef7014bc55 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MongoDBDataFeedPatch. - internal partial class MongoDBDataFeedPatch : DataFeedDetailPatch + public partial class MongoDBDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of MongoDBDataFeedPatch. public MongoDBDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.Serialization.cs index e366b8b91d0ff..65a9149c938db 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.Serialization.cs @@ -10,38 +10,17 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MongoDBParameter : IUtf8JsonSerializable + public partial class MongoDBParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (ConnectionString != null) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - else - { - writer.WriteNull("connectionString"); - } - if (Database != null) - { - writer.WritePropertyName("database"); - writer.WriteStringValue(Database); - } - else - { - writer.WriteNull("database"); - } - if (Command != null) - { - writer.WritePropertyName("command"); - writer.WriteStringValue(Command); - } - else - { - writer.WriteNull("command"); - } + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + writer.WritePropertyName("database"); + writer.WriteStringValue(Database); + writer.WritePropertyName("command"); + writer.WriteStringValue(Command); writer.WriteEndObject(); } @@ -54,31 +33,16 @@ internal static MongoDBParameter DeserializeMongoDBParameter(JsonElement element { if (property.NameEquals("connectionString")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connectionString = null; - continue; - } connectionString = property.Value.GetString(); continue; } if (property.NameEquals("database")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - database = null; - continue; - } database = property.Value.GetString(); continue; } if (property.NameEquals("command")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - command = null; - continue; - } command = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.cs index 33c1428c8c3ec..f814ff414e490 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MongoDBParameter.cs @@ -5,17 +5,33 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The MongoDBParameter. - internal partial class MongoDBParameter + public partial class MongoDBParameter { /// Initializes a new instance of MongoDBParameter. /// MongoDB connection string. /// Database name. /// Query script. + /// , , or is null. public MongoDBParameter(string connectionString, string database, string command) { + if (connectionString == null) + { + throw new ArgumentNullException(nameof(connectionString)); + } + if (database == null) + { + throw new ArgumentNullException(nameof(database)); + } + if (command == null) + { + throw new ArgumentNullException(nameof(command)); + } + ConnectionString = connectionString; Database = database; Command = command; diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.Serialization.cs index 45528d631c02d..8c98c4875a8e1 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MySqlDataFeed : IUtf8JsonSerializable + public partial class MySqlDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static MySqlDataFeed DeserializeMySqlDataFeed(JsonElement element) string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static MySqlDataFeed DeserializeMySqlDataFeed(JsonElement element) { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.cs index 8b611571c6b1a..96cab83af0c30 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MySqlDataFeed. - internal partial class MySqlDataFeed : DataFeedDetail + public partial class MySqlDataFeed : DataFeedDetail { /// Initializes a new instance of MySqlDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.Serialization.cs index 8d42bbe14559e..4c6c2b60d2955 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class MySqlDataFeedPatch : IUtf8JsonSerializable + public partial class MySqlDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.cs index 45b5fd5f5e770..5870caa688260 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/MySqlDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The MySqlDataFeedPatch. - internal partial class MySqlDataFeedPatch : DataFeedDetailPatch + public partial class MySqlDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of MySqlDataFeedPatch. public MySqlDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.Serialization.cs index 13adea59eb5e3..c4150167d1502 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class PeriodFeedbackValue : IUtf8JsonSerializable + public partial class PeriodFeedbackValue : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.cs index 00cc06fe8171d..07a03da8e1958 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PeriodFeedbackValue.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The PeriodFeedbackValue. - internal partial class PeriodFeedbackValue + public partial class PeriodFeedbackValue { /// Initializes a new instance of PeriodFeedbackValue. /// the type of setting period. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.Serialization.cs index 211ef6312d242..9fcb08cdfbc2a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class PostgreSqlDataFeed : IUtf8JsonSerializable + public partial class PostgreSqlDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static PostgreSqlDataFeed DeserializePostgreSqlDataFeed(JsonElement ele string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static PostgreSqlDataFeed DeserializePostgreSqlDataFeed(JsonElement ele { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.cs index b17b6ce4c6286..309cbe22c743f 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The PostgreSqlDataFeed. - internal partial class PostgreSqlDataFeed : DataFeedDetail + public partial class PostgreSqlDataFeed : DataFeedDetail { /// Initializes a new instance of PostgreSqlDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.Serialization.cs index 2581b10d662d5..feb7f26d63a6b 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class PostgreSqlDataFeedPatch : IUtf8JsonSerializable + public partial class PostgreSqlDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.cs index f9370f88604be..c4b4e409b346c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/PostgreSqlDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The PostgreSqlDataFeedPatch. - internal partial class PostgreSqlDataFeedPatch : DataFeedDetailPatch + public partial class PostgreSqlDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of PostgreSqlDataFeedPatch. public PostgreSqlDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.Serialization.cs index c3b2e051b0f71..697c2177e1e34 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class RootCauseList + public partial class RootCauseList { internal static RootCauseList DeserializeRootCauseList(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.cs index 2513a4222498f..af420e66ccc9c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/RootCauseList.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The RootCauseList. - internal partial class RootCauseList + public partial class RootCauseList { /// Initializes a new instance of RootCauseList. /// . diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.Serialization.cs index e6aac7e929c80..79f76b05cddfd 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class SQLServerDataFeed : IUtf8JsonSerializable + public partial class SQLServerDataFeed : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,15 +32,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(GranularityName.ToString()); if (Optional.IsDefined(GranularityAmount)) { - if (GranularityAmount != null) - { - writer.WritePropertyName("granularityAmount"); - writer.WriteNumberValue(GranularityAmount.Value); - } - else - { - writer.WriteNull("granularityAmount"); - } + writer.WritePropertyName("granularityAmount"); + writer.WriteNumberValue(GranularityAmount.Value); } writer.WritePropertyName("metrics"); writer.WriteStartArray(); @@ -162,7 +155,7 @@ internal static SQLServerDataFeed DeserializeSQLServerDataFeed(JsonElement eleme string dataFeedName = default; Optional dataFeedDescription = default; DataFeedGranularityType granularityName = default; - Optional granularityAmount = default; + Optional granularityAmount = default; IList metrics = default; Optional> dimension = default; Optional timestampColumn = default; @@ -221,7 +214,7 @@ internal static SQLServerDataFeed DeserializeSQLServerDataFeed(JsonElement eleme { if (property.Value.ValueKind == JsonValueKind.Null) { - granularityAmount = null; + property.ThrowNonNullablePropertyIsNull(); continue; } granularityAmount = property.Value.GetInt32(); diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.cs index d90fb7903d9aa..1d10e5bcfd85b 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeed.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The SQLServerDataFeed. - internal partial class SQLServerDataFeed : DataFeedDetail + public partial class SQLServerDataFeed : DataFeedDetail { /// Initializes a new instance of SQLServerDataFeed. /// data feed name. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.Serialization.cs index cd56631fbe389..ca158c86ffbc5 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class SQLServerDataFeedPatch : IUtf8JsonSerializable + public partial class SQLServerDataFeedPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.cs index c5de079afbb9b..06cd82f8aeb25 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SQLServerDataFeedPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The SQLServerDataFeedPatch. - internal partial class SQLServerDataFeedPatch : DataFeedDetailPatch + public partial class SQLServerDataFeedPatch : DataFeedDetailPatch { /// Initializes a new instance of SQLServerDataFeedPatch. public SQLServerDataFeedPatch() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.Serialization.cs index 4fbd7b7667e8e..9615d6bdf7313 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class SeriesIdentity : IUtf8JsonSerializable + public partial class SeriesIdentity : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.cs index 8985c72900736..12af8f484ae18 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesIdentity.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The SeriesIdentity. - internal partial class SeriesIdentity + public partial class SeriesIdentity { /// Initializes a new instance of SeriesIdentity. /// dimension specified for series. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.Serialization.cs index d24bc4d14c35e..cc7fa879f8ced 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class SeriesResultList + public partial class SeriesResultList { internal static SeriesResultList DeserializeSeriesResultList(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.cs index 96c9ca1c8776e..301e585304d89 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeriesResultList.cs @@ -12,7 +12,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The SeriesResultList. - internal partial class SeriesResultList + public partial class SeriesResultList { /// Initializes a new instance of SeriesResultList. /// . diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.Serialization.cs index 5f5cbd0552e1f..ddd02a6012888 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class SeverityFilterCondition : IUtf8JsonSerializable + public partial class SeverityFilterCondition : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.cs index 882ddced0703b..f5276163f8ab6 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SeverityFilterCondition.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The SeverityFilterCondition. - internal partial class SeverityFilterCondition + public partial class SeverityFilterCondition { /// Initializes a new instance of SeverityFilterCondition. /// min severity. diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.Serialization.cs index 7ff8b429a540e..406ef1c61e12a 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.Serialization.cs @@ -10,29 +10,15 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class SqlSourceParameter : IUtf8JsonSerializable + public partial class SqlSourceParameter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (ConnectionString != null) - { - writer.WritePropertyName("connectionString"); - writer.WriteStringValue(ConnectionString); - } - else - { - writer.WriteNull("connectionString"); - } - if (Query != null) - { - writer.WritePropertyName("query"); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } + writer.WritePropertyName("connectionString"); + writer.WriteStringValue(ConnectionString); + writer.WritePropertyName("query"); + writer.WriteStringValue(Query); writer.WriteEndObject(); } @@ -44,21 +30,11 @@ internal static SqlSourceParameter DeserializeSqlSourceParameter(JsonElement ele { if (property.NameEquals("connectionString")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - connectionString = null; - continue; - } connectionString = property.Value.GetString(); continue; } if (property.NameEquals("query")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } query = property.Value.GetString(); continue; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.cs index 49a4fb9d04b95..6214873dcabc2 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/SqlSourceParameter.cs @@ -5,16 +5,28 @@ #nullable disable +using System; + namespace Azure.AI.MetricsAdvisor.Models { /// The SqlSourceParameter. - internal partial class SqlSourceParameter + public partial class SqlSourceParameter { /// Initializes a new instance of SqlSourceParameter. /// Database connection string. /// Query script. + /// or is null. public SqlSourceParameter(string connectionString, string query) { + if (connectionString == null) + { + throw new ArgumentNullException(nameof(connectionString)); + } + if (query == null) + { + throw new ArgumentNullException(nameof(query)); + } + ConnectionString = connectionString; Query = query; } diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.Serialization.cs index 54f553905672c..beb8b9a00720c 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class UsageStats + public partial class UsageStats { internal static UsageStats DeserializeUsageStats(JsonElement element) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.cs index a3674407a5cb0..35367ee4861cf 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/UsageStats.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The UsageStats. - internal partial class UsageStats + public partial class UsageStats { /// Initializes a new instance of UsageStats. internal UsageStats() diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.Serialization.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.Serialization.cs index 77ccc779a6341..e9f170efec2d1 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.Serialization.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.MetricsAdvisor.Models { - internal partial class WebhookHookInfoPatch : IUtf8JsonSerializable + public partial class WebhookHookInfoPatch : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.cs b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.cs index 07a0d14dc61dc..04aa4c6e1f7d2 100644 --- a/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.cs +++ b/sdk/metricsadvisor/Azure.AI.MetricsAdvisor/src/Generated/Models/WebhookHookInfoPatch.cs @@ -8,7 +8,7 @@ namespace Azure.AI.MetricsAdvisor.Models { /// The WebhookHookInfoPatch. - internal partial class WebhookHookInfoPatch : HookInfoPatch + public partial class WebhookHookInfoPatch : HookInfoPatch { /// Initializes a new instance of WebhookHookInfoPatch. public WebhookHookInfoPatch() diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs index 642d6c0b9f847..dddc2eda396dd 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/ContainerRestClient.cs @@ -680,7 +680,6 @@ internal HttpMessage CreateSubmitBatchRequest(long contentLength, string multipa request.Headers.Add("Accept", "application/xml"); request.Headers.Add("Content-Length", contentLength); request.Headers.Add("Content-Type", multipartContentType); - request.Headers.Add("Content-Type", "application/xml"); request.Content = RequestContent.Create(body); return message; } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs index f469d1cab578e..ce49f2cd97746 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/ServiceRestClient.cs @@ -506,7 +506,6 @@ internal HttpMessage CreateSubmitBatchRequest(long contentLength, string multipa request.Headers.Add("Accept", "application/xml"); request.Headers.Add("Content-Length", contentLength); request.Headers.Add("Content-Type", multipartContentType); - request.Headers.Add("Content-Type", "application/xml"); request.Content = RequestContent.Create(body); return message; } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.Serialization.cs index 8099a246ccce5..086c41e87f6fa 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.Serialization.cs @@ -21,21 +21,11 @@ internal static DetectedLanguageInternal DeserializeDetectedLanguageInternal(Jso { if (property.NameEquals("name")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - name = null; - continue; - } name = property.Value.GetString(); continue; } if (property.NameEquals("iso6391Name")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - iso6391Name = null; - continue; - } iso6391Name = property.Value.GetString(); continue; } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.cs index 4b54206d97268..7e9aadfa2aea1 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DetectedLanguageInternal.cs @@ -5,6 +5,8 @@ #nullable disable +using System; + namespace Azure.AI.TextAnalytics.Models { /// The DetectedLanguage. @@ -14,8 +16,18 @@ internal readonly partial struct DetectedLanguageInternal /// Long name of a detected language (e.g. English, French). /// A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr). /// A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. + /// or is null. internal DetectedLanguageInternal(string name, string iso6391Name, double confidenceScore) { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (iso6391Name == null) + { + throw new ArgumentNullException(nameof(iso6391Name)); + } + Name = name; Iso6391Name = iso6391Name; ConfidenceScore = confidenceScore; diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.Serialization.cs index 0e6406dc2200d..c386567e7da41 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class DocumentEntities + public partial class DocumentEntities { internal static DocumentEntities DeserializeDocumentEntities(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.cs index f754a58757948..0938a1fea2c90 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentEntities.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The DocumentEntities. - internal partial class DocumentEntities + public partial class DocumentEntities { /// Initializes a new instance of DocumentEntities. /// Unique, non-empty document identifier. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.Serialization.cs index 7c74386d95bf9..327df9d631183 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class DocumentError + public partial class DocumentError { internal static DocumentError DeserializeDocumentError(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.cs index e779c0f15ded5..541085aea8b5d 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentError.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The DocumentError. - internal partial class DocumentError + public partial class DocumentError { /// Initializes a new instance of DocumentError. /// Document Id. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.Serialization.cs index d28fedaa6b9be..cd41250f5303b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class DocumentKeyPhrases + public partial class DocumentKeyPhrases { internal static DocumentKeyPhrases DeserializeDocumentKeyPhrases(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.cs index 7c0cde854dbb2..6080199bf4474 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentKeyPhrases.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The DocumentKeyPhrases. - internal partial class DocumentKeyPhrases + public partial class DocumentKeyPhrases { /// Initializes a new instance of DocumentKeyPhrases. /// Unique, non-empty document identifier. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.Serialization.cs index f29355b6e5de2..8975d0fa1876e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class DocumentLanguage + public partial class DocumentLanguage { internal static DocumentLanguage DeserializeDocumentLanguage(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.cs index 4bfa460bedcbe..e6b1755b2f1ba 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLanguage.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The DocumentLanguage. - internal partial class DocumentLanguage + public partial class DocumentLanguage { /// Initializes a new instance of DocumentLanguage. /// Unique, non-empty document identifier. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.Serialization.cs index 62c1edf9ff2db..d9fc4977d0e9b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class DocumentLinkedEntities + public partial class DocumentLinkedEntities { internal static DocumentLinkedEntities DeserializeDocumentLinkedEntities(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.cs index 1d3ec8abce18f..83bba2de06f70 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/DocumentLinkedEntities.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The DocumentLinkedEntities. - internal partial class DocumentLinkedEntities + public partial class DocumentLinkedEntities { /// Initializes a new instance of DocumentLinkedEntities. /// Unique, non-empty document identifier. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.Serialization.cs index 6422d046d3473..4c57b5d5b3a7f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class EntitiesResult + public partial class EntitiesResult { internal static EntitiesResult DeserializeEntitiesResult(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.cs index fde41810f2710..f46c270cf8929 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesResult.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The EntitiesResult. - internal partial class EntitiesResult + public partial class EntitiesResult { /// Initializes a new instance of EntitiesResult. /// Response by document. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.Serialization.cs index 649ae0ae1f3ea..04ba580672dcf 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class EntitiesTask : IUtf8JsonSerializable + public partial class EntitiesTask : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.cs index 1adaadc70044a..5a5578afd3c0e 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntitiesTask.cs @@ -8,7 +8,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The EntitiesTask. - internal partial class EntitiesTask + public partial class EntitiesTask { /// Initializes a new instance of EntitiesTask. public EntitiesTask() diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.Serialization.cs index 94e1ec99bf2bc..506a1bd57c326 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class Entity + public partial class Entity { internal static Entity DeserializeEntity(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.cs index 56a5002e7305a..20186666456fa 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/Entity.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The Entity. - internal partial class Entity + public partial class Entity { /// Initializes a new instance of Entity. /// Entity text as appears in the request. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.Serialization.cs index 6b6d1df358b9d..d690d8fbfee1b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class EntityLinkingResult + public partial class EntityLinkingResult { internal static EntityLinkingResult DeserializeEntityLinkingResult(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.cs index f6e8d9efd823f..e111aa4b1d5d1 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingResult.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The EntityLinkingResult. - internal partial class EntityLinkingResult + public partial class EntityLinkingResult { /// Initializes a new instance of EntityLinkingResult. /// Response by document. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.Serialization.cs index 73b4985cb8f11..a35787843e37a 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class EntityLinkingTask : IUtf8JsonSerializable + public partial class EntityLinkingTask : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.cs index f338c593e48ad..78c45ad37528d 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/EntityLinkingTask.cs @@ -8,7 +8,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The EntityLinkingTask. - internal partial class EntityLinkingTask + public partial class EntityLinkingTask { /// Initializes a new instance of EntityLinkingTask. public EntityLinkingTask() diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.Serialization.cs index 2f17bcbdcd03a..523b3934919cb 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class JobDescriptor : IUtf8JsonSerializable + public partial class JobDescriptor : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.cs index 1c8f028ed44e6..f3c9fc07c64a4 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobDescriptor.cs @@ -8,7 +8,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The JobDescriptor. - internal partial class JobDescriptor + public partial class JobDescriptor { /// Initializes a new instance of JobDescriptor. public JobDescriptor() diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.Serialization.cs index 82749d35315f6..93083df67dbf1 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class JobManifest : IUtf8JsonSerializable + public partial class JobManifest : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.cs index 472c310b30f62..2af6bc29fd8be 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/JobManifest.cs @@ -11,7 +11,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The JobManifest. - internal partial class JobManifest + public partial class JobManifest { /// Initializes a new instance of JobManifest. /// The set of tasks to execute on the input documents. Cannot specify the same task more than once. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.Serialization.cs index 7b59eed439d42..68f5dc72c04eb 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class KeyPhraseResult + public partial class KeyPhraseResult { internal static KeyPhraseResult DeserializeKeyPhraseResult(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.cs index 0359a5add1036..62fc12f4ab9bd 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhraseResult.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The KeyPhraseResult. - internal partial class KeyPhraseResult + public partial class KeyPhraseResult { /// Initializes a new instance of KeyPhraseResult. /// Response by document. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.Serialization.cs index 7404db43068e9..0f0e9556214fc 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class KeyPhrasesTask : IUtf8JsonSerializable + public partial class KeyPhrasesTask : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.cs index 010f11ef9494f..00a8f9cabaaec 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/KeyPhrasesTask.cs @@ -8,7 +8,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The KeyPhrasesTask. - internal partial class KeyPhrasesTask + public partial class KeyPhrasesTask { /// Initializes a new instance of KeyPhrasesTask. public KeyPhrasesTask() diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.Serialization.cs index c3055214c7643..51ead482b2882 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class LanguageBatchInput : IUtf8JsonSerializable + public partial class LanguageBatchInput : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.cs index 9fd3d08296049..a678ae788f9d3 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageBatchInput.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The LanguageBatchInput. - internal partial class LanguageBatchInput + public partial class LanguageBatchInput { /// Initializes a new instance of LanguageBatchInput. /// . diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.Serialization.cs index 30c461c280df0..4ea2a4181f488 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.Serialization.cs @@ -10,29 +10,15 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class LanguageInput : IUtf8JsonSerializable + public partial class LanguageInput : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Id != null) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - } - else - { - writer.WriteNull("id"); - } - if (Text != null) - { - writer.WritePropertyName("text"); - writer.WriteStringValue(Text); - } - else - { - writer.WriteNull("text"); - } + writer.WritePropertyName("id"); + writer.WriteStringValue(Id); + writer.WritePropertyName("text"); + writer.WriteStringValue(Text); if (Optional.IsDefined(CountryHint)) { writer.WritePropertyName("countryHint"); diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.cs index e7992b59911b8..9f09aba1c60d8 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageInput.cs @@ -5,16 +5,28 @@ #nullable disable +using System; + namespace Azure.AI.TextAnalytics.Models { /// The LanguageInput. - internal partial class LanguageInput + public partial class LanguageInput { /// Initializes a new instance of LanguageInput. /// Unique, non-empty document identifier. /// . + /// or is null. public LanguageInput(string id, string text) { + if (id == null) + { + throw new ArgumentNullException(nameof(id)); + } + if (text == null) + { + throw new ArgumentNullException(nameof(text)); + } + Id = id; Text = text; } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.Serialization.cs index 93f03dbc75d15..8af937ed0d75b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class LanguageResult + public partial class LanguageResult { internal static LanguageResult DeserializeLanguageResult(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.cs index 62fe3d1a694ea..5bf853706f2a1 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/LanguageResult.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The LanguageResult. - internal partial class LanguageResult + public partial class LanguageResult { /// Initializes a new instance of LanguageResult. /// Response by document. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.Serialization.cs index 61c15a7d5fb2b..04cdfd5c1813b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class MultiLanguageBatchInput : IUtf8JsonSerializable + public partial class MultiLanguageBatchInput : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.cs index f03ac8d5d9bd2..10c7c48614a76 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageBatchInput.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { /// Contains a set of input documents to be analyzed by the service. - internal partial class MultiLanguageBatchInput + public partial class MultiLanguageBatchInput { /// Initializes a new instance of MultiLanguageBatchInput. /// The set of documents to process as part of this batch. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.Serialization.cs index 10928df43be23..f121ab08f9514 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class MultiLanguageInput : IUtf8JsonSerializable + public partial class MultiLanguageInput : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.cs index 14db71884db5f..bfd062e488ae4 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/MultiLanguageInput.cs @@ -8,7 +8,7 @@ namespace Azure.AI.TextAnalytics.Models { /// Contains an input document to be analyzed by the service. - internal partial class MultiLanguageInput + public partial class MultiLanguageInput { /// Initializes a new instance of MultiLanguageInput. /// A unique, non-empty document identifier. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.Serialization.cs index 16b147dc33128..197a1bac0b12d 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class PiiDocumentEntities + public partial class PiiDocumentEntities { internal static PiiDocumentEntities DeserializePiiDocumentEntities(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.cs index abd3230d01181..83f58bdac1d25 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiDocumentEntities.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The PiiDocumentEntities. - internal partial class PiiDocumentEntities + public partial class PiiDocumentEntities { /// Initializes a new instance of PiiDocumentEntities. /// Unique, non-empty document identifier. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.Serialization.cs index 6f2adbf4dc6d1..b5d528514db00 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class PiiTask : IUtf8JsonSerializable + public partial class PiiTask : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.cs index 0bb15ca2db21c..31fa21b7a6947 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/PiiTask.cs @@ -8,7 +8,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The PiiTask. - internal partial class PiiTask + public partial class PiiTask { /// Initializes a new instance of PiiTask. public PiiTask() diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.Serialization.cs index e90d143b9d900..058eb8f08edc0 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class SentimentResponse + public partial class SentimentResponse { internal static SentimentResponse DeserializeSentimentResponse(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.cs index 4735339b50990..5f0c3199dde34 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/SentimentResponse.cs @@ -13,7 +13,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The SentimentResponse. - internal partial class SentimentResponse + public partial class SentimentResponse { /// Initializes a new instance of SentimentResponse. /// Sentiment analysis per document. diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.Serialization.cs index 1e5e230a3c57b..8f3211eeb584a 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class TargetConfidenceScoreLabel + public partial class TargetConfidenceScoreLabel { internal static TargetConfidenceScoreLabel DeserializeTargetConfidenceScoreLabel(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.cs index f178ab4eea6d8..04fde97ce2937 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetConfidenceScoreLabel.cs @@ -8,7 +8,7 @@ namespace Azure.AI.TextAnalytics.Models { /// Represents the confidence scores across all sentiment classes: positive, neutral, negative. - internal partial class TargetConfidenceScoreLabel + public partial class TargetConfidenceScoreLabel { /// Initializes a new instance of TargetConfidenceScoreLabel. /// . diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.Serialization.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.Serialization.cs index a191710716276..bf26f540e8f5f 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.Serialization.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { - internal partial class TargetRelation + public partial class TargetRelation { internal static TargetRelation DeserializeTargetRelation(JsonElement element) { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.cs index 0306466e923ef..3854f2ba0c512 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/Generated/Models/TargetRelation.cs @@ -10,7 +10,7 @@ namespace Azure.AI.TextAnalytics.Models { /// The TargetRelation. - internal partial class TargetRelation + public partial class TargetRelation { /// Initializes a new instance of TargetRelation. /// The type related to the target. diff --git a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.Serialization.cs b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.Serialization.cs index a6ade4f7ed09f..c235490c744c6 100644 --- a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.Serialization.cs +++ b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.Iot.TimeSeriesInsights { - internal partial class UpdateModelSettingsRequest : IUtf8JsonSerializable + public partial class UpdateModelSettingsRequest : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { diff --git a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.cs b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.cs index 2bcabf687e321..3056d135d4a20 100644 --- a/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.cs +++ b/sdk/timeseriesinsights/Azure.Iot.TimeSeriesInsights/src/Generated/Models/UpdateModelSettingsRequest.cs @@ -8,7 +8,7 @@ namespace Azure.Iot.TimeSeriesInsights { /// Request to update model settings. One of "name" or "defaultTypeId" must be set. - internal partial class UpdateModelSettingsRequest + public partial class UpdateModelSettingsRequest { /// Initializes a new instance of UpdateModelSettingsRequest. public UpdateModelSettingsRequest()