From c26feb1aee4fba93d0a3ba043358aee0ad025c0f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 06:18:52 +0000 Subject: [PATCH] CodeGen from PR 34631 in Azure/azure-rest-api-specs Merge 5afe59a92e729a1560e9a3d44cede1709b858b34 into c269b7b78cac2808d7acc55124a9653b2e904e4b --- .../Configuration.json | 12 + .../src/autorest.md | 55 - .../tsp-location.yaml | 4 + .../tspCodeModel.json | 17360 ++++++++++++++++ .../LiveMetrics/LiveMetrics.sln | 50 + .../src/Generated/AggregationType.cs | 57 + ...lectionConfigurationError.Serialization.cs | 177 + .../Generated/CollectionConfigurationError.cs | 96 + .../CollectionConfigurationErrorType.cs | 84 + ...llectionConfigurationInfo.Serialization.cs | 194 + .../Generated/CollectionConfigurationInfo.cs | 94 + .../DerivedMetricInfo.Serialization.cs | 200 + .../src/Generated/DerivedMetricInfo.cs | 109 + .../src/Generated/Docs/LiveMetricsClient.xml | 439 + ...ilterConjunctionGroupInfo.Serialization.cs | 151 + .../DocumentFilterConjunctionGroupInfo.cs | 81 + .../DocumentIngress.Serialization.cs | 158 + .../src/Generated/DocumentIngress.cs | 79 + .../DocumentStreamInfo.Serialization.cs | 161 + .../src/Generated/DocumentStreamInfo.cs | 83 + .../LiveMetrics/src/Generated/DocumentType.cs | 63 + .../src/Generated/Event.Serialization.cs | 168 + .../LiveMetrics/src/Generated/Event.cs | 36 + .../src/Generated/Exception.Serialization.cs | 185 + .../LiveMetrics/src/Generated/Exception.cs | 40 + ...ilterConjunctionGroupInfo.Serialization.cs | 153 + .../Generated/FilterConjunctionGroupInfo.cs | 76 + .../src/Generated/FilterInfo.Serialization.cs | 159 + .../LiveMetrics/src/Generated/FilterInfo.cs | 88 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 407 + .../src/Generated/Internal/Optional.cs | 51 + .../Internal/RequestContentHelper.cs | 136 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../KeyValuePairStringString.Serialization.cs | 151 + .../src/Generated/KeyValuePairStringString.cs | 82 + .../src/Generated/LiveMetricsClient.cs | 408 + .../LiveMetricsClientBuilderExtensions.cs | 35 + .../src/Generated/LiveMetricsClientOptions.cs | 37 + .../src/Generated/LiveMetricsModelFactory.cs | 148 + .../Generated/MetricPoint.Serialization.cs | 159 + .../LiveMetrics/src/Generated/MetricPoint.cs | 87 + .../Generated/Models/LiveMetricsContext.cs | 19 + .../MonitoringDataPoint.Serialization.cs | 344 + .../src/Generated/MonitoringDataPoint.cs | 157 + .../src/Generated/PredicateType.cs | 69 + .../Generated/ProcessCpuData.Serialization.cs | 151 + .../src/Generated/ProcessCpuData.cs | 81 + .../QuotaConfigurationInfo.Serialization.cs | 166 + .../src/Generated/QuotaConfigurationInfo.cs | 82 + .../RemoteDependency.Serialization.cs | 209 + .../src/Generated/RemoteDependency.cs | 48 + .../src/Generated/Request.Serialization.cs | 213 + .../LiveMetrics/src/Generated/Request.cs | 48 + .../src/Generated/TelemetryType.cs | 66 + .../src/Generated/Trace.Serialization.cs | 168 + .../LiveMetrics/src/Generated/Trace.cs | 36 + .../UnknownDocumentIngress.Serialization.cs | 157 + .../src/Generated/UnknownDocumentIngress.cs | 30 + .../LiveMetrics/src/LiveMetrics.csproj | 19 + .../src/Properties/AssemblyInfo.cs | 6 + .../Samples/Samples_LiveMetricsClient.cs | 454 + .../tests/LiveMetrics.Tests.csproj | 19 + .../LiveMetrics/tsp-location.yaml | 4 + .../tsp-location.yaml | 5 +- .../Microsoft.App.DynamicSessions.sln | 50 + .../src/Generated/CodeExecution.cs | 355 + .../src/Generated/CodeInputType.cs | 54 + .../src/Generated/Docs/CodeExecution.xml | 291 + .../Generated/Docs/SessionResourceFiles.xml | 253 + .../src/Generated/DynamicSessionsClient.cs | 79 + .../Generated/DynamicSessionsClientOptions.cs | 37 + .../Generated/ErrorResponse.Serialization.cs | 143 + .../src/Generated/ErrorResponse.cs | 76 + .../src/Generated/ExecutionType.cs | 51 + .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 407 + .../MultipartFormDataRequestContent.cs | 203 + .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...pDynamicSessionsClientBuilderExtensions.cs | 35 + ...MicrosoftAppDynamicSessionsModelFactory.cs | 75 + .../MicrosoftAppDynamicSessionsContext.cs | 19 + .../src/Generated/OperationState.cs | 60 + ...ssionCodeExecutionRequest.Serialization.cs | 167 + .../Generated/SessionCodeExecutionRequest.cs | 93 + ...sionCodeExecutionResource.Serialization.cs | 207 + .../Generated/SessionCodeExecutionResource.cs | 99 + ...essionCodeExecutionResult.Serialization.cs | 194 + .../Generated/SessionCodeExecutionResult.cs | 106 + .../SessionResourceFile.Serialization.cs | 191 + .../src/Generated/SessionResourceFile.cs | 96 + .../src/Generated/SessionResourceFiles.cs | 722 + .../Generated/UploadRequest.Serialization.cs | 175 + .../src/Generated/UploadRequest.cs | 76 + .../src/Microsoft.App.DynamicSessions.csproj | 19 + .../src/Properties/AssemblyInfo.cs | 6 + .../Samples/Samples_CodeExecution.cs | 342 + .../Samples/Samples_SessionResourceFiles.cs | 268 + ...Microsoft.App.DynamicSessions.Tests.csproj | 19 + .../tsp-location.yaml | 4 + 105 files changed, 30838 insertions(+), 57 deletions(-) create mode 100644 sdk/appconfiguration/Azure.Data.AppConfiguration/Configuration.json delete mode 100644 sdk/appconfiguration/Azure.Data.AppConfiguration/src/autorest.md create mode 100644 sdk/appconfiguration/Azure.Data.AppConfiguration/tsp-location.yaml create mode 100644 sdk/appconfiguration/Azure.Data.AppConfiguration/tspCodeModel.json create mode 100644 sdk/applicationinsights/LiveMetrics/LiveMetrics.sln create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/AggregationType.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationErrorType.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Docs/LiveMetricsClient.xml create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/DocumentType.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Event.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Event.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Exception.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Exception.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Argument.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Optional.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Internal/RequestContentHelper.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClient.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientBuilderExtensions.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientOptions.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsModelFactory.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Models/LiveMetricsContext.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/PredicateType.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Request.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Request.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/TelemetryType.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Trace.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/Trace.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.Serialization.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.cs create mode 100644 sdk/applicationinsights/LiveMetrics/src/LiveMetrics.csproj create mode 100644 sdk/applicationinsights/LiveMetrics/src/Properties/AssemblyInfo.cs create mode 100644 sdk/applicationinsights/LiveMetrics/tests/Generated/Samples/Samples_LiveMetricsClient.cs create mode 100644 sdk/applicationinsights/LiveMetrics/tests/LiveMetrics.Tests.csproj create mode 100644 sdk/applicationinsights/LiveMetrics/tsp-location.yaml create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/Microsoft.App.DynamicSessions.sln create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeExecution.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeInputType.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/CodeExecution.xml create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionResourceFiles.xml create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClient.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClientOptions.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.Serialization.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ExecutionType.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Argument.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/MultipartFormDataRequestContent.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Optional.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsClientBuilderExtensions.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsModelFactory.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Models/MicrosoftAppDynamicSessionsContext.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/OperationState.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.Serialization.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.Serialization.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.Serialization.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.Serialization.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFiles.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.Serialization.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Microsoft.App.DynamicSessions.csproj create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Properties/AssemblyInfo.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_CodeExecution.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_SessionResourceFiles.cs create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Microsoft.App.DynamicSessions.Tests.csproj create mode 100644 sdk/microsoft.app/Microsoft.App.DynamicSessions/tsp-location.yaml diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/Configuration.json b/sdk/appconfiguration/Azure.Data.AppConfiguration/Configuration.json new file mode 100644 index 000000000000..ede625681568 --- /dev/null +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/Configuration.json @@ -0,0 +1,12 @@ +{ + "output-folder": ".", + "namespace": "Azure.Data.AppConfiguration", + "library-name": "Azure.Data.AppConfiguration", + "flavor": "azure", + "use-model-reader-writer": true, + "shared-source-folders": [ + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared", + "../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared" + ], + "model-namespace": false +} diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/autorest.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/autorest.md deleted file mode 100644 index af1f2ccf84c9..000000000000 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/autorest.md +++ /dev/null @@ -1,55 +0,0 @@ -# Azure SDK Code Generation for Data Plane - -Run `dotnet build /t:GenerateCode` to generate code. - -### AutoRest Configuration -> see https://aka.ms/autorest -``` yaml -input-file: -- https://github.com/Azure/azure-rest-api-specs/blob/c1af3ab8e803da2f40fc90217a6d023bc13b677f/specification/appconfiguration/data-plane/Microsoft.AppConfiguration/stable/2023-11-01/appconfiguration.json -namespace: Azure.Data.AppConfiguration -title: ConfigurationClient -``` - -### Change Endpoint type to Uri -``` yaml -directive: - from: swagger-document - where: $.parameters.Endpoint - transform: $.format = "url" - ``` - -### Modify operation names -``` yaml -directive: -- rename-operation: - from: PutKeyValue - to: SetConfigurationSetting -- rename-operation: - from: DeleteKeyValue - to: DeleteConfigurationSetting -- rename-operation: - from: GetKeyValue - to: GetConfigurationSetting -- rename-operation: - from: GetKeyValues - to: GetConfigurationSettings -- rename-operation: - from: PutLock - to: CreateReadOnlyLock -- rename-operation: - from: DeleteLock - to: DeleteReadOnlyLock -- rename-operation: - from: UpdateSnapshot - to: UpdateSnapshotStatus -``` - -### Internalize protocol methods -``` yaml -directive: - from: swagger-document - where: $.paths.*.* - transform: > - $["x-accessibility"] = "internal" -``` diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/tsp-location.yaml b/sdk/appconfiguration/Azure.Data.AppConfiguration/tsp-location.yaml new file mode 100644 index 000000000000..a27140012652 --- /dev/null +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/appconfiguration/AppConfiguration +commit: c537a4e6cc3ed95c030b2c10671d1f0585ddcc08 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/tspCodeModel.json b/sdk/appconfiguration/Azure.Data.AppConfiguration/tspCodeModel.json new file mode 100644 index 000000000000..df3af1fa77a0 --- /dev/null +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/tspCodeModel.json @@ -0,0 +1,17360 @@ +{ + "$id": "1", + "name": "AzureAppConfiguration", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "enums": [ + { + "$id": "2", + "kind": "enum", + "name": "GetKeysResponseContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeys.ResponseContentType.anonymous", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.keyset+json", + "value": "application/vnd.microsoft.appconfig.keyset+json", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "application/problem+json", + "value": "application/problem+json", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "8", + "kind": "enum", + "name": "KeyValueFields", + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueFields", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "10", + "kind": "enumvalue", + "name": "key", + "value": "key", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Key field.", + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "label", + "value": "label", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Label field.", + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "content_type", + "value": "content_type", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Content type field.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "value", + "value": "value", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Value field.", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "last_modified", + "value": "last_modified", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Last modified field.", + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "tags", + "value": "tags", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Tags field.", + "decorators": [] + }, + { + "$id": "22", + "kind": "enumvalue", + "name": "locked", + "value": "locked", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Locked field.", + "decorators": [] + }, + { + "$id": "24", + "kind": "enumvalue", + "name": "etag", + "value": "etag", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "doc": "Etag field.", + "decorators": [] + } + ], + "namespace": "Azure.Data.AppConfiguration", + "doc": "Key-value fields.", + "isFixed": false, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "26", + "kind": "enum", + "name": "GetKeyValuesResponseContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeyValues.ResponseContentType.anonymous", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "28", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.kvset+json", + "value": "application/vnd.microsoft.appconfig.kvset+json", + "valueType": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "application/problem+json", + "value": "application/problem+json", + "valueType": { + "$id": "31", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "26" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "32", + "kind": "enum", + "name": "GetKeyValueResponseContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeyValue.ResponseContentType.anonymous", + "valueType": { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "34", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.kv+json", + "value": "application/vnd.microsoft.appconfig.kv+json", + "valueType": { + "$id": "35", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "decorators": [] + }, + { + "$id": "36", + "kind": "enumvalue", + "name": "application/problem+json", + "value": "application/problem+json", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "32" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "38", + "kind": "enum", + "name": "PutKeyValueRequestContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.putKeyValue.RequestContentType.anonymous", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "40", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.kv+json", + "value": "application/vnd.microsoft.appconfig.kv+json", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "decorators": [] + }, + { + "$id": "42", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.kvset+json", + "value": "application/vnd.microsoft.appconfig.kvset+json", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "decorators": [] + }, + { + "$id": "44", + "kind": "enumvalue", + "name": "application/json", + "value": "application/json", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "text/json", + "value": "text/json", + "valueType": { + "$id": "47", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "application/*+json", + "value": "application/*+json", + "valueType": { + "$id": "49", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "decorators": [] + }, + { + "$id": "50", + "kind": "enumvalue", + "name": "application/json-patch+json", + "value": "application/json-patch+json", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "38" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "52", + "kind": "enum", + "name": "SnapshotFields", + "crossLanguageDefinitionId": "AzureAppConfiguration.SnapshotFields", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "54", + "kind": "enumvalue", + "name": "name", + "value": "name", + "valueType": { + "$id": "55", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Name field.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "status", + "value": "status", + "valueType": { + "$id": "57", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Status field.", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "filters", + "value": "filters", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Filters field.", + "decorators": [] + }, + { + "$id": "60", + "kind": "enumvalue", + "name": "composition_type", + "value": "composition_type", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Composition type field.", + "decorators": [] + }, + { + "$id": "62", + "kind": "enumvalue", + "name": "created", + "value": "created", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Created field.", + "decorators": [] + }, + { + "$id": "64", + "kind": "enumvalue", + "name": "expires", + "value": "expires", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Expires field.", + "decorators": [] + }, + { + "$id": "66", + "kind": "enumvalue", + "name": "retention_period", + "value": "retention_period", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Retention period field.", + "decorators": [] + }, + { + "$id": "68", + "kind": "enumvalue", + "name": "size", + "value": "size", + "valueType": { + "$id": "69", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Size field.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "items_count", + "value": "items_count", + "valueType": { + "$id": "71", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Items count field.", + "decorators": [] + }, + { + "$id": "72", + "kind": "enumvalue", + "name": "tags", + "value": "tags", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Tags field.", + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "etag", + "value": "etag", + "valueType": { + "$id": "75", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "52" + }, + "doc": "Etag field.", + "decorators": [] + } + ], + "namespace": "Azure.Data.AppConfiguration", + "doc": "Snapshot fields.", + "isFixed": false, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "76", + "kind": "enum", + "name": "SnapshotStatus", + "crossLanguageDefinitionId": "AzureAppConfiguration.SnapshotStatus", + "valueType": { + "$id": "77", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "78", + "kind": "enumvalue", + "name": "provisioning", + "value": "provisioning", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Provisioning", + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "ready", + "value": "ready", + "valueType": { + "$id": "81", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Ready", + "decorators": [] + }, + { + "$id": "82", + "kind": "enumvalue", + "name": "archived", + "value": "archived", + "valueType": { + "$id": "83", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Archived", + "decorators": [] + }, + { + "$id": "84", + "kind": "enumvalue", + "name": "failed", + "value": "failed", + "valueType": { + "$id": "85", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "76" + }, + "doc": "Failed", + "decorators": [] + } + ], + "namespace": "Azure.Data.AppConfiguration", + "doc": "Snapshot status.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,JsonMergePatch,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "86", + "kind": "enum", + "name": "CompositionType", + "crossLanguageDefinitionId": "AzureAppConfiguration.CompositionType", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "88", + "kind": "enumvalue", + "name": "key", + "value": "key", + "valueType": { + "$id": "89", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "The 'key' composition type.", + "decorators": [] + }, + { + "$id": "90", + "kind": "enumvalue", + "name": "key_label", + "value": "key_label", + "valueType": { + "$id": "91", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "86" + }, + "doc": "The 'key_label' composition type.", + "decorators": [] + } + ], + "namespace": "Azure.Data.AppConfiguration", + "doc": "Composition types.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "92", + "kind": "enum", + "name": "GetSnapshotsResponseContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.getSnapshots.ResponseContentType.anonymous", + "valueType": { + "$id": "93", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "94", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.snapshotset+json", + "value": "application/vnd.microsoft.appconfig.snapshotset+json", + "valueType": { + "$id": "95", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "92" + }, + "decorators": [] + }, + { + "$id": "96", + "kind": "enumvalue", + "name": "application/problem+json", + "value": "application/problem+json", + "valueType": { + "$id": "97", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "92" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "98", + "kind": "enum", + "name": "GetSnapshotResponseContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.getSnapshot.ResponseContentType.anonymous", + "valueType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "100", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.snapshot+json", + "value": "application/vnd.microsoft.appconfig.snapshot+json", + "valueType": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "98" + }, + "decorators": [] + }, + { + "$id": "102", + "kind": "enumvalue", + "name": "application/problem+json", + "value": "application/problem+json", + "valueType": { + "$id": "103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "98" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "104", + "kind": "enum", + "name": "OperationState", + "crossLanguageDefinitionId": "Azure.Core.Foundations.OperationState", + "valueType": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "106", + "kind": "enumvalue", + "name": "NotStarted", + "value": "NotStarted", + "valueType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "104" + }, + "doc": "The operation has not started.", + "decorators": [] + }, + { + "$id": "108", + "kind": "enumvalue", + "name": "Running", + "value": "Running", + "valueType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "104" + }, + "doc": "The operation is in progress.", + "decorators": [] + }, + { + "$id": "110", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "104" + }, + "doc": "The operation has completed successfully.", + "decorators": [] + }, + { + "$id": "112", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "104" + }, + "doc": "The operation has failed.", + "decorators": [] + }, + { + "$id": "114", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "104" + }, + "doc": "The operation has been canceled by the user.", + "decorators": [] + } + ], + "namespace": "Azure.Data.AppConfiguration", + "doc": "Enum describing allowed operation states.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroPolling", + "decorators": [] + }, + { + "$id": "116", + "kind": "enum", + "name": "CreateSnapshotRequestContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.createSnapshot.RequestContentType.anonymous", + "valueType": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "118", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.snapshot+json", + "value": "application/vnd.microsoft.appconfig.snapshot+json", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "116" + }, + "decorators": [] + }, + { + "$id": "120", + "kind": "enumvalue", + "name": "application/json", + "value": "application/json", + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "116" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "122", + "kind": "enum", + "name": "UpdateSnapshotRequestContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.updateSnapshot.RequestContentType.anonymous", + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "124", + "kind": "enumvalue", + "name": "application/merge-patch+json", + "value": "application/merge-patch+json", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "122" + }, + "decorators": [] + }, + { + "$id": "126", + "kind": "enumvalue", + "name": "application/json", + "value": "application/json", + "valueType": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "122" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "128", + "kind": "enum", + "name": "LabelFields", + "crossLanguageDefinitionId": "AzureAppConfiguration.LabelFields", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "130", + "kind": "enumvalue", + "name": "name", + "value": "name", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "128" + }, + "doc": "Name field.", + "decorators": [] + } + ], + "namespace": "Azure.Data.AppConfiguration", + "doc": "Label fields.", + "isFixed": false, + "isFlags": false, + "usage": "Input", + "decorators": [] + }, + { + "$id": "132", + "kind": "enum", + "name": "GetLabelsResponseContentType", + "crossLanguageDefinitionId": "AzureAppConfiguration.getLabels.ResponseContentType.anonymous", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "134", + "kind": "enumvalue", + "name": "application/vnd.microsoft.appconfig.labelset+json", + "value": "application/vnd.microsoft.appconfig.labelset+json", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "132" + }, + "decorators": [] + }, + { + "$id": "136", + "kind": "enumvalue", + "name": "application/problem+json", + "value": "application/problem+json", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "132" + }, + "decorators": [] + } + ], + "namespace": "", + "isFixed": true, + "isFlags": false, + "usage": "Output", + "decorators": [] + }, + { + "$id": "138", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "AzureAppConfiguration.Versions", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "140", + "kind": "enumvalue", + "name": "v2023_11_01", + "value": "2023-11-01", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "138" + }, + "doc": "The 2023-11-01 API version", + "decorators": [] + }, + { + "$id": "142", + "kind": "enumvalue", + "name": "v2024_09_01", + "value": "2024-09-01", + "valueType": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "138" + }, + "doc": "The 2024-09-01 API version", + "decorators": [] + } + ], + "namespace": "Azure.Data.AppConfiguration", + "doc": "Service API versions", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "models": [ + { + "$id": "144", + "kind": "model", + "name": "KeyListResult", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyListResult", + "usage": "Output,Json", + "doc": "The result of a list request.", + "decorators": [], + "properties": [ + { + "$id": "145", + "kind": "property", + "name": "items", + "serializedName": "items", + "doc": "The collection value.", + "type": { + "$id": "146", + "kind": "array", + "name": "ArrayKey", + "valueType": { + "$id": "147", + "kind": "model", + "name": "Key", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.Key", + "usage": "Output,Json", + "doc": "Keys serve as identifiers for key-values and are used to store and retrieve corresponding values.", + "decorators": [], + "properties": [ + { + "$id": "148", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the key.", + "type": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Key.name", + "serializationOptions": { + "$id": "150", + "json": { + "$id": "151", + "name": "name" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyListResult.items", + "serializationOptions": { + "$id": "152", + "json": { + "$id": "153", + "name": "items" + } + } + }, + { + "$id": "154", + "kind": "property", + "name": "@nextLink", + "serializedName": "@nextLink", + "doc": "The URI that can be used to request the next set of paged results.", + "type": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyListResult.@nextLink", + "serializationOptions": { + "$id": "156", + "json": { + "$id": "157", + "name": "@nextLink" + } + } + } + ] + }, + { + "$ref": "147" + }, + { + "$id": "158", + "kind": "model", + "name": "Error", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.Error", + "usage": "Json,Exception", + "doc": "Azure App Configuration error object.", + "decorators": [], + "properties": [ + { + "$id": "159", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the error.", + "type": { + "$id": "160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Error.type", + "serializationOptions": { + "$id": "161", + "json": { + "$id": "162", + "name": "type" + } + } + }, + { + "$id": "163", + "kind": "property", + "name": "title", + "serializedName": "title", + "doc": "A brief summary of the error.", + "type": { + "$id": "164", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Error.title", + "serializationOptions": { + "$id": "165", + "json": { + "$id": "166", + "name": "title" + } + } + }, + { + "$id": "167", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the parameter that resulted in the error.", + "type": { + "$id": "168", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Error.name", + "serializationOptions": { + "$id": "169", + "json": { + "$id": "170", + "name": "name" + } + } + }, + { + "$id": "171", + "kind": "property", + "name": "detail", + "serializedName": "detail", + "doc": "A detailed description of the error.", + "type": { + "$id": "172", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Error.detail", + "serializationOptions": { + "$id": "173", + "json": { + "$id": "174", + "name": "detail" + } + } + }, + { + "$id": "175", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The HTTP status code that the error maps to.", + "type": { + "$id": "176", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Error.status", + "serializationOptions": { + "$id": "177", + "json": { + "$id": "178", + "name": "status" + } + } + } + ] + }, + { + "$id": "179", + "kind": "model", + "name": "KeyValueListResult", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueListResult", + "usage": "Output,Json", + "doc": "The result of a list request.", + "decorators": [], + "properties": [ + { + "$id": "180", + "kind": "property", + "name": "items", + "serializedName": "items", + "doc": "The collection value.", + "type": { + "$id": "181", + "kind": "array", + "name": "ArrayKeyValue", + "valueType": { + "$id": "182", + "kind": "model", + "name": "KeyValue", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue", + "usage": "Input,Output,Json", + "doc": "A key-value pair representing application settings.", + "decorators": [], + "properties": [ + { + "$id": "183", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "The key of the key-value.", + "type": { + "$id": "184", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.key", + "serializationOptions": { + "$id": "185", + "json": { + "$id": "186", + "name": "key" + } + } + }, + { + "$id": "187", + "kind": "property", + "name": "label", + "serializedName": "label", + "doc": "The label the key-value belongs to.", + "type": { + "$id": "188", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.label", + "serializationOptions": { + "$id": "189", + "json": { + "$id": "190", + "name": "label" + } + } + }, + { + "$id": "191", + "kind": "property", + "name": "contentType", + "serializedName": "content_type", + "doc": "The content type of the value stored within the key-value.", + "type": { + "$id": "192", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.contentType", + "serializationOptions": { + "$id": "193", + "json": { + "$id": "194", + "name": "content_type" + } + } + }, + { + "$id": "195", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The value of the key-value.", + "type": { + "$id": "196", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.value", + "serializationOptions": { + "$id": "197", + "json": { + "$id": "198", + "name": "value" + } + } + }, + { + "$id": "199", + "kind": "property", + "name": "lastModified", + "serializedName": "last_modified", + "doc": "A date representing the last time the key-value was modified.", + "type": { + "$id": "200", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.lastModified", + "serializationOptions": { + "$id": "202", + "json": { + "$id": "203", + "name": "last_modified" + } + } + }, + { + "$id": "204", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "The tags of the key-value", + "type": { + "$id": "205", + "kind": "dict", + "keyType": { + "$id": "206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "207", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.tags", + "serializationOptions": { + "$id": "208", + "json": { + "$id": "209", + "name": "tags" + } + } + }, + { + "$id": "210", + "kind": "property", + "name": "locked", + "serializedName": "locked", + "doc": "Indicates whether the key-value is locked.", + "type": { + "$id": "211", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.locked", + "serializationOptions": { + "$id": "212", + "json": { + "$id": "213", + "name": "locked" + } + } + }, + { + "$id": "214", + "kind": "property", + "name": "etag", + "serializedName": "etag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValue.etag", + "serializationOptions": { + "$id": "216", + "json": { + "$id": "217", + "name": "etag" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueListResult.items", + "serializationOptions": { + "$id": "218", + "json": { + "$id": "219", + "name": "items" + } + } + }, + { + "$id": "220", + "kind": "property", + "name": "etag", + "serializedName": "etag", + "doc": "An identifier representing the returned state of the resource.", + "type": { + "$id": "221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueListResult.etag", + "serializationOptions": { + "$id": "222", + "json": { + "$id": "223", + "name": "etag" + } + } + }, + { + "$id": "224", + "kind": "property", + "name": "@nextLink", + "serializedName": "@nextLink", + "doc": "The URI that can be used to request the next set of paged results.", + "type": { + "$id": "225", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueListResult.@nextLink", + "serializationOptions": { + "$id": "226", + "json": { + "$id": "227", + "name": "@nextLink" + } + } + } + ] + }, + { + "$ref": "182" + }, + { + "$id": "228", + "kind": "model", + "name": "SnapshotListResult", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.SnapshotListResult", + "usage": "Output,Json", + "doc": "The result of a snapshot list request.", + "decorators": [], + "properties": [ + { + "$id": "229", + "kind": "property", + "name": "items", + "serializedName": "items", + "doc": "The collection value.", + "type": { + "$id": "230", + "kind": "array", + "name": "ArraySnapshot", + "valueType": { + "$id": "231", + "kind": "model", + "name": "Snapshot", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A snapshot is a named, immutable subset of an App Configuration store's key-values.", + "decorators": [], + "properties": [ + { + "$id": "232", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the snapshot.", + "type": { + "$id": "233", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.name", + "serializationOptions": { + "$id": "234", + "json": { + "$id": "235", + "name": "name" + } + } + }, + { + "$id": "236", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The current status of the snapshot.", + "type": { + "$ref": "76" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.status", + "serializationOptions": { + "$id": "237", + "json": { + "$id": "238", + "name": "status" + } + } + }, + { + "$id": "239", + "kind": "property", + "name": "filters", + "serializedName": "filters", + "doc": "A list of filters used to filter the key-values included in the snapshot.", + "type": { + "$id": "240", + "kind": "array", + "name": "ArrayKeyValueFilter", + "valueType": { + "$id": "241", + "kind": "model", + "name": "KeyValueFilter", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueFilter", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Enables filtering of key-values. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapisnapshots", + "decorators": [], + "properties": [ + { + "$id": "242", + "kind": "property", + "name": "key", + "serializedName": "key", + "doc": "Filters key-values by their key field.", + "type": { + "$id": "243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueFilter.key", + "serializationOptions": { + "$id": "244", + "json": { + "$id": "245", + "name": "key" + } + } + }, + { + "$id": "246", + "kind": "property", + "name": "label", + "serializedName": "label", + "doc": "Filters key-values by their label field.", + "type": { + "$id": "247", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueFilter.label", + "serializationOptions": { + "$id": "248", + "json": { + "$id": "249", + "name": "label" + } + } + }, + { + "$id": "250", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Filters key-values by their tags field.", + "type": { + "$id": "251", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "252", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.KeyValueFilter.tags", + "serializationOptions": { + "$id": "253", + "json": { + "$id": "254", + "name": "tags" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.filters", + "serializationOptions": { + "$id": "255", + "json": { + "$id": "256", + "name": "filters" + } + } + }, + { + "$id": "257", + "kind": "property", + "name": "compositionType", + "serializedName": "composition_type", + "doc": "The composition type describes how the key-values within the snapshot are\ncomposed. The 'key' composition type ensures there are no two key-values\ncontaining the same key. The 'key_label' composition type ensures there are no\ntwo key-values containing the same key and label.", + "type": { + "$ref": "86" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.compositionType", + "serializationOptions": { + "$id": "258", + "json": { + "$id": "259", + "name": "composition_type" + } + } + }, + { + "$id": "260", + "kind": "property", + "name": "created", + "serializedName": "created", + "doc": "The time that the snapshot was created.", + "type": { + "$id": "261", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.created", + "serializationOptions": { + "$id": "263", + "json": { + "$id": "264", + "name": "created" + } + } + }, + { + "$id": "265", + "kind": "property", + "name": "expires", + "serializedName": "expires", + "doc": "The time that the snapshot will expire.", + "type": { + "$id": "266", + "kind": "offsetDateTime", + "name": "offsetDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.offsetDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.expires", + "serializationOptions": { + "$id": "268", + "json": { + "$id": "269", + "name": "expires" + } + } + }, + { + "$id": "270", + "kind": "property", + "name": "retentionPeriod", + "serializedName": "retention_period", + "doc": "The amount of time, in seconds, that a snapshot will remain in the archived\nstate before expiring. This property is only writable during the creation of a\nsnapshot. If not specified, the default lifetime of key-value revisions will be\nused.", + "type": { + "$id": "271", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.retentionPeriod", + "serializationOptions": { + "$id": "272", + "json": { + "$id": "273", + "name": "retention_period" + } + } + }, + { + "$id": "274", + "kind": "property", + "name": "size", + "serializedName": "size", + "doc": "The size in bytes of the snapshot.", + "type": { + "$id": "275", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.size", + "serializationOptions": { + "$id": "276", + "json": { + "$id": "277", + "name": "size" + } + } + }, + { + "$id": "278", + "kind": "property", + "name": "itemsCount", + "serializedName": "items_count", + "doc": "The amount of key-values in the snapshot.", + "type": { + "$id": "279", + "kind": "int64", + "name": "int64", + "crossLanguageDefinitionId": "TypeSpec.int64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.itemsCount", + "serializationOptions": { + "$id": "280", + "json": { + "$id": "281", + "name": "items_count" + } + } + }, + { + "$id": "282", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "The tags of the snapshot.", + "type": { + "$id": "283", + "kind": "dict", + "keyType": { + "$id": "284", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.tags", + "serializationOptions": { + "$id": "286", + "json": { + "$id": "287", + "name": "tags" + } + } + }, + { + "$id": "288", + "kind": "property", + "name": "etag", + "serializedName": "etag", + "doc": "A value representing the current state of the snapshot.", + "type": { + "$id": "289", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Snapshot.etag", + "serializationOptions": { + "$id": "290", + "json": { + "$id": "291", + "name": "etag" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.SnapshotListResult.items", + "serializationOptions": { + "$id": "292", + "json": { + "$id": "293", + "name": "items" + } + } + }, + { + "$id": "294", + "kind": "property", + "name": "@nextLink", + "serializedName": "@nextLink", + "doc": "The URI that can be used to request the next set of paged results.", + "type": { + "$id": "295", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.SnapshotListResult.@nextLink", + "serializationOptions": { + "$id": "296", + "json": { + "$id": "297", + "name": "@nextLink" + } + } + } + ] + }, + { + "$ref": "231" + }, + { + "$ref": "241" + }, + { + "$id": "298", + "kind": "model", + "name": "OperationDetails", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.OperationDetails", + "usage": "Output,Json,LroPolling", + "doc": "Details of a long running operation.", + "decorators": [], + "properties": [ + { + "$id": "299", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The unique id of the operation.", + "type": { + "$id": "300", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.OperationDetails.id", + "serializationOptions": { + "$id": "301", + "json": { + "$id": "302", + "name": "id" + } + } + }, + { + "$id": "303", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The current status of the operation", + "type": { + "$ref": "104" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.OperationDetails.status", + "serializationOptions": { + "$id": "304", + "json": { + "$id": "305", + "name": "status" + } + } + }, + { + "$id": "306", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "An error, available when the status is `Failed`, describing why the operation\nfailed.", + "type": { + "$ref": "158" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.OperationDetails.error", + "serializationOptions": { + "$id": "307", + "json": { + "$id": "308", + "name": "error" + } + } + } + ] + }, + { + "$id": "309", + "kind": "model", + "name": "SnapshotUpdateParameters", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.SnapshotUpdateParameters", + "usage": "Input,JsonMergePatch,Json", + "doc": "Parameters used to update a snapshot.", + "decorators": [], + "properties": [ + { + "$id": "310", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The desired status of the snapshot.", + "type": { + "$ref": "76" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.SnapshotUpdateParameters.status", + "serializationOptions": { + "$id": "311", + "json": { + "$id": "312", + "name": "status" + } + } + } + ] + }, + { + "$id": "313", + "kind": "model", + "name": "LabelListResult", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.LabelListResult", + "usage": "Output,Json", + "doc": "The result of a list request.", + "decorators": [], + "properties": [ + { + "$id": "314", + "kind": "property", + "name": "items", + "serializedName": "items", + "doc": "The collection value.", + "type": { + "$id": "315", + "kind": "array", + "name": "ArrayLabel", + "valueType": { + "$id": "316", + "kind": "model", + "name": "Label", + "namespace": "Azure.Data.AppConfiguration", + "crossLanguageDefinitionId": "AzureAppConfiguration.Label", + "usage": "Output,Json", + "doc": "Labels are used to group key-values.", + "decorators": [], + "properties": [ + { + "$id": "317", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the label.", + "type": { + "$id": "318", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.Label.name", + "serializationOptions": { + "$id": "319", + "json": { + "$id": "320", + "name": "name" + } + } + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.LabelListResult.items", + "serializationOptions": { + "$id": "321", + "json": { + "$id": "322", + "name": "items" + } + } + }, + { + "$id": "323", + "kind": "property", + "name": "@nextLink", + "serializedName": "@nextLink", + "doc": "The URI that can be used to request the next set of paged results.", + "type": { + "$id": "324", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "AzureAppConfiguration.LabelListResult.@nextLink", + "serializationOptions": { + "$id": "325", + "json": { + "$id": "326", + "name": "@nextLink" + } + } + } + ] + }, + { + "$ref": "316" + } + ], + "clients": [ + { + "$id": "327", + "kind": "client", + "name": "AzureAppConfigurationClient", + "namespace": "Azure.Data.AppConfiguration", + "doc": "Azure App Configuration REST API", + "methods": [ + { + "$id": "328", + "kind": "paging", + "name": "getKeys", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets a list of keys.", + "summary": "Gets a list of keys.", + "operation": { + "$id": "329", + "name": "getKeys", + "resourceName": "Key", + "summary": "Gets a list of keys.", + "doc": "Gets a list of keys.", + "accessibility": "public", + "parameters": [ + { + "$id": "330", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "332", + "type": { + "$id": "333", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "334", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned keys.", + "type": { + "$id": "335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "336", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "337", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "338", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "340", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "342", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "344", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "144" + }, + "headers": [ + { + "$id": "345", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "346", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "347", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "2" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.keyset+json", + "application/problem+json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/keys", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeys", + "decorators": [], + "examples": [ + { + "$id": "348", + "kind": "http", + "name": "Gets a list of keys.", + "description": "Gets a list of keys.", + "filePath": "2024-09-01/GetKeys.json", + "parameters": [ + { + "$id": "349", + "parameter": { + "$ref": "330" + }, + "value": { + "$id": "350", + "kind": "string", + "type": { + "$ref": "331" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "351", + "response": { + "$ref": "344" + }, + "statusCode": 200, + "bodyValue": { + "$id": "352", + "kind": "model", + "type": { + "$ref": "144" + }, + "value": { + "$id": "353", + "items": { + "$id": "354", + "kind": "array", + "type": { + "$ref": "146" + }, + "value": [ + { + "$id": "355", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "356", + "name": { + "$id": "357", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "MaxRequests" + } + } + }, + { + "$id": "358", + "kind": "model", + "type": { + "$ref": "147" + }, + "value": { + "$id": "359", + "name": { + "$id": "360", + "kind": "string", + "type": { + "$ref": "149" + }, + "value": "RequestTimeout" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "361", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned keys.", + "type": { + "$id": "362", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "363", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "364", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "365", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "366", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "367", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "369", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "343" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "370", + "type": { + "$id": "371", + "kind": "array", + "name": "ArrayKey", + "valueType": { + "$ref": "147" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "items" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeys", + "pagingMetadata": { + "$id": "372", + "itemPropertySegments": [ + "items" + ], + "nextLink": { + "$id": "373", + "responseSegments": [ + "@nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "374", + "kind": "basic", + "name": "checkKeys", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Requests the headers and status of the given resource.", + "summary": "Requests the headers and status of the given resource.", + "operation": { + "$id": "375", + "name": "checkKeys", + "resourceName": "AzureAppConfiguration", + "summary": "Requests the headers and status of the given resource.", + "doc": "Requests the headers and status of the given resource.", + "accessibility": "public", + "parameters": [ + { + "$id": "376", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "378", + "type": { + "$id": "379", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "380", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned keys.", + "type": { + "$id": "381", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "382", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "383", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "384", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "385", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "386", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "387", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "388", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "389", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "390", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "391", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "392", + "kind": "constant", + "valueType": { + "$id": "393", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "394", + "statusCodes": [ + 200 + ], + "headers": [ + { + "$id": "395", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "HEAD", + "uri": "{endpoint}", + "path": "/keys", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkKeys", + "decorators": [], + "examples": [ + { + "$id": "397", + "kind": "http", + "name": "Check keys", + "description": "Check keys", + "filePath": "2024-09-01/CheckKeys.json", + "parameters": [ + { + "$id": "398", + "parameter": { + "$ref": "376" + }, + "value": { + "$id": "399", + "kind": "string", + "type": { + "$ref": "377" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "400", + "response": { + "$ref": "394" + }, + "statusCode": 200 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "401", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned keys.", + "type": { + "$id": "402", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "403", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "404", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "405", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "406", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "407", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "408", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "409", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "410", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "411", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "412", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "392" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "413" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkKeys" + }, + { + "$id": "414", + "kind": "paging", + "name": "getKeyValues", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets a list of key-values.", + "summary": "Gets a list of key-values.", + "operation": { + "$id": "415", + "name": "getKeyValues", + "resourceName": "KeyValue", + "summary": "Gets a list of key-values.", + "doc": "Gets a list of key-values.", + "accessibility": "public", + "parameters": [ + { + "$id": "416", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "418", + "type": { + "$id": "419", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "420", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "421", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "422", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "424", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "425", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "426", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "427", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "428", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "430", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "431", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "432", + "name": "snapshot", + "nameInRequest": "snapshot", + "doc": "A filter used get key-values for a snapshot. The value should be the name of\nthe snapshot. Not valid when used with 'key' and 'label' filters.", + "type": { + "$id": "433", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "434", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "435", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "436", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "437", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "438", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "439", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "440", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "441", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "442", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "443", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "179" + }, + "headers": [ + { + "$id": "444", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "445", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "446", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "447", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "448", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "26" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.kvset+json", + "application/problem+json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/kv", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeyValues", + "decorators": [], + "examples": [ + { + "$id": "449", + "kind": "http", + "name": "Gets a list of key-values.", + "description": "Gets a list of key-values.", + "filePath": "2024-09-01/GetKeyValues.json", + "parameters": [ + { + "$id": "450", + "parameter": { + "$ref": "416" + }, + "value": { + "$id": "451", + "kind": "string", + "type": { + "$ref": "417" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "452", + "response": { + "$ref": "443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "453", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "454", + "items": { + "$id": "455", + "kind": "array", + "type": { + "$ref": "181" + }, + "value": [ + { + "$id": "456", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "457", + "etag": { + "$id": "458", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "CTgHR5UrDKNj2nsoGWDOipST9Pv" + }, + "key": { + "$id": "459", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Background" + }, + "label": { + "$id": "460", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "Asset1" + }, + "value": { + "$id": "461", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "blue" + }, + "tags": { + "$id": "462", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "463" + } + }, + "locked": { + "$id": "464", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "465", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-03-04T17:12:23+00:00" + } + } + }, + { + "$id": "466", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "467", + "etag": { + "$id": "468", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "UTSN1zePHbBQ0npbRB6elGRRuH7" + }, + "key": { + "$id": "469", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "MaxLogFiles" + }, + "label": { + "$id": "470", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "Asset1" + }, + "value": { + "$id": "471", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "50" + }, + "tags": { + "$id": "472", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "473" + } + }, + "locked": { + "$id": "474", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "475", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-03-04T17:12:23+00:00" + } + } + }, + { + "$id": "476", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "477", + "etag": { + "$id": "478", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "7XpB48ET4VAlB9068ft6fKMyA3m" + }, + "key": { + "$id": "479", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "480", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World" + }, + "tags": { + "$id": "481", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "482" + } + }, + "locked": { + "$id": "483", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "484", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-06-20T16:52:23+00:00" + } + } + }, + { + "$id": "485", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "486", + "etag": { + "$id": "487", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "fAFm4jkGNB1hsIr4o0S5hnhCCvY" + }, + "key": { + "$id": "488", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "WebDemo:Settings:BackgroundColor" + }, + "value": { + "$id": "489", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "blue" + }, + "tags": { + "$id": "490", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "491" + } + }, + "locked": { + "$id": "492", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "493", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-06-20T15:48:01+00:00" + } + } + } + ] + } + } + } + } + ] + }, + { + "$id": "494", + "kind": "http", + "name": "Gets a list of key-values using the If-Match header.", + "description": "Gets a list of key-values using the If-Match header.", + "filePath": "2024-09-01/GetKeyValues_IfMatch.json", + "parameters": [ + { + "$id": "495", + "parameter": { + "$ref": "416" + }, + "value": { + "$id": "496", + "kind": "string", + "type": { + "$ref": "417" + }, + "value": "2024-09-01" + } + }, + { + "$id": "497", + "parameter": { + "$ref": "434" + }, + "value": { + "$id": "498", + "kind": "string", + "type": { + "$ref": "435" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "499", + "response": { + "$ref": "443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "500", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "501", + "items": { + "$id": "502", + "kind": "array", + "type": { + "$ref": "181" + }, + "value": [ + { + "$id": "503", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "504", + "etag": { + "$id": "505", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "CTgHR5UrDKNj2nsoGWDOipST9Pv" + }, + "key": { + "$id": "506", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Background" + }, + "label": { + "$id": "507", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "Asset1" + }, + "value": { + "$id": "508", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "blue" + }, + "tags": { + "$id": "509", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "510" + } + }, + "locked": { + "$id": "511", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "512", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-03-04T17:12:23+00:00" + } + } + }, + { + "$id": "513", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "514", + "etag": { + "$id": "515", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "UTSN1zePHbBQ0npbRB6elGRRuH7" + }, + "key": { + "$id": "516", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "MaxLogFiles" + }, + "label": { + "$id": "517", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "Asset1" + }, + "value": { + "$id": "518", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "50" + }, + "tags": { + "$id": "519", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "520" + } + }, + "locked": { + "$id": "521", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "522", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-03-04T17:12:23+00:00" + } + } + }, + { + "$id": "523", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "524", + "etag": { + "$id": "525", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "7XpB48ET4VAlB9068ft6fKMyA3m" + }, + "key": { + "$id": "526", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "527", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World" + }, + "tags": { + "$id": "528", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "529" + } + }, + "locked": { + "$id": "530", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "531", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-06-20T16:52:23+00:00" + } + } + }, + { + "$id": "532", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "533", + "etag": { + "$id": "534", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "fAFm4jkGNB1hsIr4o0S5hnhCCvY" + }, + "key": { + "$id": "535", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "WebDemo:Settings:BackgroundColor" + }, + "value": { + "$id": "536", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "blue" + }, + "tags": { + "$id": "537", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "538" + } + }, + "locked": { + "$id": "539", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "540", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-06-20T15:48:01+00:00" + } + } + } + ] + } + } + } + } + ] + }, + { + "$id": "541", + "kind": "http", + "name": "Gets a list of key-values using the If-None-Match header.", + "description": "Gets a list of key-values using the If-None-Match header.", + "filePath": "2024-09-01/GetKeyValues_IfNoneMatch.json", + "parameters": [ + { + "$id": "542", + "parameter": { + "$ref": "416" + }, + "value": { + "$id": "543", + "kind": "string", + "type": { + "$ref": "417" + }, + "value": "2024-09-01" + } + }, + { + "$id": "544", + "parameter": { + "$ref": "436" + }, + "value": { + "$id": "545", + "kind": "string", + "type": { + "$ref": "437" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + } + } + ], + "responses": [ + { + "$id": "546", + "response": { + "$ref": "443" + }, + "statusCode": 200, + "bodyValue": { + "$id": "547", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "548", + "items": { + "$id": "549", + "kind": "array", + "type": { + "$ref": "181" + }, + "value": [ + { + "$id": "550", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "551", + "etag": { + "$id": "552", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "CTgHR5UrDKNj2nsoGWDOipST9Pv" + }, + "key": { + "$id": "553", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Background" + }, + "label": { + "$id": "554", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "Asset1" + }, + "value": { + "$id": "555", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "blue" + }, + "tags": { + "$id": "556", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "557" + } + }, + "locked": { + "$id": "558", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "559", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-03-04T17:12:23+00:00" + } + } + }, + { + "$id": "560", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "561", + "etag": { + "$id": "562", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "UTSN1zePHbBQ0npbRB6elGRRuH7" + }, + "key": { + "$id": "563", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "MaxLogFiles" + }, + "label": { + "$id": "564", + "kind": "string", + "type": { + "$ref": "188" + }, + "value": "Asset1" + }, + "value": { + "$id": "565", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "50" + }, + "tags": { + "$id": "566", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "567" + } + }, + "locked": { + "$id": "568", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "569", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-03-04T17:12:23+00:00" + } + } + }, + { + "$id": "570", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "571", + "etag": { + "$id": "572", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "7XpB48ET4VAlB9068ft6fKMyA3m" + }, + "key": { + "$id": "573", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "574", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World" + }, + "tags": { + "$id": "575", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "576" + } + }, + "locked": { + "$id": "577", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "578", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-06-20T16:52:23+00:00" + } + } + }, + { + "$id": "579", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "580", + "etag": { + "$id": "581", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "fAFm4jkGNB1hsIr4o0S5hnhCCvY" + }, + "key": { + "$id": "582", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "WebDemo:Settings:BackgroundColor" + }, + "value": { + "$id": "583", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "blue" + }, + "tags": { + "$id": "584", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "585" + } + }, + "locked": { + "$id": "586", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "587", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-06-20T15:48:01+00:00" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "588", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "589", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "590", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "591", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "592", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "593", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "594", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "595", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "596", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "597", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "598", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "599", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "600", + "name": "snapshot", + "nameInRequest": "snapshot", + "doc": "A filter used get key-values for a snapshot. The value should be the name of\nthe snapshot. Not valid when used with 'key' and 'label' filters.", + "type": { + "$id": "601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "602", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "603", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "604", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "605", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "606", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "607", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "608", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "609", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "442" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "610", + "type": { + "$id": "611", + "kind": "array", + "name": "ArrayKeyValue", + "valueType": { + "$ref": "182" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "items" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeyValues", + "pagingMetadata": { + "$id": "612", + "itemPropertySegments": [ + "items" + ], + "nextLink": { + "$id": "613", + "responseSegments": [ + "@nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "614", + "kind": "basic", + "name": "checkKeyValues", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Requests the headers and status of the given resource.", + "summary": "Requests the headers and status of the given resource.", + "operation": { + "$id": "615", + "name": "checkKeyValues", + "resourceName": "AzureAppConfiguration", + "summary": "Requests the headers and status of the given resource.", + "doc": "Requests the headers and status of the given resource.", + "accessibility": "public", + "parameters": [ + { + "$id": "616", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "617", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "618", + "type": { + "$id": "619", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "620", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "621", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "622", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "624", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "625", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "626", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "627", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "628", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "629", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "630", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "631", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "632", + "name": "snapshot", + "nameInRequest": "snapshot", + "doc": "A filter used get key-values for a snapshot. The value should be the name of\nthe snapshot. Not valid when used with 'key' and 'label' filters.", + "type": { + "$id": "633", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "634", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "635", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "636", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "637", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "638", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "639", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "640", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "641", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "642", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "643", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "644", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "645", + "kind": "constant", + "valueType": { + "$id": "646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "647", + "statusCodes": [ + 200 + ], + "headers": [ + { + "$id": "648", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "649", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "650", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "651", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "HEAD", + "uri": "{endpoint}", + "path": "/kv", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkKeyValues", + "decorators": [], + "examples": [ + { + "$id": "652", + "kind": "http", + "name": "Requests the headers and status of the given resource.", + "description": "Requests the headers and status of the given resource.", + "filePath": "2024-09-01/CheckKeyValues.json", + "parameters": [ + { + "$id": "653", + "parameter": { + "$ref": "616" + }, + "value": { + "$id": "654", + "kind": "string", + "type": { + "$ref": "617" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "655", + "response": { + "$ref": "647" + }, + "statusCode": 200 + } + ] + }, + { + "$id": "656", + "kind": "http", + "name": "Requests the headers and status of the given resource using the If-Match header.", + "description": "Requests the headers and status of the given resource using the If-Match header.", + "filePath": "2024-09-01/CheckKeyValues_IfMatch.json", + "parameters": [ + { + "$id": "657", + "parameter": { + "$ref": "616" + }, + "value": { + "$id": "658", + "kind": "string", + "type": { + "$ref": "617" + }, + "value": "2024-09-01" + } + }, + { + "$id": "659", + "parameter": { + "$ref": "634" + }, + "value": { + "$id": "660", + "kind": "string", + "type": { + "$ref": "635" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "661", + "response": { + "$ref": "647" + }, + "statusCode": 200 + } + ] + }, + { + "$id": "662", + "kind": "http", + "name": "Requests the headers and status of the given resource using the If-None-Match header.", + "description": "Requests the headers and status of the given resource using the If-None-Match header.", + "filePath": "2024-09-01/CheckKeyValues_IfNoneMatch.json", + "parameters": [ + { + "$id": "663", + "parameter": { + "$ref": "616" + }, + "value": { + "$id": "664", + "kind": "string", + "type": { + "$ref": "617" + }, + "value": "2024-09-01" + } + }, + { + "$id": "665", + "parameter": { + "$ref": "636" + }, + "value": { + "$id": "666", + "kind": "string", + "type": { + "$ref": "637" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "667", + "response": { + "$ref": "647" + }, + "statusCode": 200 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "668", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "670", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "671", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "672", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "673", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "674", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "675", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "676", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "677", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "678", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "679", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "680", + "name": "snapshot", + "nameInRequest": "snapshot", + "doc": "A filter used get key-values for a snapshot. The value should be the name of\nthe snapshot. Not valid when used with 'key' and 'label' filters.", + "type": { + "$id": "681", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "682", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "683", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "684", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "685", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "686", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "687", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "688", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "689", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "690", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "691", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "692", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "645" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "693" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkKeyValues" + }, + { + "$id": "694", + "kind": "basic", + "name": "getKeyValue", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets a single key-value.", + "summary": "Gets a single key-value.", + "operation": { + "$id": "695", + "name": "getKeyValue", + "resourceName": "AzureAppConfiguration", + "summary": "Gets a single key-value.", + "doc": "Gets a single key-value.", + "accessibility": "public", + "parameters": [ + { + "$id": "696", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "697", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "698", + "type": { + "$id": "699", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "700", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value.", + "type": { + "$id": "701", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "702", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to retrieve.", + "type": { + "$id": "703", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "704", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "705", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "706", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "707", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "708", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "709", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "710", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "711", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "712", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "713", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "714", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "715", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "716", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "717", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "718", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "719", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "720", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "721", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "722", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "182" + }, + "headers": [ + { + "$id": "723", + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "724", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "725", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + }, + { + "$id": "726", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "727", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "728", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "729", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "730", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "32" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.kv+json", + "application/problem+json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/kv/{key}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeyValue", + "decorators": [], + "examples": [ + { + "$id": "731", + "kind": "http", + "name": "Gets a single key-value.", + "description": "Gets a single key-value.", + "filePath": "2024-09-01/GetKeyValue.json", + "parameters": [ + { + "$id": "732", + "parameter": { + "$ref": "696" + }, + "value": { + "$id": "733", + "kind": "string", + "type": { + "$ref": "697" + }, + "value": "2024-09-01" + } + }, + { + "$id": "734", + "parameter": { + "$ref": "700" + }, + "value": { + "$id": "735", + "kind": "string", + "type": { + "$ref": "701" + }, + "value": "Message" + } + } + ], + "responses": [ + { + "$id": "736", + "response": { + "$ref": "722" + }, + "statusCode": 200, + "bodyValue": { + "$id": "737", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "738", + "etag": { + "$id": "739", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "7XpB48ET4VAlB9068ft6fKMyA3m" + }, + "key": { + "$id": "740", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "741", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "742", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "743" + } + }, + "locked": { + "$id": "744", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "745", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + }, + { + "$id": "746", + "kind": "http", + "name": "Gets a single key-value using the If-Match header.", + "description": "Gets a single key-value using the If-Match header.", + "filePath": "2024-09-01/GetKeyValue_IfMatch.json", + "parameters": [ + { + "$id": "747", + "parameter": { + "$ref": "696" + }, + "value": { + "$id": "748", + "kind": "string", + "type": { + "$ref": "697" + }, + "value": "2024-09-01" + } + }, + { + "$id": "749", + "parameter": { + "$ref": "700" + }, + "value": { + "$id": "750", + "kind": "string", + "type": { + "$ref": "701" + }, + "value": "Message" + } + }, + { + "$id": "751", + "parameter": { + "$ref": "710" + }, + "value": { + "$id": "752", + "kind": "string", + "type": { + "$ref": "711" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "753", + "response": { + "$ref": "722" + }, + "statusCode": 200, + "bodyValue": { + "$id": "754", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "755", + "etag": { + "$id": "756", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + }, + "key": { + "$id": "757", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "758", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "759", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "760" + } + }, + "locked": { + "$id": "761", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "762", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + }, + { + "$id": "763", + "kind": "http", + "name": "Gets a single key-value using the If-None-Match header.", + "description": "Gets a single key-value using the If-None-Match header.", + "filePath": "2024-09-01/GetKeyValue_IfNoneMatch.json", + "parameters": [ + { + "$id": "764", + "parameter": { + "$ref": "696" + }, + "value": { + "$id": "765", + "kind": "string", + "type": { + "$ref": "697" + }, + "value": "2024-09-01" + } + }, + { + "$id": "766", + "parameter": { + "$ref": "700" + }, + "value": { + "$id": "767", + "kind": "string", + "type": { + "$ref": "701" + }, + "value": "Message" + } + }, + { + "$id": "768", + "parameter": { + "$ref": "712" + }, + "value": { + "$id": "769", + "kind": "string", + "type": { + "$ref": "713" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + } + } + ], + "responses": [ + { + "$id": "770", + "response": { + "$ref": "722" + }, + "statusCode": 200, + "bodyValue": { + "$id": "771", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "772", + "etag": { + "$id": "773", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "7XpB48ET4VAlB9068ft6fKMyA3m" + }, + "key": { + "$id": "774", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "775", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "776", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "777" + } + }, + "locked": { + "$id": "778", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "779", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "780", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value.", + "type": { + "$id": "781", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "782", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to retrieve.", + "type": { + "$id": "783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "784", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "785", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "786", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "787", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "788", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "789", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "790", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "792", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "793", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "794", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "795", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "796", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "797", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "798", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "799", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "800", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "721" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "801", + "type": { + "$ref": "182" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getKeyValue" + }, + { + "$id": "802", + "kind": "basic", + "name": "putKeyValue", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Creates a key-value.", + "summary": "Creates a key-value.", + "operation": { + "$id": "803", + "name": "putKeyValue", + "resourceName": "AzureAppConfiguration", + "summary": "Creates a key-value.", + "doc": "Creates a key-value.", + "accessibility": "public", + "parameters": [ + { + "$id": "804", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "805", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "806", + "type": { + "$id": "807", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "808", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "38" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "809", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to create.", + "type": { + "$id": "810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "811", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to create.", + "type": { + "$id": "812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "813", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "814", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "815", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "816", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "817", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "818", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "819", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "820", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "821", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "822", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "823", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "824", + "name": "entity", + "nameInRequest": "entity", + "doc": "The key-value to create.", + "type": { + "$ref": "182" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "825", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "182" + }, + "headers": [ + { + "$id": "826", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "827", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "828", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "829", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "830", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "32" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.kv+json", + "application/problem+json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/kv/{key}", + "requestMediaTypes": [ + "application/vnd.microsoft.appconfig.kv+json", + "application/vnd.microsoft.appconfig.kvset+json", + "application/json", + "text/json", + "application/*+json", + "application/json-patch+json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.putKeyValue", + "decorators": [], + "examples": [ + { + "$id": "831", + "kind": "http", + "name": "Creates a key-value.", + "description": "Creates a key-value.", + "filePath": "2024-09-01/PutKeyValue.json", + "parameters": [ + { + "$id": "832", + "parameter": { + "$ref": "804" + }, + "value": { + "$id": "833", + "kind": "string", + "type": { + "$ref": "805" + }, + "value": "2024-09-01" + } + }, + { + "$id": "834", + "parameter": { + "$ref": "809" + }, + "value": { + "$id": "835", + "kind": "string", + "type": { + "$ref": "810" + }, + "value": "Message" + } + } + ], + "responses": [ + { + "$id": "836", + "response": { + "$ref": "825" + }, + "statusCode": 200, + "bodyValue": { + "$id": "837", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "838", + "etag": { + "$id": "839", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "tnIHBkDYQwtdNMLoWtr5aybkKwL" + }, + "key": { + "$id": "840", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "841", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "842", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "843" + } + }, + "locked": { + "$id": "844", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "845", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + }, + { + "$id": "846", + "kind": "http", + "name": "Creates a key-value with the If-Match header.", + "description": "Creates a key-value with the If-Match header.", + "filePath": "2024-09-01/PutKeyValue_IfMatch.json", + "parameters": [ + { + "$id": "847", + "parameter": { + "$ref": "804" + }, + "value": { + "$id": "848", + "kind": "string", + "type": { + "$ref": "805" + }, + "value": "2024-09-01" + } + }, + { + "$id": "849", + "parameter": { + "$ref": "809" + }, + "value": { + "$id": "850", + "kind": "string", + "type": { + "$ref": "810" + }, + "value": "Message" + } + }, + { + "$id": "851", + "parameter": { + "$ref": "815" + }, + "value": { + "$id": "852", + "kind": "string", + "type": { + "$ref": "816" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "853", + "response": { + "$ref": "825" + }, + "statusCode": 200, + "bodyValue": { + "$id": "854", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "855", + "etag": { + "$id": "856", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + }, + "key": { + "$id": "857", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "858", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "859", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "860" + } + }, + "locked": { + "$id": "861", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "862", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "863", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "38" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "864", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to create.", + "type": { + "$id": "865", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "866", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to create.", + "type": { + "$id": "867", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "868", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "869", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "870", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "871", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "872", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "873", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "874", + "name": "entity", + "nameInRequest": "entity", + "doc": "The key-value to create.", + "type": { + "$ref": "182" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "875", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "876", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "877", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "878", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "823" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "879", + "type": { + "$ref": "182" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.putKeyValue" + }, + { + "$id": "880", + "kind": "basic", + "name": "deleteKeyValue", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Deletes a key-value.", + "summary": "Deletes a key-value.", + "operation": { + "$id": "881", + "name": "deleteKeyValue", + "resourceName": "AzureAppConfiguration", + "summary": "Deletes a key-value.", + "doc": "Deletes a key-value.", + "accessibility": "public", + "parameters": [ + { + "$id": "882", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "883", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "884", + "type": { + "$id": "885", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "886", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to delete.", + "type": { + "$id": "887", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "888", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to delete.", + "type": { + "$id": "889", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "890", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "891", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "892", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "893", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "894", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "895", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "896", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "897", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "898", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "899", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "182" + }, + "headers": [ + { + "$id": "900", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "901", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "902", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "903", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "904", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "32" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.kv+json", + "application/problem+json" + ] + }, + { + "$id": "905", + "statusCodes": [ + 204 + ], + "headers": [ + { + "$id": "906", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "907", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/kv/{key}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.deleteKeyValue", + "decorators": [], + "examples": [ + { + "$id": "908", + "kind": "http", + "name": "Deletes a key-value.", + "description": "Deletes a key-value.", + "filePath": "2024-09-01/DeleteKeyValue.json", + "parameters": [ + { + "$id": "909", + "parameter": { + "$ref": "882" + }, + "value": { + "$id": "910", + "kind": "string", + "type": { + "$ref": "883" + }, + "value": "2024-09-01" + } + }, + { + "$id": "911", + "parameter": { + "$ref": "886" + }, + "value": { + "$id": "912", + "kind": "string", + "type": { + "$ref": "887" + }, + "value": "Message" + } + } + ], + "responses": [ + { + "$id": "913", + "response": { + "$ref": "899" + }, + "statusCode": 200, + "bodyValue": { + "$id": "914", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "915", + "etag": { + "$id": "916", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "7XpB48ET4VAlB9068ft6fKMyA3m" + }, + "key": { + "$id": "917", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "918", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "919", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "920" + } + }, + "locked": { + "$id": "921", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "922", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + }, + { + "$id": "923", + "response": { + "$ref": "905" + }, + "statusCode": 204 + } + ] + }, + { + "$id": "924", + "kind": "http", + "name": "Deletes a key-value using If-Match header", + "description": "Deletes a key-value using If-Match header", + "filePath": "2024-09-01/DeleteKeyValue_IfMatch.json", + "parameters": [ + { + "$id": "925", + "parameter": { + "$ref": "882" + }, + "value": { + "$id": "926", + "kind": "string", + "type": { + "$ref": "883" + }, + "value": "2024-09-01" + } + }, + { + "$id": "927", + "parameter": { + "$ref": "886" + }, + "value": { + "$id": "928", + "kind": "string", + "type": { + "$ref": "887" + }, + "value": "Message" + } + }, + { + "$id": "929", + "parameter": { + "$ref": "892" + }, + "value": { + "$id": "930", + "kind": "string", + "type": { + "$ref": "893" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "931", + "response": { + "$ref": "899" + }, + "statusCode": 200, + "bodyValue": { + "$id": "932", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "933", + "etag": { + "$id": "934", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + }, + "key": { + "$id": "935", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "936", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "937", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "938" + } + }, + "locked": { + "$id": "939", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "940", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + }, + { + "$id": "941", + "response": { + "$ref": "905" + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "942", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to delete.", + "type": { + "$id": "943", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "944", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to delete.", + "type": { + "$id": "945", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "946", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "947", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "948", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "949", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "950", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "951", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "952", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "953", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "898" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "954", + "type": { + "$id": "955", + "kind": "nullable", + "type": { + "$ref": "182" + }, + "namespace": "Azure.Data.AppConfiguration" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.deleteKeyValue" + }, + { + "$id": "956", + "kind": "basic", + "name": "checkKeyValue", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Requests the headers and status of the given resource.", + "summary": "Requests the headers and status of the given resource.", + "operation": { + "$id": "957", + "name": "checkKeyValue", + "resourceName": "AzureAppConfiguration", + "summary": "Requests the headers and status of the given resource.", + "doc": "Requests the headers and status of the given resource.", + "accessibility": "public", + "parameters": [ + { + "$id": "958", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "959", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "960", + "type": { + "$id": "961", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "962", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to retrieve.", + "type": { + "$id": "963", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "964", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to retrieve.", + "type": { + "$id": "965", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "966", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "967", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "968", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "969", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "970", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "971", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "972", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "973", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "974", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "975", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "976", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "977", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "978", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "979", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "980", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "981", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "982", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "983", + "kind": "constant", + "valueType": { + "$id": "984", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "985", + "statusCodes": [ + 200 + ], + "headers": [ + { + "$id": "986", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "987", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "988", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "989", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "HEAD", + "uri": "{endpoint}", + "path": "/kv/{key}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkKeyValue", + "decorators": [], + "examples": [ + { + "$id": "990", + "kind": "http", + "name": "Requests the headers and status of the given resource.", + "description": "Requests the headers and status of the given resource.", + "filePath": "2024-09-01/CheckKeyValue.json", + "parameters": [ + { + "$id": "991", + "parameter": { + "$ref": "958" + }, + "value": { + "$id": "992", + "kind": "string", + "type": { + "$ref": "959" + }, + "value": "2024-09-01" + } + }, + { + "$id": "993", + "parameter": { + "$ref": "962" + }, + "value": { + "$id": "994", + "kind": "string", + "type": { + "$ref": "963" + }, + "value": "Message" + } + } + ], + "responses": [ + { + "$id": "995", + "response": { + "$ref": "985" + }, + "statusCode": 200 + } + ] + }, + { + "$id": "996", + "kind": "http", + "name": "Requests the headers and status of the given resource using the If-Match header.", + "description": "Requests the headers and status of the given resource using the If-Match header.", + "filePath": "2024-09-01/CheckKeyValue_IfMatch.json", + "parameters": [ + { + "$id": "997", + "parameter": { + "$ref": "958" + }, + "value": { + "$id": "998", + "kind": "string", + "type": { + "$ref": "959" + }, + "value": "2024-09-01" + } + }, + { + "$id": "999", + "parameter": { + "$ref": "962" + }, + "value": { + "$id": "1000", + "kind": "string", + "type": { + "$ref": "963" + }, + "value": "Message" + } + }, + { + "$id": "1001", + "parameter": { + "$ref": "970" + }, + "value": { + "$id": "1002", + "kind": "string", + "type": { + "$ref": "971" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "1003", + "response": { + "$ref": "985" + }, + "statusCode": 200 + } + ] + }, + { + "$id": "1004", + "kind": "http", + "name": "Requests the headers and status of the given resource using the If-None-Match header.", + "description": "Requests the headers and status of the given resource using the If-None-Match header.", + "filePath": "2024-09-01/CheckKeyValue_IfNoneMatch.json", + "parameters": [ + { + "$id": "1005", + "parameter": { + "$ref": "958" + }, + "value": { + "$id": "1006", + "kind": "string", + "type": { + "$ref": "959" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1007", + "parameter": { + "$ref": "962" + }, + "value": { + "$id": "1008", + "kind": "string", + "type": { + "$ref": "963" + }, + "value": "Message" + } + }, + { + "$id": "1009", + "parameter": { + "$ref": "972" + }, + "value": { + "$id": "1010", + "kind": "string", + "type": { + "$ref": "973" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + } + } + ], + "responses": [ + { + "$id": "1011", + "response": { + "$ref": "985" + }, + "statusCode": 200 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1012", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to retrieve.", + "type": { + "$id": "1013", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1014", + "name": "label", + "nameInRequest": "label", + "doc": "The label of the key-value to retrieve.", + "type": { + "$id": "1015", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1016", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1017", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1018", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1019", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1020", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1021", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1022", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1023", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1024", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1025", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1026", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/keyvaluefiltering", + "type": { + "$id": "1027", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1028", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1029", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1030", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1031", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1032", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "983" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1033" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkKeyValue" + }, + { + "$id": "1034", + "kind": "paging", + "name": "getSnapshots", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets a list of key-value snapshots.", + "summary": "Gets a list of key-value snapshots.", + "operation": { + "$id": "1035", + "name": "getSnapshots", + "resourceName": "Snapshot", + "summary": "Gets a list of key-value snapshots.", + "doc": "Gets a list of key-value snapshots.", + "accessibility": "public", + "parameters": [ + { + "$id": "1036", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1037", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1038", + "type": { + "$id": "1039", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1040", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned snapshots.", + "type": { + "$id": "1041", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1042", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1043", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1044", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1045", + "kind": "array", + "name": "ArraySnapshotFields", + "valueType": { + "$ref": "52" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1046", + "name": "status", + "nameInRequest": "status", + "doc": "Used to filter returned snapshots by their status property.", + "type": { + "$id": "1047", + "kind": "array", + "name": "ArraySnapshotStatus", + "valueType": { + "$ref": "76" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1048", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1049", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1050", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1052", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "228" + }, + "headers": [ + { + "$id": "1053", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1054", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1055", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "92" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.snapshotset+json", + "application/problem+json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/snapshots", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getSnapshots", + "decorators": [], + "examples": [ + { + "$id": "1056", + "kind": "http", + "name": "Gets a list of key-value snapshots.", + "description": "Gets a list of key-value snapshots.", + "filePath": "2024-09-01/GetSnapshots.json", + "parameters": [ + { + "$id": "1057", + "parameter": { + "$ref": "1036" + }, + "value": { + "$id": "1058", + "kind": "string", + "type": { + "$ref": "1037" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "1059", + "response": { + "$ref": "1052" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1060", + "kind": "model", + "type": { + "$ref": "228" + }, + "value": { + "$id": "1061", + "items": { + "$id": "1062", + "kind": "array", + "type": { + "$ref": "230" + }, + "value": [ + { + "$id": "1063", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1064", + "etag": { + "$id": "1065", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1066", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1067", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ready" + }, + "filters": { + "$id": "1068", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1069", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1070", + "key": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1072", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1073", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1074", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "size": { + "$id": "1075", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 100000 + }, + "items_count": { + "$id": "1076", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 71 + }, + "retention_period": { + "$id": "1077", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 2592000 + }, + "tags": { + "$id": "1078", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1079", + "release": { + "$id": "1080", + "kind": "string", + "type": { + "$ref": "285" + }, + "value": "{link/id}" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1081", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned snapshots.", + "type": { + "$id": "1082", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1083", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1084", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1085", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1086", + "kind": "array", + "name": "ArraySnapshotFields", + "valueType": { + "$ref": "52" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1087", + "name": "status", + "nameInRequest": "status", + "doc": "Used to filter returned snapshots by their status property.", + "type": { + "$id": "1088", + "kind": "array", + "name": "ArraySnapshotStatus", + "valueType": { + "$ref": "76" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1089", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1090", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1091", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1051" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1092", + "type": { + "$id": "1093", + "kind": "array", + "name": "ArraySnapshot", + "valueType": { + "$ref": "231" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "items" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getSnapshots", + "pagingMetadata": { + "$id": "1094", + "itemPropertySegments": [ + "items" + ], + "nextLink": { + "$id": "1095", + "responseSegments": [ + "@nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "1096", + "kind": "basic", + "name": "checkSnapshots", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Requests the headers and status of the given resource.", + "summary": "Requests the headers and status of the given resource.", + "operation": { + "$id": "1097", + "name": "checkSnapshots", + "resourceName": "AzureAppConfiguration", + "summary": "Requests the headers and status of the given resource.", + "doc": "Requests the headers and status of the given resource.", + "accessibility": "public", + "parameters": [ + { + "$id": "1098", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1099", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1100", + "type": { + "$id": "1101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1102", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1104", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1106", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1107", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1108", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1109", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1110", + "kind": "constant", + "valueType": { + "$id": "1111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1112", + "statusCodes": [ + 200 + ], + "headers": [ + { + "$id": "1113", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1114", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "HEAD", + "uri": "{endpoint}", + "path": "/snapshots", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkSnapshots", + "decorators": [], + "examples": [ + { + "$id": "1115", + "kind": "http", + "name": "Requests the headers and status of the given resource.", + "description": "Requests the headers and status of the given resource.", + "filePath": "2024-09-01/CheckSnapshots.json", + "parameters": [ + { + "$id": "1116", + "parameter": { + "$ref": "1098" + }, + "value": { + "$id": "1117", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "1118", + "response": { + "$ref": "1112" + }, + "statusCode": 200 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1119", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1120", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1121", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1122", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1123", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1124", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1126", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1110" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1127" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkSnapshots" + }, + { + "$id": "1128", + "kind": "basic", + "name": "getSnapshot", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets a single key-value snapshot.", + "summary": "Gets a single key-value snapshot.", + "operation": { + "$id": "1129", + "name": "getSnapshot", + "resourceName": "Snapshot", + "summary": "Gets a single key-value snapshot.", + "doc": "Gets a single key-value snapshot.", + "accessibility": "public", + "parameters": [ + { + "$id": "1130", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1132", + "type": { + "$id": "1133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1134", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the snapshot.", + "type": { + "$id": "1135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1136", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1137", + "kind": "array", + "name": "ArraySnapshotFields", + "valueType": { + "$ref": "52" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1138", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1140", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1142", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1144", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1145", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1146", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1147", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1148", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1149", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "231" + }, + "headers": [ + { + "$id": "1150", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1152", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1154", + "name": "link", + "nameInResponse": "Link", + "doc": "Includes links to related resources.", + "type": { + "$id": "1155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1156", + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1157", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1158", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + }, + { + "$id": "1159", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "98" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.snapshot+json", + "application/problem+json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/snapshots/{name}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getSnapshot", + "decorators": [], + "examples": [ + { + "$id": "1160", + "kind": "http", + "name": "Gets a single key-value snapshot.", + "description": "Gets a single key-value snapshot.", + "filePath": "2024-09-01/GetSnapshot.json", + "parameters": [ + { + "$id": "1161", + "parameter": { + "$ref": "1130" + }, + "value": { + "$id": "1162", + "kind": "string", + "type": { + "$ref": "1131" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1163", + "parameter": { + "$ref": "1134" + }, + "value": { + "$id": "1164", + "kind": "string", + "type": { + "$ref": "1135" + }, + "value": "Prod-2022-08-01" + } + } + ], + "responses": [ + { + "$id": "1165", + "response": { + "$ref": "1149" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1166", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1167", + "etag": { + "$id": "1168", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1169", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1170", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ready" + }, + "filters": { + "$id": "1171", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1172", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1173", + "key": { + "$id": "1174", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1175", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1176", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1177", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "size": { + "$id": "1178", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 100000 + }, + "items_count": { + "$id": "1179", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 71 + }, + "retention_period": { + "$id": "1180", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 2592000 + }, + "tags": { + "$id": "1181", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1182", + "release": { + "$id": "1183", + "kind": "string", + "type": { + "$ref": "285" + }, + "value": "{link/id}" + } + } + } + } + } + } + ] + }, + { + "$id": "1184", + "kind": "http", + "name": "Gets a single key-value snapshot failed.", + "description": "Gets a single key-value snapshot failed.", + "filePath": "2024-09-01/GetSnapshot_Failed.json", + "parameters": [ + { + "$id": "1185", + "parameter": { + "$ref": "1130" + }, + "value": { + "$id": "1186", + "kind": "string", + "type": { + "$ref": "1131" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1187", + "parameter": { + "$ref": "1134" + }, + "value": { + "$id": "1188", + "kind": "string", + "type": { + "$ref": "1135" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1189", + "parameter": { + "$ref": "1140" + }, + "value": { + "$id": "1190", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "\"4f6dd610dd5e4deebc7fbaef685fb903\"" + } + } + ], + "responses": [ + { + "$id": "1191", + "response": { + "$ref": "1149" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1192", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1193", + "etag": { + "$id": "1194", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1195", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1196", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "failed" + }, + "filters": { + "$id": "1197", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1198", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1199", + "key": { + "$id": "1200", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1201", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1202", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1203", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "size": { + "$id": "1204", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 0 + }, + "items_count": { + "$id": "1205", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 0 + }, + "retention_period": { + "$id": "1206", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 2592000 + }, + "tags": { + "$id": "1207", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1208", + "release": { + "$id": "1209", + "kind": "string", + "type": { + "$ref": "285" + }, + "value": "{link/id}" + } + } + } + } + } + } + ] + }, + { + "$id": "1210", + "kind": "http", + "name": "Gets a single key-value snapshot using If-Match header.", + "description": "Gets a single key-value snapshot using If-Match header.", + "filePath": "2024-09-01/GetSnapshot_IfMatch.json", + "parameters": [ + { + "$id": "1211", + "parameter": { + "$ref": "1130" + }, + "value": { + "$id": "1212", + "kind": "string", + "type": { + "$ref": "1131" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1213", + "parameter": { + "$ref": "1134" + }, + "value": { + "$id": "1214", + "kind": "string", + "type": { + "$ref": "1135" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1215", + "parameter": { + "$ref": "1140" + }, + "value": { + "$id": "1216", + "kind": "string", + "type": { + "$ref": "1141" + }, + "value": "\"4f6dd610dd5e4deebc7fbaef685fb903\"" + } + } + ], + "responses": [ + { + "$id": "1217", + "response": { + "$ref": "1149" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1218", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1219", + "etag": { + "$id": "1220", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1221", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1222", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ready" + }, + "filters": { + "$id": "1223", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1224", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1225", + "key": { + "$id": "1226", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1227", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1228", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1229", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "size": { + "$id": "1230", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 100000 + }, + "items_count": { + "$id": "1231", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 71 + }, + "retention_period": { + "$id": "1232", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 2592000 + }, + "tags": { + "$id": "1233", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1234", + "release": { + "$id": "1235", + "kind": "string", + "type": { + "$ref": "285" + }, + "value": "{link/id}" + } + } + } + } + } + } + ] + }, + { + "$id": "1236", + "kind": "http", + "name": "Gets a single key-value snapshot using If-None-Match header.", + "description": "Gets a single key-value snapshot using If-None-Match header.", + "filePath": "2024-09-01/GetSnapshot_IfNoneMatch.json", + "parameters": [ + { + "$id": "1237", + "parameter": { + "$ref": "1130" + }, + "value": { + "$id": "1238", + "kind": "string", + "type": { + "$ref": "1131" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1239", + "parameter": { + "$ref": "1134" + }, + "value": { + "$id": "1240", + "kind": "string", + "type": { + "$ref": "1135" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1241", + "parameter": { + "$ref": "1142" + }, + "value": { + "$id": "1242", + "kind": "string", + "type": { + "$ref": "1143" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "1243", + "response": { + "$ref": "1149" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1244", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1245", + "etag": { + "$id": "1246", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1247", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1248", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "ready" + }, + "filters": { + "$id": "1249", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1250", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1251", + "key": { + "$id": "1252", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1253", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1254", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1255", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "size": { + "$id": "1256", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 100000 + }, + "items_count": { + "$id": "1257", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 71 + }, + "retention_period": { + "$id": "1258", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 2592000 + }, + "tags": { + "$id": "1259", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1260", + "release": { + "$id": "1261", + "kind": "string", + "type": { + "$ref": "285" + }, + "value": "{link/id}" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1262", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the snapshot.", + "type": { + "$id": "1263", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1264", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1265", + "kind": "array", + "name": "ArraySnapshotFields", + "valueType": { + "$ref": "52" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1266", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1267", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1268", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1270", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1271", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1272", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1273", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1274", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1275", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1148" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1276", + "type": { + "$ref": "231" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getSnapshot" + }, + { + "$id": "1277", + "kind": "basic", + "name": "getOperationDetails", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets the state of a long running operation.", + "summary": "Gets the state of a long running operation.", + "operation": { + "$id": "1278", + "name": "getOperationDetails", + "resourceName": "AzureAppConfiguration", + "summary": "Gets the state of a long running operation.", + "doc": "Gets the state of a long running operation.", + "accessibility": "public", + "parameters": [ + { + "$id": "1279", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1280", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1281", + "type": { + "$id": "1282", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1283", + "name": "snapshot", + "nameInRequest": "snapshot", + "doc": "Snapshot identifier for the long running operation.", + "type": { + "$id": "1284", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1285", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1286", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1287", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1288", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1289", + "kind": "constant", + "valueType": { + "$id": "1290", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1291", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "298" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/operations", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getOperationDetails", + "decorators": [], + "examples": [ + { + "$id": "1292", + "kind": "http", + "name": "Gets the state of a long running operation.", + "description": "Gets the state of a long running operation.", + "filePath": "2024-09-01/GetOperationStatus.json", + "parameters": [ + { + "$id": "1293", + "parameter": { + "$ref": "1279" + }, + "value": { + "$id": "1294", + "kind": "string", + "type": { + "$ref": "1280" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1295", + "parameter": { + "$ref": "1283" + }, + "value": { + "$id": "1296", + "kind": "string", + "type": { + "$ref": "1284" + }, + "value": "Prod-2022-08-01" + } + } + ], + "responses": [ + { + "$id": "1297", + "response": { + "$ref": "1291" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1298", + "kind": "model", + "type": { + "$ref": "298" + }, + "value": { + "$id": "1299", + "id": { + "$id": "1300", + "kind": "string", + "type": { + "$ref": "300" + }, + "value": "4yghgV_8lJJ5t7_kxhMpsyNCyjmZE5Q6zU0pXOp7Jvs" + }, + "status": { + "$id": "1301", + "kind": "string", + "type": { + "$ref": "104" + }, + "value": "Running" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1302", + "name": "snapshot", + "nameInRequest": "snapshot", + "doc": "Snapshot identifier for the long running operation.", + "type": { + "$id": "1303", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1304", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1305", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1306", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1307", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1289" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1308", + "type": { + "$ref": "298" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getOperationDetails" + }, + { + "$id": "1309", + "kind": "lro", + "name": "createSnapshot", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Creates a key-value snapshot.", + "summary": "Creates a key-value snapshot.", + "operation": { + "$id": "1310", + "name": "createSnapshot", + "resourceName": "Snapshot", + "summary": "Creates a key-value snapshot.", + "doc": "Creates a key-value snapshot.", + "accessibility": "public", + "parameters": [ + { + "$id": "1311", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1312", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1313", + "type": { + "$id": "1314", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1315", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "116" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1316", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the key-value snapshot to create.", + "type": { + "$id": "1317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1318", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1320", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1321", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1322", + "name": "entity", + "nameInRequest": "entity", + "doc": "The key-value snapshot to create.", + "type": { + "$ref": "231" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1323", + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "231" + }, + "headers": [ + { + "$id": "1324", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1325", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1326", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1328", + "name": "link", + "nameInResponse": "Link", + "doc": "Includes links to related resources.", + "type": { + "$id": "1329", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1330", + "name": "operationLocation", + "nameInResponse": "Operation-Location", + "doc": "The location for monitoring the operation state.", + "type": { + "$id": "1331", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "1332", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + } + }, + { + "$id": "1333", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "98" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.snapshot+json", + "application/problem+json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/snapshots/{name}", + "requestMediaTypes": [ + "application/vnd.microsoft.appconfig.snapshot+json", + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.createSnapshot", + "decorators": [], + "examples": [ + { + "$id": "1334", + "kind": "http", + "name": "Creates a key-value snapshot.", + "description": "Creates a key-value snapshot.", + "filePath": "2024-09-01/CreateSnapshot.json", + "parameters": [ + { + "$id": "1335", + "parameter": { + "$ref": "1311" + }, + "value": { + "$id": "1336", + "kind": "string", + "type": { + "$ref": "1312" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1337", + "parameter": { + "$ref": "1316" + }, + "value": { + "$id": "1338", + "kind": "string", + "type": { + "$ref": "1317" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1339", + "parameter": { + "$ref": "1322" + }, + "value": { + "$id": "1340", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1341", + "filters": { + "$id": "1342", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1343", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1344", + "key": { + "$id": "1345", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1346", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "retention_period": { + "$id": "1347", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 3600 + } + } + } + } + ], + "responses": [ + { + "$id": "1348", + "response": { + "$ref": "1323" + }, + "statusCode": 201, + "bodyValue": { + "$id": "1349", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1350", + "etag": { + "$id": "1351", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1352", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1353", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "provisioning" + }, + "filters": { + "$id": "1354", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1355", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1356", + "key": { + "$id": "1357", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1358", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1359", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1360", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "size": { + "$id": "1361", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 0 + }, + "items_count": { + "$id": "1362", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 0 + }, + "retention_period": { + "$id": "1363", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 3600 + }, + "tags": { + "$id": "1364", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1365" + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1366", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "116" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1367", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the key-value snapshot to create.", + "type": { + "$id": "1368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1369", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1370", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1371", + "name": "entity", + "nameInRequest": "entity", + "doc": "The key-value snapshot to create.", + "type": { + "$ref": "231" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1372", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$id": "1373", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1374", + "type": { + "$ref": "231" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.createSnapshot", + "lroMetadata": { + "$id": "1375", + "finalStateVia": 2, + "finalResponse": { + "$id": "1376", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "231" + } + } + } + }, + { + "$id": "1377", + "kind": "basic", + "name": "updateSnapshot", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Updates the state of a key-value snapshot.", + "summary": "Updates the state of a key-value snapshot.", + "operation": { + "$id": "1378", + "name": "updateSnapshot", + "resourceName": "AzureAppConfiguration", + "summary": "Updates the state of a key-value snapshot.", + "doc": "Updates the state of a key-value snapshot.", + "accessibility": "public", + "parameters": [ + { + "$id": "1379", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1380", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1381", + "type": { + "$id": "1382", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1383", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "122" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": true, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1384", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the key-value snapshot to update.", + "type": { + "$id": "1385", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1386", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1387", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1388", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1389", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1390", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1391", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1392", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1393", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1394", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1395", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1397", + "name": "entity", + "nameInRequest": "entity", + "doc": "The parameters used to update the snapshot.", + "type": { + "$ref": "309" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1398", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "231" + }, + "headers": [ + { + "$id": "1399", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1400", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1401", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1402", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1403", + "name": "link", + "nameInResponse": "Link", + "doc": "Includes links to related resources.", + "type": { + "$id": "1404", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1405", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "98" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.snapshot+json", + "application/problem+json" + ] + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/snapshots/{name}", + "requestMediaTypes": [ + "application/merge-patch+json", + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "AzureAppConfiguration.updateSnapshot", + "decorators": [], + "examples": [ + { + "$id": "1406", + "kind": "http", + "name": "Updates the state of a key-value snapshot.", + "description": "Updates the state of a key-value snapshot.", + "filePath": "2024-09-01/UpdateSnapshot.json", + "parameters": [ + { + "$id": "1407", + "parameter": { + "$ref": "1379" + }, + "value": { + "$id": "1408", + "kind": "string", + "type": { + "$ref": "1380" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1409", + "parameter": { + "$ref": "1384" + }, + "value": { + "$id": "1410", + "kind": "string", + "type": { + "$ref": "1385" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1411", + "parameter": { + "$ref": "1397" + }, + "value": { + "$id": "1412", + "kind": "model", + "type": { + "$ref": "309" + }, + "value": { + "$id": "1413", + "status": { + "$id": "1414", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "archived" + } + } + } + } + ], + "responses": [ + { + "$id": "1415", + "response": { + "$ref": "1398" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1416", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1417", + "etag": { + "$id": "1418", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1419", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1420", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "archived" + }, + "filters": { + "$id": "1421", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1422", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1423", + "key": { + "$id": "1424", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1425", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1426", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1427", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "expires": { + "$id": "1428", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "2022-09-01T22:19:40+00:00" + }, + "size": { + "$id": "1429", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 10000 + }, + "items_count": { + "$id": "1430", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 70 + }, + "retention_period": { + "$id": "1431", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 2592000 + }, + "tags": { + "$id": "1432", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1433" + } + } + } + } + } + ] + }, + { + "$id": "1434", + "kind": "http", + "name": "Updates the state of a key-value snapshot using the If-Match header.", + "description": "Updates the state of a key-value snapshot using the If-Match header.", + "filePath": "2024-09-01/UpdateSnapshot_IfMatch.json", + "parameters": [ + { + "$id": "1435", + "parameter": { + "$ref": "1379" + }, + "value": { + "$id": "1436", + "kind": "string", + "type": { + "$ref": "1380" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1437", + "parameter": { + "$ref": "1384" + }, + "value": { + "$id": "1438", + "kind": "string", + "type": { + "$ref": "1385" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1439", + "parameter": { + "$ref": "1397" + }, + "value": { + "$id": "1440", + "kind": "model", + "type": { + "$ref": "309" + }, + "value": { + "$id": "1441", + "status": { + "$id": "1442", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "archived" + } + } + } + }, + { + "$id": "1443", + "parameter": { + "$ref": "1388" + }, + "value": { + "$id": "1444", + "kind": "string", + "type": { + "$ref": "1389" + }, + "value": "\"4f6dd610dd5e4deebc7fbaef685fb903\"" + } + } + ], + "responses": [ + { + "$id": "1445", + "response": { + "$ref": "1398" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1446", + "kind": "model", + "type": { + "$ref": "231" + }, + "value": { + "$id": "1447", + "etag": { + "$id": "1448", + "kind": "string", + "type": { + "$ref": "289" + }, + "value": "4f6dd610dd5e4deebc7fbaef685fb903" + }, + "name": { + "$id": "1449", + "kind": "string", + "type": { + "$ref": "233" + }, + "value": "Prod-2022-08-01" + }, + "status": { + "$id": "1450", + "kind": "string", + "type": { + "$ref": "76" + }, + "value": "archived" + }, + "filters": { + "$id": "1451", + "kind": "array", + "type": { + "$ref": "240" + }, + "value": [ + { + "$id": "1452", + "kind": "model", + "type": { + "$ref": "241" + }, + "value": { + "$id": "1453", + "key": { + "$id": "1454", + "kind": "string", + "type": { + "$ref": "243" + }, + "value": "app1/*" + }, + "label": { + "$id": "1455", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Production" + } + } + } + ] + }, + "composition_type": { + "$id": "1456", + "kind": "string", + "type": { + "$ref": "86" + }, + "value": "all" + }, + "created": { + "$id": "1457", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-08-01T22:19:40+00:00" + }, + "expires": { + "$id": "1458", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "2022-09-01T22:19:40+00:00" + }, + "size": { + "$id": "1459", + "kind": "number", + "type": { + "$ref": "275" + }, + "value": 10000 + }, + "items_count": { + "$id": "1460", + "kind": "number", + "type": { + "$ref": "279" + }, + "value": 70 + }, + "retention_period": { + "$id": "1461", + "kind": "number", + "type": { + "$ref": "271" + }, + "value": 2592000 + }, + "tags": { + "$id": "1462", + "kind": "dict", + "type": { + "$ref": "283" + }, + "value": { + "$id": "1463" + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1464", + "name": "contentType", + "nameInRequest": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "122" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1465", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the key-value snapshot to update.", + "type": { + "$id": "1466", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1467", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1468", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1469", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1471", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1472", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1473", + "name": "entity", + "nameInRequest": "entity", + "doc": "The parameters used to update the snapshot.", + "type": { + "$ref": "309" + }, + "location": "Body", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1474", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1475", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1476", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1477", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1396" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1478", + "type": { + "$ref": "231" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.updateSnapshot" + }, + { + "$id": "1479", + "kind": "basic", + "name": "checkSnapshot", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Requests the headers and status of the given resource.", + "summary": "Requests the headers and status of the given resource.", + "operation": { + "$id": "1480", + "name": "checkSnapshot", + "resourceName": "AzureAppConfiguration", + "summary": "Requests the headers and status of the given resource.", + "doc": "Requests the headers and status of the given resource.", + "accessibility": "public", + "parameters": [ + { + "$id": "1481", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1482", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1483", + "type": { + "$id": "1484", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1485", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the key-value snapshot to check.", + "type": { + "$id": "1486", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1487", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1489", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1491", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1493", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1494", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1495", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1496", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1497", + "kind": "constant", + "valueType": { + "$id": "1498", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1499", + "statusCodes": [ + 200 + ], + "headers": [ + { + "$id": "1500", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1501", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1502", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1503", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1504", + "name": "link", + "nameInResponse": "Link", + "doc": "Includes links to related resources.", + "type": { + "$id": "1505", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "HEAD", + "uri": "{endpoint}", + "path": "/snapshots/{name}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkSnapshot", + "decorators": [], + "examples": [ + { + "$id": "1506", + "kind": "http", + "name": "Requests the headers and status of the given resource.", + "description": "Requests the headers and status of the given resource.", + "filePath": "2024-09-01/CheckSnapshot.json", + "parameters": [ + { + "$id": "1507", + "parameter": { + "$ref": "1481" + }, + "value": { + "$id": "1508", + "kind": "string", + "type": { + "$ref": "1482" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1509", + "parameter": { + "$ref": "1485" + }, + "value": { + "$id": "1510", + "kind": "string", + "type": { + "$ref": "1486" + }, + "value": "Prod-2022-08-01" + } + } + ], + "responses": [ + { + "$id": "1511", + "response": { + "$ref": "1499" + }, + "statusCode": 200 + } + ] + }, + { + "$id": "1512", + "kind": "http", + "name": "Requests the headers and status of the given resource using If-Match header.", + "description": "Requests the headers and status of the given resource using If-Match header.", + "filePath": "2024-09-01/CheckSnapshot_IfMatch.json", + "parameters": [ + { + "$id": "1513", + "parameter": { + "$ref": "1481" + }, + "value": { + "$id": "1514", + "kind": "string", + "type": { + "$ref": "1482" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1515", + "parameter": { + "$ref": "1485" + }, + "value": { + "$id": "1516", + "kind": "string", + "type": { + "$ref": "1486" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1517", + "parameter": { + "$ref": "1489" + }, + "value": { + "$id": "1518", + "kind": "string", + "type": { + "$ref": "1490" + }, + "value": "\"4f6dd610dd5e4deebc7fbaef685fb903\"" + } + } + ], + "responses": [ + { + "$id": "1519", + "response": { + "$ref": "1499" + }, + "statusCode": 200 + } + ] + }, + { + "$id": "1520", + "kind": "http", + "name": "Requests the headers and status of the given resource using If-None-Match header", + "description": "Requests the headers and status of the given resource using If-None-Match header", + "filePath": "2024-09-01/CheckSnapshot_IfNoneMatch.json", + "parameters": [ + { + "$id": "1521", + "parameter": { + "$ref": "1481" + }, + "value": { + "$id": "1522", + "kind": "string", + "type": { + "$ref": "1482" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1523", + "parameter": { + "$ref": "1485" + }, + "value": { + "$id": "1524", + "kind": "string", + "type": { + "$ref": "1486" + }, + "value": "Prod-2022-08-01" + } + }, + { + "$id": "1525", + "parameter": { + "$ref": "1491" + }, + "value": { + "$id": "1526", + "kind": "string", + "type": { + "$ref": "1492" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "1527", + "response": { + "$ref": "1499" + }, + "statusCode": 200 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1528", + "name": "name", + "nameInRequest": "name", + "doc": "The name of the key-value snapshot to check.", + "type": { + "$id": "1529", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1530", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1531", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1532", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1533", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1534", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1536", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1537", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1539", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1497" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1540" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkSnapshot" + }, + { + "$id": "1541", + "kind": "paging", + "name": "getLabels", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets a list of labels.", + "summary": "Gets a list of labels.", + "operation": { + "$id": "1542", + "name": "getLabels", + "resourceName": "AzureAppConfiguration", + "summary": "Gets a list of labels.", + "doc": "Gets a list of labels.", + "accessibility": "public", + "parameters": [ + { + "$id": "1543", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1545", + "type": { + "$id": "1546", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1547", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned labels.", + "type": { + "$id": "1548", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1549", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1550", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1551", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1552", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1553", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1554", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1555", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1556", + "kind": "array", + "name": "ArrayLabelFields", + "valueType": { + "$ref": "128" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1557", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1558", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1559", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1560", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1561", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1562", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "313" + }, + "headers": [ + { + "$id": "1563", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1564", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1565", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "132" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.labelset+json", + "application/problem+json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/labels", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getLabels", + "decorators": [], + "examples": [ + { + "$id": "1566", + "kind": "http", + "name": "Gets a list of labels.", + "description": "Gets a list of labels.", + "filePath": "2024-09-01/GetLabels.json", + "parameters": [ + { + "$id": "1567", + "parameter": { + "$ref": "1543" + }, + "value": { + "$id": "1568", + "kind": "string", + "type": { + "$ref": "1544" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "1569", + "response": { + "$ref": "1562" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1570", + "kind": "model", + "type": { + "$ref": "313" + }, + "value": { + "$id": "1571", + "items": { + "$id": "1572", + "kind": "array", + "type": { + "$ref": "315" + }, + "value": [ + { + "$id": "1573", + "kind": "model", + "type": { + "$ref": "316" + }, + "value": { + "$id": "1574" + } + }, + { + "$id": "1575", + "kind": "model", + "type": { + "$ref": "316" + }, + "value": { + "$id": "1576", + "name": { + "$id": "1577", + "kind": "string", + "type": { + "$ref": "318" + }, + "value": "Asset1" + } + } + }, + { + "$id": "1578", + "kind": "model", + "type": { + "$ref": "316" + }, + "value": { + "$id": "1579", + "name": { + "$id": "1580", + "kind": "string", + "type": { + "$ref": "318" + }, + "value": "Asset1/devCi" + } + } + }, + { + "$id": "1581", + "kind": "model", + "type": { + "$ref": "316" + }, + "value": { + "$id": "1582", + "name": { + "$id": "1583", + "kind": "string", + "type": { + "$ref": "318" + }, + "value": "Asset1/devCi/branch1" + } + } + }, + { + "$id": "1584", + "kind": "model", + "type": { + "$ref": "316" + }, + "value": { + "$id": "1585", + "name": { + "$id": "1586", + "kind": "string", + "type": { + "$ref": "318" + }, + "value": "WestUs" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1587", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned labels.", + "type": { + "$id": "1588", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1589", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1590", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1591", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1592", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1593", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1594", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1595", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1596", + "kind": "array", + "name": "ArrayLabelFields", + "valueType": { + "$ref": "128" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1597", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1598", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1599", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1600", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1561" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1601", + "type": { + "$id": "1602", + "kind": "array", + "name": "ArrayLabel", + "valueType": { + "$ref": "316" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "items" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getLabels", + "pagingMetadata": { + "$id": "1603", + "itemPropertySegments": [ + "items" + ], + "nextLink": { + "$id": "1604", + "responseSegments": [ + "@nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "1605", + "kind": "basic", + "name": "checkLabels", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Requests the headers and status of the given resource.", + "summary": "Requests the headers and status of the given resource.", + "operation": { + "$id": "1606", + "name": "checkLabels", + "resourceName": "AzureAppConfiguration", + "summary": "Requests the headers and status of the given resource.", + "doc": "Requests the headers and status of the given resource.", + "accessibility": "public", + "parameters": [ + { + "$id": "1607", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1608", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1609", + "type": { + "$id": "1610", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1611", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned labels.", + "type": { + "$id": "1612", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1613", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1614", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1615", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1616", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1617", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1618", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1619", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1620", + "kind": "array", + "name": "ArrayLabelFields", + "valueType": { + "$ref": "128" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1621", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1622", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1623", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1624", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1625", + "kind": "constant", + "valueType": { + "$id": "1626", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1627", + "statusCodes": [ + 200 + ], + "headers": [ + { + "$id": "1628", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1629", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "HEAD", + "uri": "{endpoint}", + "path": "/labels", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkLabels", + "decorators": [], + "examples": [ + { + "$id": "1630", + "kind": "http", + "name": "Requests the headers and status of the given resource.", + "description": "Requests the headers and status of the given resource.", + "filePath": "2024-09-01/CheckLabels.json", + "parameters": [ + { + "$id": "1631", + "parameter": { + "$ref": "1607" + }, + "value": { + "$id": "1632", + "kind": "string", + "type": { + "$ref": "1608" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "1633", + "response": { + "$ref": "1627" + }, + "statusCode": 200 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1634", + "name": "name", + "nameInRequest": "name", + "doc": "A filter for the name of the returned labels.", + "type": { + "$id": "1635", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1636", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1637", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1638", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1639", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1640", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1641", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1642", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1643", + "kind": "array", + "name": "ArrayLabelFields", + "valueType": { + "$ref": "128" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1644", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1645", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1646", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1647", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1625" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1648" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkLabels" + }, + { + "$id": "1649", + "kind": "basic", + "name": "putLock", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Locks a key-value.", + "summary": "Locks a key-value.", + "operation": { + "$id": "1650", + "name": "putLock", + "resourceName": "AzureAppConfiguration", + "summary": "Locks a key-value.", + "doc": "Locks a key-value.", + "accessibility": "public", + "parameters": [ + { + "$id": "1651", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1652", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1653", + "type": { + "$id": "1654", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1655", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to lock.", + "type": { + "$id": "1656", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1657", + "name": "label", + "nameInRequest": "label", + "doc": "The label, if any, of the key-value to lock.", + "type": { + "$id": "1658", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1659", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1660", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1661", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1662", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1663", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1664", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1665", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1666", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1667", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1668", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1669", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1670", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "182" + }, + "headers": [ + { + "$id": "1671", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1672", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1673", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1674", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1675", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "32" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.kv+json", + "application/problem+json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/locks/{key}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.putLock", + "decorators": [], + "examples": [ + { + "$id": "1676", + "kind": "http", + "name": "Locks a key-value.", + "description": "Locks a key-value.", + "filePath": "2024-09-01/PutLock.json", + "parameters": [ + { + "$id": "1677", + "parameter": { + "$ref": "1651" + }, + "value": { + "$id": "1678", + "kind": "string", + "type": { + "$ref": "1652" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1679", + "parameter": { + "$ref": "1655" + }, + "value": { + "$id": "1680", + "kind": "string", + "type": { + "$ref": "1656" + }, + "value": "Message" + } + } + ], + "responses": [ + { + "$id": "1681", + "response": { + "$ref": "1670" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1682", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "1683", + "etag": { + "$id": "1684", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV4" + }, + "key": { + "$id": "1685", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "1686", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "1687", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "1688" + } + }, + "locked": { + "$id": "1689", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": true + }, + "last_modified": { + "$id": "1690", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + }, + { + "$id": "1691", + "kind": "http", + "name": "Locks a key-value using If-Match header.", + "description": "Locks a key-value using If-Match header.", + "filePath": "2024-09-01/PutLock_IfMatch.json", + "parameters": [ + { + "$id": "1692", + "parameter": { + "$ref": "1651" + }, + "value": { + "$id": "1693", + "kind": "string", + "type": { + "$ref": "1652" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1694", + "parameter": { + "$ref": "1655" + }, + "value": { + "$id": "1695", + "kind": "string", + "type": { + "$ref": "1656" + }, + "value": "Message" + } + }, + { + "$id": "1696", + "parameter": { + "$ref": "1661" + }, + "value": { + "$id": "1697", + "kind": "string", + "type": { + "$ref": "1662" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "1698", + "response": { + "$ref": "1670" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1699", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "1700", + "etag": { + "$id": "1701", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + }, + "key": { + "$id": "1702", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "1703", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "1704", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "1705" + } + }, + "locked": { + "$id": "1706", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": true + }, + "last_modified": { + "$id": "1707", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1708", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to lock.", + "type": { + "$id": "1709", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1710", + "name": "label", + "nameInRequest": "label", + "doc": "The label, if any, of the key-value to lock.", + "type": { + "$id": "1711", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1712", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1713", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1714", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1715", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1716", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1717", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1718", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1719", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1720", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1721", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1669" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1722", + "type": { + "$ref": "182" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.putLock" + }, + { + "$id": "1723", + "kind": "basic", + "name": "deleteLock", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Unlocks a key-value.", + "summary": "Unlocks a key-value.", + "operation": { + "$id": "1724", + "name": "deleteLock", + "resourceName": "AzureAppConfiguration", + "summary": "Unlocks a key-value.", + "doc": "Unlocks a key-value.", + "accessibility": "public", + "parameters": [ + { + "$id": "1725", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1726", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1727", + "type": { + "$id": "1728", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1729", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to unlock.", + "type": { + "$id": "1730", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1731", + "name": "label", + "nameInRequest": "label", + "doc": "The label, if any, of the key-value to unlock.", + "type": { + "$id": "1732", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1733", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1734", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1735", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1736", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1737", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1738", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1739", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1740", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1741", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1742", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1743", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1744", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "182" + }, + "headers": [ + { + "$id": "1745", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1746", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1747", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1748", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1749", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "32" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.kv+json", + "application/problem+json" + ] + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/locks/{key}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.deleteLock", + "decorators": [], + "examples": [ + { + "$id": "1750", + "kind": "http", + "name": "Unlocks a key-value.", + "description": "Unlocks a key-value.", + "filePath": "2024-09-01/DeleteLock.json", + "parameters": [ + { + "$id": "1751", + "parameter": { + "$ref": "1725" + }, + "value": { + "$id": "1752", + "kind": "string", + "type": { + "$ref": "1726" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1753", + "parameter": { + "$ref": "1729" + }, + "value": { + "$id": "1754", + "kind": "string", + "type": { + "$ref": "1730" + }, + "value": "Message" + } + } + ], + "responses": [ + { + "$id": "1755", + "response": { + "$ref": "1744" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1756", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "1757", + "etag": { + "$id": "1758", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "0BGYCoQ6iNdp5NtQ7N8shrobo6s" + }, + "key": { + "$id": "1759", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "1760", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "1761", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "1762" + } + }, + "locked": { + "$id": "1763", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "1764", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + }, + { + "$id": "1765", + "kind": "http", + "name": "Unlocks a key-value using If-Match header.", + "description": "Unlocks a key-value using If-Match header.", + "filePath": "2024-09-01/DeleteLock_IfMatch.json", + "parameters": [ + { + "$id": "1766", + "parameter": { + "$ref": "1725" + }, + "value": { + "$id": "1767", + "kind": "string", + "type": { + "$ref": "1726" + }, + "value": "2024-09-01" + } + }, + { + "$id": "1768", + "parameter": { + "$ref": "1729" + }, + "value": { + "$id": "1769", + "kind": "string", + "type": { + "$ref": "1730" + }, + "value": "Message" + } + }, + { + "$id": "1770", + "parameter": { + "$ref": "1735" + }, + "value": { + "$id": "1771", + "kind": "string", + "type": { + "$ref": "1736" + }, + "value": "\"L10qpBghN693OaxydgTkLmrBbV5\"" + } + } + ], + "responses": [ + { + "$id": "1772", + "response": { + "$ref": "1744" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1773", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "1774", + "etag": { + "$id": "1775", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV5" + }, + "key": { + "$id": "1776", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "1777", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "1778", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "1779" + } + }, + "locked": { + "$id": "1780", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "1781", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1782", + "name": "key", + "nameInRequest": "key", + "doc": "The key of the key-value to unlock.", + "type": { + "$id": "1783", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1784", + "name": "label", + "nameInRequest": "label", + "doc": "The label, if any, of the key-value to unlock.", + "type": { + "$id": "1785", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1786", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1787", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1788", + "name": "ifMatch", + "nameInRequest": "If-Match", + "doc": "Used to perform an operation only if the targeted resource's etag matches the\nvalue provided.", + "type": { + "$id": "1789", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1790", + "name": "ifNoneMatch", + "nameInRequest": "If-None-Match", + "doc": "Used to perform an operation only if the targeted resource's etag does not\nmatch the value provided.", + "type": { + "$id": "1791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1792", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1793", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1794", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1795", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1743" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1796", + "type": { + "$ref": "182" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.deleteLock" + }, + { + "$id": "1797", + "kind": "paging", + "name": "getRevisions", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Gets a list of key-value revisions.", + "summary": "Gets a list of key-value revisions.", + "operation": { + "$id": "1798", + "name": "getRevisions", + "resourceName": "AzureAppConfiguration", + "summary": "Gets a list of key-value revisions.", + "doc": "Gets a list of key-value revisions.", + "accessibility": "public", + "parameters": [ + { + "$id": "1799", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1800", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1801", + "type": { + "$id": "1802", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1803", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1804", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1805", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1806", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1807", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1808", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1809", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1810", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1811", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1812", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1813", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1814", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1815", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1816", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1817", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1818", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1819", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1820", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1821", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1822", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1823", + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "179" + }, + "headers": [ + { + "$id": "1824", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1825", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1826", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1827", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1828", + "name": "contentType", + "nameInResponse": "Content-Type", + "doc": "Content-Type header", + "type": { + "$ref": "26" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/vnd.microsoft.appconfig.kvset+json", + "application/problem+json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/revisions", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getRevisions", + "decorators": [], + "examples": [ + { + "$id": "1829", + "kind": "http", + "name": "Gets a list of key-value revisions.", + "description": "Gets a list of key-value revisions.", + "filePath": "2024-09-01/GetRevisions.json", + "parameters": [ + { + "$id": "1830", + "parameter": { + "$ref": "1799" + }, + "value": { + "$id": "1831", + "kind": "string", + "type": { + "$ref": "1800" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "1832", + "response": { + "$ref": "1823" + }, + "statusCode": 200, + "bodyValue": { + "$id": "1833", + "kind": "model", + "type": { + "$ref": "179" + }, + "value": { + "$id": "1834", + "items": { + "$id": "1835", + "kind": "array", + "type": { + "$ref": "181" + }, + "value": [ + { + "$id": "1836", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "1837", + "etag": { + "$id": "1838", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "0BGYCoQ6iNdp5NtQ7N8shrobo6s" + }, + "key": { + "$id": "1839", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "1840", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "1841", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "1842" + } + }, + "locked": { + "$id": "1843", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "1844", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:32+00:00" + } + } + }, + { + "$id": "1845", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "1846", + "etag": { + "$id": "1847", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "L10qpBghN693OaxydgTkLmrBbV4" + }, + "key": { + "$id": "1848", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "1849", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "A new message." + }, + "tags": { + "$id": "1850", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "1851" + } + }, + "locked": { + "$id": "1852", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "1853", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:52:20+00:00" + } + } + }, + { + "$id": "1854", + "kind": "model", + "type": { + "$ref": "182" + }, + "value": { + "$id": "1855", + "etag": { + "$id": "1856", + "kind": "string", + "type": { + "$ref": "215" + }, + "value": "tnIHBkDYQwtdNMLoWtr5aybkKwL" + }, + "key": { + "$id": "1857", + "kind": "string", + "type": { + "$ref": "184" + }, + "value": "Message" + }, + "value": { + "$id": "1858", + "kind": "string", + "type": { + "$ref": "196" + }, + "value": "Hello World!" + }, + "tags": { + "$id": "1859", + "kind": "dict", + "type": { + "$ref": "205" + }, + "value": { + "$id": "1860" + } + }, + "locked": { + "$id": "1861", + "kind": "boolean", + "type": { + "$ref": "211" + }, + "value": false + }, + "last_modified": { + "$id": "1862", + "kind": "string", + "type": { + "$ref": "200" + }, + "value": "2019-08-27T16:50:47+00:00" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1863", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1864", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1865", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1866", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1867", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1868", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1869", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1870", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1871", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1872", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1873", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1874", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1875", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1876", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1877", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1878", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1879", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1880", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1881", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1822" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1882", + "type": { + "$id": "1883", + "kind": "array", + "name": "ArrayKeyValue", + "valueType": { + "$ref": "182" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "resultSegments": [ + "items" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.getRevisions", + "pagingMetadata": { + "$id": "1884", + "itemPropertySegments": [ + "items" + ], + "nextLink": { + "$id": "1885", + "responseSegments": [ + "@nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "1886", + "kind": "basic", + "name": "checkRevisions", + "accessibility": "public", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ], + "doc": "Requests the headers and status of the given resource.", + "summary": "Requests the headers and status of the given resource.", + "operation": { + "$id": "1887", + "name": "checkRevisions", + "resourceName": "AzureAppConfiguration", + "summary": "Requests the headers and status of the given resource.", + "doc": "Requests the headers and status of the given resource.", + "accessibility": "public", + "parameters": [ + { + "$id": "1888", + "name": "apiVersion", + "nameInRequest": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1889", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": true, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Client", + "defaultValue": { + "$id": "1890", + "type": { + "$id": "1891", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2024-09-01" + }, + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1892", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1893", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1894", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1895", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1896", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1897", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1898", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1899", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1900", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1901", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1902", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1903", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "arraySerializationDelimiter": ",", + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1904", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1905", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1906", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": true, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1907", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1908", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1909", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1910", + "name": "accept", + "nameInRequest": "Accept", + "type": { + "$id": "1911", + "kind": "constant", + "valueType": { + "$id": "1912", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "responses": [ + { + "$id": "1913", + "statusCodes": [ + 200 + ], + "headers": [ + { + "$id": "1914", + "name": "syncToken", + "nameInResponse": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1915", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "$id": "1916", + "name": "etagHeader", + "nameInResponse": "ETag", + "doc": "A value representing the current state of the resource.", + "type": { + "$id": "1917", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "HEAD", + "uri": "{endpoint}", + "path": "/revisions", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkRevisions", + "decorators": [], + "examples": [ + { + "$id": "1918", + "kind": "http", + "name": "Requests the headers and status of the given resource.", + "description": "Requests the headers and status of the given resource.", + "filePath": "2024-09-01/CheckRevisions.json", + "parameters": [ + { + "$id": "1919", + "parameter": { + "$ref": "1888" + }, + "value": { + "$id": "1920", + "kind": "string", + "type": { + "$ref": "1889" + }, + "value": "2024-09-01" + } + } + ], + "responses": [ + { + "$id": "1921", + "response": { + "$ref": "1913" + }, + "statusCode": 200 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1922", + "name": "key", + "nameInRequest": "key", + "doc": "A filter used to match keys. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1923", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1924", + "name": "label", + "nameInRequest": "label", + "doc": "A filter used to match labels. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1925", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1926", + "name": "syncToken", + "nameInRequest": "Sync-Token", + "doc": "Used to guarantee real-time consistency between requests.", + "type": { + "$id": "1927", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1928", + "name": "after", + "nameInRequest": "After", + "doc": "Instructs the server to return elements that appear after the element referred\nto by the specified token.", + "type": { + "$id": "1929", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1930", + "name": "acceptDatetime", + "nameInRequest": "Accept-Datetime", + "doc": "Requests the server to respond with the state of the resource at the specified\ntime.", + "type": { + "$id": "1931", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1932", + "name": "select", + "nameInRequest": "$Select", + "doc": "Used to select what fields are present in the returned resource(s).", + "type": { + "$id": "1933", + "kind": "array", + "name": "ArrayKeyValueFields", + "valueType": { + "$ref": "8" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1934", + "name": "tags", + "nameInRequest": "tags", + "doc": "A filter used to query by tags. Syntax reference:\nhttps://aka.ms/azconfig/docs/restapirevisions", + "type": { + "$id": "1935", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "1936", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1937", + "name": "clientRequestId", + "nameInRequest": "x-ms-client-request-id", + "doc": "An opaque, globally-unique, client-generated string identifier for the request.", + "type": { + "$id": "1938", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1939", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": false, + "kind": "Method", + "decorators": [], + "skipUrlEncoding": false + }, + { + "$id": "1940", + "name": "accept", + "nameInRequest": "accept", + "type": { + "$ref": "1911" + }, + "location": "Header", + "isApiVersion": false, + "isContentType": false, + "isEndpoint": false, + "explode": false, + "isRequired": true, + "kind": "Constant", + "decorators": [], + "skipUrlEncoding": false + } + ], + "response": { + "$id": "1941" + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "AzureAppConfiguration.checkRevisions" + } + ], + "parameters": [ + { + "$id": "1942", + "name": "endpoint", + "nameInRequest": "endpoint", + "type": { + "$id": "1943", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "location": "Uri", + "isApiVersion": false, + "isContentType": false, + "isRequired": true, + "isEndpoint": true, + "skipUrlEncoding": false, + "explode": false, + "kind": "Client" + } + ], + "decorators": [ + { + "$id": "1944", + "name": "TypeSpec.@service", + "arguments": { + "$id": "1945", + "options": { + "$id": "1946", + "title": "Azure App Configuration" + } + } + } + ], + "crossLanguageDefinitionId": "AzureAppConfiguration", + "apiVersions": [ + "2023-11-01", + "2024-09-01" + ] + } + ], + "auth": { + "$id": "1947", + "apiKey": { + "$id": "1948", + "name": "Connection String", + "in": "header" + }, + "oAuth2": { + "$id": "1949", + "scopes": [ + "https://azconfig.io/.default" + ] + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/LiveMetrics.sln b/sdk/applicationinsights/LiveMetrics/LiveMetrics.sln new file mode 100644 index 000000000000..202d00182aa1 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/LiveMetrics.sln @@ -0,0 +1,50 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveMetrics", "src\LiveMetrics.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveMetrics.Tests", "tests\LiveMetrics.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/AggregationType.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/AggregationType.cs new file mode 100644 index 000000000000..f785f0dec7ee --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/AggregationType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace LiveMetrics +{ + /// Aggregation type. + public readonly partial struct AggregationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AggregationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvgValue = "Avg"; + private const string SumValue = "Sum"; + private const string MinValue = "Min"; + private const string MaxValue = "Max"; + + /// Average. + public static AggregationType Avg { get; } = new AggregationType(AvgValue); + /// Sum. + public static AggregationType Sum { get; } = new AggregationType(SumValue); + /// Minimum. + public static AggregationType Min { get; } = new AggregationType(MinValue); + /// Maximum. + public static AggregationType Max { get; } = new AggregationType(MaxValue); + /// Determines if two values are the same. + public static bool operator ==(AggregationType left, AggregationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AggregationType left, AggregationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AggregationType(string value) => new AggregationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AggregationType other && Equals(other); + /// + public bool Equals(AggregationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.Serialization.cs new file mode 100644 index 000000000000..e9e1e7254703 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class CollectionConfigurationError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectionConfigurationError)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("CollectionConfigurationErrorType"u8); + writer.WriteStringValue(CollectionConfigurationErrorType.ToString()); + writer.WritePropertyName("Message"u8); + writer.WriteStringValue(Message); + writer.WritePropertyName("FullException"u8); + writer.WriteStringValue(FullException); + writer.WritePropertyName("Data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CollectionConfigurationError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectionConfigurationError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCollectionConfigurationError(document.RootElement, options); + } + + internal static CollectionConfigurationError DeserializeCollectionConfigurationError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CollectionConfigurationErrorType collectionConfigurationErrorType = default; + string message = default; + string fullException = default; + IList data = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("CollectionConfigurationErrorType"u8)) + { + collectionConfigurationErrorType = new CollectionConfigurationErrorType(property.Value.GetString()); + continue; + } + if (property.NameEquals("Message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("FullException"u8)) + { + fullException = property.Value.GetString(); + continue; + } + if (property.NameEquals("Data"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringString.DeserializeKeyValuePairStringString(item, options)); + } + data = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CollectionConfigurationError(collectionConfigurationErrorType, message, fullException, data, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(CollectionConfigurationError)} does not support writing '{options.Format}' format."); + } + } + + CollectionConfigurationError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCollectionConfigurationError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CollectionConfigurationError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CollectionConfigurationError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCollectionConfigurationError(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.cs new file mode 100644 index 000000000000..2c827786fc4b --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationError.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace LiveMetrics +{ + /// Represents an error while SDK parses and applies an instance of CollectionConfigurationInfo. + public partial class CollectionConfigurationError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Error type. + /// Error message. + /// Exception that led to the creation of the configuration error. + /// Custom properties to add more information to the error. + /// , or is null. + public CollectionConfigurationError(CollectionConfigurationErrorType collectionConfigurationErrorType, string message, string fullException, IEnumerable data) + { + Argument.AssertNotNull(message, nameof(message)); + Argument.AssertNotNull(fullException, nameof(fullException)); + Argument.AssertNotNull(data, nameof(data)); + + CollectionConfigurationErrorType = collectionConfigurationErrorType; + Message = message; + FullException = fullException; + Data = data.ToList(); + } + + /// Initializes a new instance of . + /// Error type. + /// Error message. + /// Exception that led to the creation of the configuration error. + /// Custom properties to add more information to the error. + /// Keeps track of any properties unknown to the library. + internal CollectionConfigurationError(CollectionConfigurationErrorType collectionConfigurationErrorType, string message, string fullException, IList data, IDictionary serializedAdditionalRawData) + { + CollectionConfigurationErrorType = collectionConfigurationErrorType; + Message = message; + FullException = fullException; + Data = data; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CollectionConfigurationError() + { + } + + /// Error type. + public CollectionConfigurationErrorType CollectionConfigurationErrorType { get; } + /// Error message. + public string Message { get; } + /// Exception that led to the creation of the configuration error. + public string FullException { get; } + /// Custom properties to add more information to the error. + public IList Data { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationErrorType.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationErrorType.cs new file mode 100644 index 000000000000..9e116938866b --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationErrorType.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace LiveMetrics +{ + /// Collection configuration error type reported by the client SDK. + public readonly partial struct CollectionConfigurationErrorType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CollectionConfigurationErrorType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string PerformanceCounterParsingValue = "PerformanceCounterParsing"; + private const string PerformanceCounterUnexpectedValue = "PerformanceCounterUnexpected"; + private const string PerformanceCounterDuplicateIdsValue = "PerformanceCounterDuplicateIds"; + private const string DocumentStreamDuplicateIdsValue = "DocumentStreamDuplicateIds"; + private const string DocumentStreamFailureToCreateValue = "DocumentStreamFailureToCreate"; + private const string DocumentStreamFailureToCreateFilterUnexpectedValue = "DocumentStreamFailureToCreateFilterUnexpected"; + private const string MetricDuplicateIdsValue = "MetricDuplicateIds"; + private const string MetricTelemetryTypeUnsupportedValue = "MetricTelemetryTypeUnsupported"; + private const string MetricFailureToCreateValue = "MetricFailureToCreate"; + private const string MetricFailureToCreateFilterUnexpectedValue = "MetricFailureToCreateFilterUnexpected"; + private const string FilterFailureToCreateUnexpectedValue = "FilterFailureToCreateUnexpected"; + private const string CollectionConfigurationFailureToCreateUnexpectedValue = "CollectionConfigurationFailureToCreateUnexpected"; + + /// Unknown error type. + public static CollectionConfigurationErrorType Unknown { get; } = new CollectionConfigurationErrorType(UnknownValue); + /// Performance counter parsing error. + public static CollectionConfigurationErrorType PerformanceCounterParsing { get; } = new CollectionConfigurationErrorType(PerformanceCounterParsingValue); + /// Performance counter unexpected error. + public static CollectionConfigurationErrorType PerformanceCounterUnexpected { get; } = new CollectionConfigurationErrorType(PerformanceCounterUnexpectedValue); + /// Performance counter duplicate ids. + public static CollectionConfigurationErrorType PerformanceCounterDuplicateIds { get; } = new CollectionConfigurationErrorType(PerformanceCounterDuplicateIdsValue); + /// Document stream duplication ids. + public static CollectionConfigurationErrorType DocumentStreamDuplicateIds { get; } = new CollectionConfigurationErrorType(DocumentStreamDuplicateIdsValue); + /// Document stream failed to create. + public static CollectionConfigurationErrorType DocumentStreamFailureToCreate { get; } = new CollectionConfigurationErrorType(DocumentStreamFailureToCreateValue); + /// Document stream failed to create filter unexpectedly. + public static CollectionConfigurationErrorType DocumentStreamFailureToCreateFilterUnexpected { get; } = new CollectionConfigurationErrorType(DocumentStreamFailureToCreateFilterUnexpectedValue); + /// Metric duplicate ids. + public static CollectionConfigurationErrorType MetricDuplicateIds { get; } = new CollectionConfigurationErrorType(MetricDuplicateIdsValue); + /// Metric telemetry type unsupported. + public static CollectionConfigurationErrorType MetricTelemetryTypeUnsupported { get; } = new CollectionConfigurationErrorType(MetricTelemetryTypeUnsupportedValue); + /// Metric failed to create. + public static CollectionConfigurationErrorType MetricFailureToCreate { get; } = new CollectionConfigurationErrorType(MetricFailureToCreateValue); + /// Metric failed to create filter unexpectedly. + public static CollectionConfigurationErrorType MetricFailureToCreateFilterUnexpected { get; } = new CollectionConfigurationErrorType(MetricFailureToCreateFilterUnexpectedValue); + /// Filter failed to create unexpectedly. + public static CollectionConfigurationErrorType FilterFailureToCreateUnexpected { get; } = new CollectionConfigurationErrorType(FilterFailureToCreateUnexpectedValue); + /// Collection configuration failed to create unexpectedly. + public static CollectionConfigurationErrorType CollectionConfigurationFailureToCreateUnexpected { get; } = new CollectionConfigurationErrorType(CollectionConfigurationFailureToCreateUnexpectedValue); + /// Determines if two values are the same. + public static bool operator ==(CollectionConfigurationErrorType left, CollectionConfigurationErrorType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CollectionConfigurationErrorType left, CollectionConfigurationErrorType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CollectionConfigurationErrorType(string value) => new CollectionConfigurationErrorType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CollectionConfigurationErrorType other && Equals(other); + /// + public bool Equals(CollectionConfigurationErrorType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.Serialization.cs new file mode 100644 index 000000000000..96098fa35b93 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class CollectionConfigurationInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectionConfigurationInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ETag"u8); + writer.WriteStringValue(ETag); + writer.WritePropertyName("Metrics"u8); + writer.WriteStartArray(); + foreach (var item in Metrics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("DocumentStreams"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreams) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(QuotaInfo)) + { + writer.WritePropertyName("QuotaInfo"u8); + writer.WriteObjectValue(QuotaInfo, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CollectionConfigurationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CollectionConfigurationInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCollectionConfigurationInfo(document.RootElement, options); + } + + internal static CollectionConfigurationInfo DeserializeCollectionConfigurationInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eTag = default; + IReadOnlyList metrics = default; + IReadOnlyList documentStreams = default; + QuotaConfigurationInfo quotaInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ETag"u8)) + { + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("Metrics"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DerivedMetricInfo.DeserializeDerivedMetricInfo(item, options)); + } + metrics = array; + continue; + } + if (property.NameEquals("DocumentStreams"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentStreamInfo.DeserializeDocumentStreamInfo(item, options)); + } + documentStreams = array; + continue; + } + if (property.NameEquals("QuotaInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quotaInfo = QuotaConfigurationInfo.DeserializeQuotaConfigurationInfo(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CollectionConfigurationInfo(eTag, metrics, documentStreams, quotaInfo, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(CollectionConfigurationInfo)} does not support writing '{options.Format}' format."); + } + } + + CollectionConfigurationInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCollectionConfigurationInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CollectionConfigurationInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CollectionConfigurationInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCollectionConfigurationInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.cs new file mode 100644 index 000000000000..2202b8fcc18b --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/CollectionConfigurationInfo.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace LiveMetrics +{ + /// Represents the collection configuration - a customizable description of performance counters, metrics, and full telemetry documents to be collected by the client SDK. + public partial class CollectionConfigurationInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// An encoded string that indicates whether the collection configuration is changed. + /// An array of metric configuration info. + /// An array of document stream configuration info. + /// , or is null. + internal CollectionConfigurationInfo(string eTag, IEnumerable metrics, IEnumerable documentStreams) + { + Argument.AssertNotNull(eTag, nameof(eTag)); + Argument.AssertNotNull(metrics, nameof(metrics)); + Argument.AssertNotNull(documentStreams, nameof(documentStreams)); + + ETag = eTag; + Metrics = metrics.ToList(); + DocumentStreams = documentStreams.ToList(); + } + + /// Initializes a new instance of . + /// An encoded string that indicates whether the collection configuration is changed. + /// An array of metric configuration info. + /// An array of document stream configuration info. + /// Controls document quotas to be sent to Live Metrics. + /// Keeps track of any properties unknown to the library. + internal CollectionConfigurationInfo(string eTag, IReadOnlyList metrics, IReadOnlyList documentStreams, QuotaConfigurationInfo quotaInfo, IDictionary serializedAdditionalRawData) + { + ETag = eTag; + Metrics = metrics; + DocumentStreams = documentStreams; + QuotaInfo = quotaInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CollectionConfigurationInfo() + { + } + + /// An encoded string that indicates whether the collection configuration is changed. + public string ETag { get; } + /// An array of metric configuration info. + public IReadOnlyList Metrics { get; } + /// An array of document stream configuration info. + public IReadOnlyList DocumentStreams { get; } + /// Controls document quotas to be sent to Live Metrics. + public QuotaConfigurationInfo QuotaInfo { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.Serialization.cs new file mode 100644 index 000000000000..19753315521a --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class DerivedMetricInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DerivedMetricInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("TelemetryType"u8); + writer.WriteStringValue(TelemetryType); + writer.WritePropertyName("FilterGroups"u8); + writer.WriteStartArray(); + foreach (var item in FilterGroups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("Projection"u8); + writer.WriteStringValue(Projection); + writer.WritePropertyName("Aggregation"u8); + writer.WriteStringValue(Aggregation.ToString()); + writer.WritePropertyName("BackEndAggregation"u8); + writer.WriteStringValue(BackEndAggregation.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DerivedMetricInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DerivedMetricInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDerivedMetricInfo(document.RootElement, options); + } + + internal static DerivedMetricInfo DeserializeDerivedMetricInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string telemetryType = default; + IReadOnlyList filterGroups = default; + string projection = default; + AggregationType aggregation = default; + AggregationType backEndAggregation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("TelemetryType"u8)) + { + telemetryType = property.Value.GetString(); + continue; + } + if (property.NameEquals("FilterGroups"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FilterConjunctionGroupInfo.DeserializeFilterConjunctionGroupInfo(item, options)); + } + filterGroups = array; + continue; + } + if (property.NameEquals("Projection"u8)) + { + projection = property.Value.GetString(); + continue; + } + if (property.NameEquals("Aggregation"u8)) + { + aggregation = new AggregationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("BackEndAggregation"u8)) + { + backEndAggregation = new AggregationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DerivedMetricInfo( + id, + telemetryType, + filterGroups, + projection, + aggregation, + backEndAggregation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(DerivedMetricInfo)} does not support writing '{options.Format}' format."); + } + } + + DerivedMetricInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDerivedMetricInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DerivedMetricInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DerivedMetricInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDerivedMetricInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.cs new file mode 100644 index 000000000000..bf65e8969c59 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DerivedMetricInfo.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace LiveMetrics +{ + /// A metric configuration set by UX to scope the metrics it's interested in. + public partial class DerivedMetricInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// metric configuration identifier. + /// Telemetry type. + /// A collection of filters to scope metrics that UX needs. + /// Telemetry's metric dimension whose value is to be aggregated. Example values: Duration, Count(),... + /// Aggregation type. This is the aggregation done from everything within a single server. + /// Aggregation type. This Aggregation is done across the values for all the servers taken together. + /// , , or is null. + internal DerivedMetricInfo(string id, string telemetryType, IEnumerable filterGroups, string projection, AggregationType aggregation, AggregationType backEndAggregation) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(telemetryType, nameof(telemetryType)); + Argument.AssertNotNull(filterGroups, nameof(filterGroups)); + Argument.AssertNotNull(projection, nameof(projection)); + + Id = id; + TelemetryType = telemetryType; + FilterGroups = filterGroups.ToList(); + Projection = projection; + Aggregation = aggregation; + BackEndAggregation = backEndAggregation; + } + + /// Initializes a new instance of . + /// metric configuration identifier. + /// Telemetry type. + /// A collection of filters to scope metrics that UX needs. + /// Telemetry's metric dimension whose value is to be aggregated. Example values: Duration, Count(),... + /// Aggregation type. This is the aggregation done from everything within a single server. + /// Aggregation type. This Aggregation is done across the values for all the servers taken together. + /// Keeps track of any properties unknown to the library. + internal DerivedMetricInfo(string id, string telemetryType, IReadOnlyList filterGroups, string projection, AggregationType aggregation, AggregationType backEndAggregation, IDictionary serializedAdditionalRawData) + { + Id = id; + TelemetryType = telemetryType; + FilterGroups = filterGroups; + Projection = projection; + Aggregation = aggregation; + BackEndAggregation = backEndAggregation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DerivedMetricInfo() + { + } + + /// metric configuration identifier. + public string Id { get; } + /// Telemetry type. + public string TelemetryType { get; } + /// A collection of filters to scope metrics that UX needs. + public IReadOnlyList FilterGroups { get; } + /// Telemetry's metric dimension whose value is to be aggregated. Example values: Duration, Count(),... + public string Projection { get; } + /// Aggregation type. This is the aggregation done from everything within a single server. + public AggregationType Aggregation { get; } + /// Aggregation type. This Aggregation is done across the values for all the servers taken together. + public AggregationType BackEndAggregation { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Docs/LiveMetricsClient.xml b/sdk/applicationinsights/LiveMetrics/src/Generated/Docs/LiveMetricsClient.xml new file mode 100644 index 000000000000..d20fe9db0cf7 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Docs/LiveMetricsClient.xml @@ -0,0 +1,439 @@ + + + + + +This sample shows how to call IsSubscribedAsync. + response = await client.IsSubscribedAsync("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); +]]> + + + +This sample shows how to call IsSubscribed. + response = client.IsSubscribed("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); +]]> + + + +This sample shows how to call IsSubscribedAsync and parse the result. + + + + +This sample shows how to call IsSubscribed and parse the result. + + + + +This sample shows how to call PublishAsync. + response = await client.PublishAsync("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); +]]> + + + +This sample shows how to call Publish. + response = client.Publish("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); +]]> + + + +This sample shows how to call PublishAsync and parse the result. + + + + +This sample shows how to call Publish and parse the result. + + + + \ No newline at end of file diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.Serialization.cs new file mode 100644 index 000000000000..a92137a3883f --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class DocumentFilterConjunctionGroupInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentFilterConjunctionGroupInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("TelemetryType"u8); + writer.WriteStringValue(TelemetryType.ToString()); + writer.WritePropertyName("Filters"u8); + writer.WriteObjectValue(Filters, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentFilterConjunctionGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentFilterConjunctionGroupInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentFilterConjunctionGroupInfo(document.RootElement, options); + } + + internal static DocumentFilterConjunctionGroupInfo DeserializeDocumentFilterConjunctionGroupInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TelemetryType telemetryType = default; + FilterConjunctionGroupInfo filters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("TelemetryType"u8)) + { + telemetryType = new TelemetryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("Filters"u8)) + { + filters = FilterConjunctionGroupInfo.DeserializeFilterConjunctionGroupInfo(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentFilterConjunctionGroupInfo(telemetryType, filters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(DocumentFilterConjunctionGroupInfo)} does not support writing '{options.Format}' format."); + } + } + + DocumentFilterConjunctionGroupInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentFilterConjunctionGroupInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentFilterConjunctionGroupInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentFilterConjunctionGroupInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentFilterConjunctionGroupInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.cs new file mode 100644 index 000000000000..ab47aa5a5a85 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentFilterConjunctionGroupInfo.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// A collection of filters for a specific telemetry type. + public partial class DocumentFilterConjunctionGroupInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Telemetry type. + /// An array of filter groups. + /// is null. + internal DocumentFilterConjunctionGroupInfo(TelemetryType telemetryType, FilterConjunctionGroupInfo filters) + { + Argument.AssertNotNull(filters, nameof(filters)); + + TelemetryType = telemetryType; + Filters = filters; + } + + /// Initializes a new instance of . + /// Telemetry type. + /// An array of filter groups. + /// Keeps track of any properties unknown to the library. + internal DocumentFilterConjunctionGroupInfo(TelemetryType telemetryType, FilterConjunctionGroupInfo filters, IDictionary serializedAdditionalRawData) + { + TelemetryType = telemetryType; + Filters = filters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentFilterConjunctionGroupInfo() + { + } + + /// Telemetry type. + public TelemetryType TelemetryType { get; } + /// An array of filter groups. + public FilterConjunctionGroupInfo Filters { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.Serialization.cs new file mode 100644 index 000000000000..5603d9b92546 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + [PersistableModelProxy(typeof(UnknownDocumentIngress))] + public partial class DocumentIngress : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentIngress)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("DocumentType"u8); + writer.WriteStringValue(DocumentType.ToString()); + if (Optional.IsCollectionDefined(DocumentStreamIds)) + { + writer.WritePropertyName("DocumentStreamIds"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreamIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("Properties"u8); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentIngress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentIngress)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentIngress(document.RootElement, options); + } + + internal static DocumentIngress DeserializeDocumentIngress(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("DocumentType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Event": return Event.DeserializeEvent(element, options); + case "Exception": return Exception.DeserializeException(element, options); + case "RemoteDependency": return RemoteDependency.DeserializeRemoteDependency(element, options); + case "Request": return Request.DeserializeRequest(element, options); + case "Trace": return Trace.DeserializeTrace(element, options); + } + } + return UnknownDocumentIngress.DeserializeUnknownDocumentIngress(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(DocumentIngress)} does not support writing '{options.Format}' format."); + } + } + + DocumentIngress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentIngress(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentIngress)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentIngress FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentIngress(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.cs new file mode 100644 index 000000000000..495a1ba03e02 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentIngress.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// + /// Base class of the specific document types. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public abstract partial class DocumentIngress + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DocumentIngress() + { + DocumentStreamIds = new ChangeTrackingList(); + Properties = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Keeps track of any properties unknown to the library. + internal DocumentIngress(DocumentType documentType, IList documentStreamIds, IList properties, IDictionary serializedAdditionalRawData) + { + DocumentType = documentType; + DocumentStreamIds = documentStreamIds; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + internal DocumentType DocumentType { get; set; } + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + public IList DocumentStreamIds { get; } + /// Collection of custom properties. + public IList Properties { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.Serialization.cs new file mode 100644 index 000000000000..21f555e59630 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.Serialization.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class DocumentStreamInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentStreamInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("Id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("DocumentFilterGroups"u8); + writer.WriteStartArray(); + foreach (var item in DocumentFilterGroups) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DocumentStreamInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentStreamInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentStreamInfo(document.RootElement, options); + } + + internal static DocumentStreamInfo DeserializeDocumentStreamInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IReadOnlyList documentFilterGroups = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("DocumentFilterGroups"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentFilterConjunctionGroupInfo.DeserializeDocumentFilterConjunctionGroupInfo(item, options)); + } + documentFilterGroups = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DocumentStreamInfo(id, documentFilterGroups, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(DocumentStreamInfo)} does not support writing '{options.Format}' format."); + } + } + + DocumentStreamInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentStreamInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentStreamInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentStreamInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentStreamInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.cs new file mode 100644 index 000000000000..02101af6454e --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentStreamInfo.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace LiveMetrics +{ + /// Configurations/filters set by UX to scope the document/telemetry it's interested in. + public partial class DocumentStreamInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Identifier of the document stream initiated by a UX. + /// Gets or sets an OR-connected collection of filter groups. + /// or is null. + internal DocumentStreamInfo(string id, IEnumerable documentFilterGroups) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(documentFilterGroups, nameof(documentFilterGroups)); + + Id = id; + DocumentFilterGroups = documentFilterGroups.ToList(); + } + + /// Initializes a new instance of . + /// Identifier of the document stream initiated by a UX. + /// Gets or sets an OR-connected collection of filter groups. + /// Keeps track of any properties unknown to the library. + internal DocumentStreamInfo(string id, IReadOnlyList documentFilterGroups, IDictionary serializedAdditionalRawData) + { + Id = id; + DocumentFilterGroups = documentFilterGroups; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DocumentStreamInfo() + { + } + + /// Identifier of the document stream initiated by a UX. + public string Id { get; } + /// Gets or sets an OR-connected collection of filter groups. + public IReadOnlyList DocumentFilterGroups { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentType.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentType.cs new file mode 100644 index 000000000000..d0eec283fbcf --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/DocumentType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace LiveMetrics +{ + /// Document type. + internal readonly partial struct DocumentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequestValue = "Request"; + private const string RemoteDependencyValue = "RemoteDependency"; + private const string ExceptionValue = "Exception"; + private const string EventValue = "Event"; + private const string TraceValue = "Trace"; + private const string UnknownValue = "Unknown"; + + /// Represents a request telemetry type. + public static DocumentType Request { get; } = new DocumentType(RequestValue); + /// Represents a remote dependency telemetry type. + public static DocumentType RemoteDependency { get; } = new DocumentType(RemoteDependencyValue); + /// Represents an exception telemetry type. + public static DocumentType Exception { get; } = new DocumentType(ExceptionValue); + /// Represents an event telemetry type. + public static DocumentType Event { get; } = new DocumentType(EventValue); + /// Represents a trace telemetry type. + public static DocumentType Trace { get; } = new DocumentType(TraceValue); + /// Represents an unknown telemetry type. + public static DocumentType Unknown { get; } = new DocumentType(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentType left, DocumentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentType left, DocumentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DocumentType(string value) => new DocumentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentType other && Equals(other); + /// + public bool Equals(DocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Event.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Event.Serialization.cs new file mode 100644 index 000000000000..159fee997ab0 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Event.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class Event : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Event)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + } + } + + Event IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Event)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEvent(document.RootElement, options); + } + + internal static Event DeserializeEvent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + DocumentType documentType = default; + IList documentStreamIds = default; + IList properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("DocumentType"u8)) + { + documentType = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("DocumentStreamIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + documentStreamIds = array; + continue; + } + if (property.NameEquals("Properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringString.DeserializeKeyValuePairStringString(item, options)); + } + properties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Event(documentType, documentStreamIds ?? new ChangeTrackingList(), properties ?? new ChangeTrackingList(), serializedAdditionalRawData, name); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(Event)} does not support writing '{options.Format}' format."); + } + } + + Event IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEvent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Event)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Event FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEvent(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Event.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Event.cs new file mode 100644 index 000000000000..ac0ba2ec5b66 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Event.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Event document type. + public partial class Event : DocumentIngress + { + /// Initializes a new instance of . + public Event() + { + DocumentType = DocumentType.Event; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Keeps track of any properties unknown to the library. + /// Event name. + internal Event(DocumentType documentType, IList documentStreamIds, IList properties, IDictionary serializedAdditionalRawData, string name) : base(documentType, documentStreamIds, properties, serializedAdditionalRawData) + { + Name = name; + } + + /// Event name. + public string Name { get; set; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Exception.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Exception.Serialization.cs new file mode 100644 index 000000000000..0585f1480811 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Exception.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class Exception : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Exception)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ExceptionType)) + { + writer.WritePropertyName("ExceptionType"u8); + writer.WriteStringValue(ExceptionType); + } + if (Optional.IsDefined(ExceptionMessage)) + { + writer.WritePropertyName("ExceptionMessage"u8); + writer.WriteStringValue(ExceptionMessage); + } + } + + Exception IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Exception)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeException(document.RootElement, options); + } + + internal static Exception DeserializeException(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string exceptionType = default; + string exceptionMessage = default; + DocumentType documentType = default; + IList documentStreamIds = default; + IList properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ExceptionType"u8)) + { + exceptionType = property.Value.GetString(); + continue; + } + if (property.NameEquals("ExceptionMessage"u8)) + { + exceptionMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("DocumentType"u8)) + { + documentType = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("DocumentStreamIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + documentStreamIds = array; + continue; + } + if (property.NameEquals("Properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringString.DeserializeKeyValuePairStringString(item, options)); + } + properties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Exception( + documentType, + documentStreamIds ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingList(), + serializedAdditionalRawData, + exceptionType, + exceptionMessage); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(Exception)} does not support writing '{options.Format}' format."); + } + } + + Exception IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeException(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Exception)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Exception FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeException(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Exception.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Exception.cs new file mode 100644 index 000000000000..33c36b88e5e0 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Exception.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Exception document type. + public partial class Exception : DocumentIngress + { + /// Initializes a new instance of . + public Exception() + { + DocumentType = DocumentType.Exception; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Keeps track of any properties unknown to the library. + /// Exception type name. + /// Exception message. + internal Exception(DocumentType documentType, IList documentStreamIds, IList properties, IDictionary serializedAdditionalRawData, string exceptionType, string exceptionMessage) : base(documentType, documentStreamIds, properties, serializedAdditionalRawData) + { + ExceptionType = exceptionType; + ExceptionMessage = exceptionMessage; + } + + /// Exception type name. + public string ExceptionType { get; set; } + /// Exception message. + public string ExceptionMessage { get; set; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.Serialization.cs new file mode 100644 index 000000000000..2d31e8d43601 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class FilterConjunctionGroupInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FilterConjunctionGroupInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("Filters"u8); + writer.WriteStartArray(); + foreach (var item in Filters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FilterConjunctionGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FilterConjunctionGroupInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFilterConjunctionGroupInfo(document.RootElement, options); + } + + internal static FilterConjunctionGroupInfo DeserializeFilterConjunctionGroupInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList filters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Filters"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FilterInfo.DeserializeFilterInfo(item, options)); + } + filters = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FilterConjunctionGroupInfo(filters, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(FilterConjunctionGroupInfo)} does not support writing '{options.Format}' format."); + } + } + + FilterConjunctionGroupInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFilterConjunctionGroupInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FilterConjunctionGroupInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FilterConjunctionGroupInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFilterConjunctionGroupInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.cs new file mode 100644 index 000000000000..16ce6d4a1f18 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterConjunctionGroupInfo.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace LiveMetrics +{ + /// An AND-connected group of FilterInfo objects. + public partial class FilterConjunctionGroupInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// An array of filters. + /// is null. + internal FilterConjunctionGroupInfo(IEnumerable filters) + { + Argument.AssertNotNull(filters, nameof(filters)); + + Filters = filters.ToList(); + } + + /// Initializes a new instance of . + /// An array of filters. + /// Keeps track of any properties unknown to the library. + internal FilterConjunctionGroupInfo(IReadOnlyList filters, IDictionary serializedAdditionalRawData) + { + Filters = filters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FilterConjunctionGroupInfo() + { + } + + /// An array of filters. + public IReadOnlyList Filters { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.Serialization.cs new file mode 100644 index 000000000000..b08c54ab59ad --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class FilterInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FilterInfo)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("FieldName"u8); + writer.WriteStringValue(FieldName); + writer.WritePropertyName("Predicate"u8); + writer.WriteStringValue(Predicate.ToString()); + writer.WritePropertyName("Comparand"u8); + writer.WriteStringValue(Comparand); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FilterInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FilterInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFilterInfo(document.RootElement, options); + } + + internal static FilterInfo DeserializeFilterInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fieldName = default; + PredicateType predicate = default; + string comparand = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("FieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("Predicate"u8)) + { + predicate = new PredicateType(property.Value.GetString()); + continue; + } + if (property.NameEquals("Comparand"u8)) + { + comparand = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FilterInfo(fieldName, predicate, comparand, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(FilterInfo)} does not support writing '{options.Format}' format."); + } + } + + FilterInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFilterInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FilterInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FilterInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFilterInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.cs new file mode 100644 index 000000000000..227a405ba0cb --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/FilterInfo.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// A filter set on UX. + public partial class FilterInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// dimension name of the filter. + /// Operator of the filter. + /// Comparand of the filter. + /// or is null. + internal FilterInfo(string fieldName, PredicateType predicate, string comparand) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + Argument.AssertNotNull(comparand, nameof(comparand)); + + FieldName = fieldName; + Predicate = predicate; + Comparand = comparand; + } + + /// Initializes a new instance of . + /// dimension name of the filter. + /// Operator of the filter. + /// Comparand of the filter. + /// Keeps track of any properties unknown to the library. + internal FilterInfo(string fieldName, PredicateType predicate, string comparand, IDictionary serializedAdditionalRawData) + { + FieldName = fieldName; + Predicate = predicate; + Comparand = comparand; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FilterInfo() + { + } + + /// dimension name of the filter. + public string FieldName { get; } + /// Operator of the filter. + public PredicateType Predicate { get; } + /// Comparand of the filter. + public string Comparand { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Argument.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..fd93d797ccdf --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace LiveMetrics +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..adba2e33ac67 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace LiveMetrics +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..d80288a80595 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace LiveMetrics +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..6cf4d19929e5 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace LiveMetrics +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Optional.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..eeab5e028d1a --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace LiveMetrics +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/RequestContentHelper.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/RequestContentHelper.cs new file mode 100644 index 000000000000..47773ff2f03c --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/RequestContentHelper.cs @@ -0,0 +1,136 @@ +// 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 Azure.Core; + +namespace LiveMetrics +{ + internal static class RequestContentHelper + { + public static RequestContent FromEnumerable(IEnumerable enumerable) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(IEnumerable enumerable) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + if (item == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item); +#else + using (JsonDocument document = JsonDocument.Parse(item, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + for (int i = 0; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + where TValue : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + content.JsonWriter.WriteObjectValue(item.Value, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + if (item.Value == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromObject(object value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(value, ModelSerializationExtensions.WireOptions); + return content; + } + + public static RequestContent FromObject(BinaryData value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(value); +#else + using (JsonDocument document = JsonDocument.Parse(value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..0d748623b16d --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace LiveMetrics +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.Serialization.cs new file mode 100644 index 000000000000..2af6be86ea3a --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class KeyValuePairStringString : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyValuePairStringString)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + KeyValuePairStringString IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyValuePairStringString)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyValuePairStringString(document.RootElement, options); + } + + internal static KeyValuePairStringString DeserializeKeyValuePairStringString(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeyValuePairStringString(key, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(KeyValuePairStringString)} does not support writing '{options.Format}' format."); + } + } + + KeyValuePairStringString IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeyValuePairStringString(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeyValuePairStringString)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static KeyValuePairStringString FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeKeyValuePairStringString(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.cs new file mode 100644 index 000000000000..ebe35b0f0370 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/KeyValuePairStringString.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Key-value pair of string and string. + public partial class KeyValuePairStringString + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Key of the key-value pair. + /// Value of the key-value pair. + /// or is null. + public KeyValuePairStringString(string key, string value) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + } + + /// Initializes a new instance of . + /// Key of the key-value pair. + /// Value of the key-value pair. + /// Keeps track of any properties unknown to the library. + internal KeyValuePairStringString(string key, string value, IDictionary serializedAdditionalRawData) + { + Key = key; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal KeyValuePairStringString() + { + } + + /// Key of the key-value pair. + public string Key { get; } + /// Value of the key-value pair. + public string Value { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClient.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClient.cs new file mode 100644 index 000000000000..48b465ab2013 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClient.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace LiveMetrics +{ + // Data plane generated client. + /// Live Metrics REST APIs. + public partial class LiveMetricsClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://monitor.azure.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of LiveMetricsClient for mocking. + protected LiveMetricsClient() + { + } + + /// Initializes a new instance of LiveMetricsClient. + /// A credential used to authenticate to an Azure Service. + /// is null. + public LiveMetricsClient(TokenCredential credential) : this(new Uri("https://global.livediagnostics.monitor.azure.com"), credential, new LiveMetricsClientOptions()) + { + } + + /// Initializes a new instance of LiveMetricsClient. + /// The endpoint of the Live Metrics service. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public LiveMetricsClient(Uri endpoint, TokenCredential credential, LiveMetricsClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new LiveMetricsClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Determine whether there is any subscription to the metrics and documents. + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// Data contract between Application Insights client SDK and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Computer name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Service instance name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Identifies an Application Insights SDK as trusted agent to report metrics and documents. + /// Cloud role name of the service. + /// Version/generation of the data contract (MonitoringDataPoint) between the client and Live Metrics. + /// An encoded string that indicates whether the collection configuration is changed. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> IsSubscribedAsync(string ikey, MonitoringDataPoint monitoringDataPoint = null, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, ETag? configurationEtag = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using RequestContent content = monitoringDataPoint?.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await IsSubscribedAsync(ikey, content, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, context).ConfigureAwait(false); + return Response.FromValue(CollectionConfigurationInfo.FromResponse(response), response); + } + + /// Determine whether there is any subscription to the metrics and documents. + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// Data contract between Application Insights client SDK and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Computer name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Service instance name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Identifies an Application Insights SDK as trusted agent to report metrics and documents. + /// Cloud role name of the service. + /// Version/generation of the data contract (MonitoringDataPoint) between the client and Live Metrics. + /// An encoded string that indicates whether the collection configuration is changed. + /// The cancellation token to use. + /// is null. + /// + public virtual Response IsSubscribed(string ikey, MonitoringDataPoint monitoringDataPoint = null, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, ETag? configurationEtag = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using RequestContent content = monitoringDataPoint?.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = IsSubscribed(ikey, content, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, context); + return Response.FromValue(CollectionConfigurationInfo.FromResponse(response), response); + } + + /// + /// [Protocol Method] Determine whether there is any subscription to the metrics and documents. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// The content to send as the body of the request. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Computer name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Service instance name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Identifies an Application Insights SDK as trusted agent to report metrics and documents. + /// Cloud role name of the service. + /// Version/generation of the data contract (MonitoringDataPoint) between the client and Live Metrics. + /// An encoded string that indicates whether the collection configuration is changed. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task IsSubscribedAsync(string ikey, RequestContent content, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, ETag? configurationEtag = null, RequestContext context = null) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using var scope = ClientDiagnostics.CreateScope("LiveMetricsClient.IsSubscribed"); + scope.Start(); + try + { + using HttpMessage message = CreateIsSubscribedRequest(ikey, content, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (System.Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Determine whether there is any subscription to the metrics and documents. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// The content to send as the body of the request. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Computer name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Service instance name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Identifies an Application Insights SDK as trusted agent to report metrics and documents. + /// Cloud role name of the service. + /// Version/generation of the data contract (MonitoringDataPoint) between the client and Live Metrics. + /// An encoded string that indicates whether the collection configuration is changed. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response IsSubscribed(string ikey, RequestContent content, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, ETag? configurationEtag = null, RequestContext context = null) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using var scope = ClientDiagnostics.CreateScope("LiveMetricsClient.IsSubscribed"); + scope.Start(); + try + { + using HttpMessage message = CreateIsSubscribedRequest(ikey, content, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, context); + return _pipeline.ProcessMessage(message, context); + } + catch (System.Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// Data contract between the client and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// An encoded string that indicates whether the collection configuration is changed. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> PublishAsync(string ikey, IEnumerable monitoringDataPoints = null, ETag? configurationEtag = null, long? transmissionTime = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using RequestContent content = monitoringDataPoints != null ? RequestContentHelper.FromEnumerable(monitoringDataPoints) : null; + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await PublishAsync(ikey, content, configurationEtag, transmissionTime, context).ConfigureAwait(false); + return Response.FromValue(CollectionConfigurationInfo.FromResponse(response), response); + } + + /// Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// Data contract between the client and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// An encoded string that indicates whether the collection configuration is changed. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// The cancellation token to use. + /// is null. + /// + public virtual Response Publish(string ikey, IEnumerable monitoringDataPoints = null, ETag? configurationEtag = null, long? transmissionTime = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using RequestContent content = monitoringDataPoints != null ? RequestContentHelper.FromEnumerable(monitoringDataPoints) : null; + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Publish(ikey, content, configurationEtag, transmissionTime, context); + return Response.FromValue(CollectionConfigurationInfo.FromResponse(response), response); + } + + /// + /// [Protocol Method] Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// The content to send as the body of the request. + /// An encoded string that indicates whether the collection configuration is changed. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task PublishAsync(string ikey, RequestContent content, ETag? configurationEtag = null, long? transmissionTime = null, RequestContext context = null) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using var scope = ClientDiagnostics.CreateScope("LiveMetricsClient.Publish"); + scope.Start(); + try + { + using HttpMessage message = CreatePublishRequest(ikey, content, configurationEtag, transmissionTime, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (System.Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// The content to send as the body of the request. + /// An encoded string that indicates whether the collection configuration is changed. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Publish(string ikey, RequestContent content, ETag? configurationEtag = null, long? transmissionTime = null, RequestContext context = null) + { + Argument.AssertNotNull(ikey, nameof(ikey)); + + using var scope = ClientDiagnostics.CreateScope("LiveMetricsClient.Publish"); + scope.Start(); + try + { + using HttpMessage message = CreatePublishRequest(ikey, content, configurationEtag, transmissionTime, context); + return _pipeline.ProcessMessage(message, context); + } + catch (System.Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateIsSubscribedRequest(string ikey, RequestContent content, long? transmissionTime, string machineName, string instanceName, string streamId, string roleName, string invariantVersion, ETag? configurationEtag, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/QuickPulseService.svc/ping", false); + uri.AppendQuery("ikey", ikey, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (transmissionTime != null) + { + request.Headers.Add("x-ms-qps-transmission-time", transmissionTime.Value); + } + if (machineName != null) + { + request.Headers.Add("x-ms-qps-machine-name", machineName); + } + if (instanceName != null) + { + request.Headers.Add("x-ms-qps-instance-name", instanceName); + } + if (streamId != null) + { + request.Headers.Add("x-ms-qps-stream-id", streamId); + } + if (roleName != null) + { + request.Headers.Add("x-ms-qps-role-name", roleName); + } + if (invariantVersion != null) + { + request.Headers.Add("x-ms-qps-invariant-version", invariantVersion); + } + if (configurationEtag != null) + { + request.Headers.Add("x-ms-qps-configuration-etag", configurationEtag.Value); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreatePublishRequest(string ikey, RequestContent content, ETag? configurationEtag, long? transmissionTime, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/QuickPulseService.svc/post", false); + uri.AppendQuery("ikey", ikey, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (configurationEtag != null) + { + request.Headers.Add("x-ms-qps-configuration-etag", configurationEtag.Value); + } + if (transmissionTime != null) + { + request.Headers.Add("x-ms-qps-transmission-time", transmissionTime.Value); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientBuilderExtensions.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientBuilderExtensions.cs new file mode 100644 index 000000000000..8ecb9e953fd2 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; +using LiveMetrics; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class LiveMetricsClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The endpoint of the Live Metrics service. + public static IAzureClientBuilder AddLiveMetricsClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new LiveMetricsClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddLiveMetricsClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientOptions.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientOptions.cs new file mode 100644 index 000000000000..570f16b4a1b1 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace LiveMetrics +{ + /// Client options for LiveMetricsClient. + public partial class LiveMetricsClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_04_01_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-04-01-preview". + V2024_04_01_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of LiveMetricsClientOptions. + public LiveMetricsClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_04_01_Preview => "2024-04-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsModelFactory.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsModelFactory.cs new file mode 100644 index 000000000000..512a865451bb --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/LiveMetricsModelFactory.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace LiveMetrics +{ + /// Model factory for models. + public static partial class LiveMetricsModelFactory + { + /// Initializes a new instance of . + /// Application Insights SDK version. + /// Version/generation of the data contract (MonitoringDataPoint) between SDK and Live Metrics. + /// Service instance name where Application Insights SDK lives. + /// Service role name. + /// Computer name where Application Insights SDK lives. + /// Identifies an Application Insights SDK as a trusted agent to report metrics and documents. + /// Data point generation timestamp. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. + /// True if the current application is an Azure Web App. + /// True if performance counters collection is supported. + /// An array of metric data points. + /// + /// An array of documents of a specific type {Request}, {RemoteDependency}, {Exception}, {Event}, or {Trace} + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// An array of top cpu consumption data point. + /// An array of error while SDK parses and applies the {CollectionConfigurationInfo} provided by Live Metrics. + /// A new instance for mocking. + public static MonitoringDataPoint MonitoringDataPoint(string version = null, int invariantVersion = default, string instance = null, string roleName = null, string machineName = null, string streamId = null, DateTimeOffset? timestamp = null, DateTimeOffset? transmissionTime = null, bool isWebApp = default, bool performanceCollectionSupported = default, IEnumerable metrics = null, IEnumerable documents = null, IEnumerable topCpuProcesses = null, IEnumerable collectionConfigurationErrors = null) + { + metrics ??= new List(); + documents ??= new List(); + topCpuProcesses ??= new List(); + collectionConfigurationErrors ??= new List(); + + return new MonitoringDataPoint( + version, + invariantVersion, + instance, + roleName, + machineName, + streamId, + timestamp, + transmissionTime, + isWebApp, + performanceCollectionSupported, + metrics?.ToList(), + documents?.ToList(), + topCpuProcesses?.ToList(), + collectionConfigurationErrors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// An encoded string that indicates whether the collection configuration is changed. + /// An array of metric configuration info. + /// An array of document stream configuration info. + /// Controls document quotas to be sent to Live Metrics. + /// A new instance for mocking. + public static CollectionConfigurationInfo CollectionConfigurationInfo(string eTag = null, IEnumerable metrics = null, IEnumerable documentStreams = null, QuotaConfigurationInfo quotaInfo = null) + { + metrics ??= new List(); + documentStreams ??= new List(); + + return new CollectionConfigurationInfo(eTag, metrics?.ToList(), documentStreams?.ToList(), quotaInfo, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// metric configuration identifier. + /// Telemetry type. + /// A collection of filters to scope metrics that UX needs. + /// Telemetry's metric dimension whose value is to be aggregated. Example values: Duration, Count(),... + /// Aggregation type. This is the aggregation done from everything within a single server. + /// Aggregation type. This Aggregation is done across the values for all the servers taken together. + /// A new instance for mocking. + public static DerivedMetricInfo DerivedMetricInfo(string id = null, string telemetryType = null, IEnumerable filterGroups = null, string projection = null, AggregationType aggregation = default, AggregationType backEndAggregation = default) + { + filterGroups ??= new List(); + + return new DerivedMetricInfo( + id, + telemetryType, + filterGroups?.ToList(), + projection, + aggregation, + backEndAggregation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// An array of filters. + /// A new instance for mocking. + public static FilterConjunctionGroupInfo FilterConjunctionGroupInfo(IEnumerable filters = null) + { + filters ??= new List(); + + return new FilterConjunctionGroupInfo(filters?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// dimension name of the filter. + /// Operator of the filter. + /// Comparand of the filter. + /// A new instance for mocking. + public static FilterInfo FilterInfo(string fieldName = null, PredicateType predicate = default, string comparand = null) + { + return new FilterInfo(fieldName, predicate, comparand, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Identifier of the document stream initiated by a UX. + /// Gets or sets an OR-connected collection of filter groups. + /// A new instance for mocking. + public static DocumentStreamInfo DocumentStreamInfo(string id = null, IEnumerable documentFilterGroups = null) + { + documentFilterGroups ??= new List(); + + return new DocumentStreamInfo(id, documentFilterGroups?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Telemetry type. + /// An array of filter groups. + /// A new instance for mocking. + public static DocumentFilterConjunctionGroupInfo DocumentFilterConjunctionGroupInfo(TelemetryType telemetryType = default, FilterConjunctionGroupInfo filters = null) + { + return new DocumentFilterConjunctionGroupInfo(telemetryType, filters, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Initial quota. + /// Max quota. + /// Quota accrual rate per second. + /// A new instance for mocking. + public static QuotaConfigurationInfo QuotaConfigurationInfo(float? initialQuota = null, float maxQuota = default, float quotaAccrualRatePerSec = default) + { + return new QuotaConfigurationInfo(initialQuota, maxQuota, quotaAccrualRatePerSec, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.Serialization.cs new file mode 100644 index 000000000000..48641f66b37c --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class MetricPoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MetricPoint)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("Value"u8); + writer.WriteNumberValue(Value); + writer.WritePropertyName("Weight"u8); + writer.WriteNumberValue(Weight); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MetricPoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MetricPoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMetricPoint(document.RootElement, options); + } + + internal static MetricPoint DeserializeMetricPoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + double value = default; + int weight = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("Value"u8)) + { + value = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("Weight"u8)) + { + weight = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MetricPoint(name, value, weight, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(MetricPoint)} does not support writing '{options.Format}' format."); + } + } + + MetricPoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMetricPoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MetricPoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MetricPoint FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMetricPoint(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.cs new file mode 100644 index 000000000000..8c523231a237 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/MetricPoint.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Metric data point. + public partial class MetricPoint + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Metric name. + /// Metric value. + /// Metric weight. + /// is null. + public MetricPoint(string name, double value, int weight) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Value = value; + Weight = weight; + } + + /// Initializes a new instance of . + /// Metric name. + /// Metric value. + /// Metric weight. + /// Keeps track of any properties unknown to the library. + internal MetricPoint(string name, double value, int weight, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + Weight = weight; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MetricPoint() + { + } + + /// Metric name. + public string Name { get; } + /// Metric value. + public double Value { get; } + /// Metric weight. + public int Weight { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Models/LiveMetricsContext.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Models/LiveMetricsContext.cs new file mode 100644 index 000000000000..2fb8ce7f4bfd --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Models/LiveMetricsContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace LiveMetrics +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// + public partial class LiveMetricsContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.Serialization.cs new file mode 100644 index 000000000000..92cf90af8992 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.Serialization.cs @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class MonitoringDataPoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoringDataPoint)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); + writer.WritePropertyName("InvariantVersion"u8); + writer.WriteNumberValue(InvariantVersion); + writer.WritePropertyName("Instance"u8); + writer.WriteStringValue(Instance); + writer.WritePropertyName("RoleName"u8); + writer.WriteStringValue(RoleName); + writer.WritePropertyName("MachineName"u8); + writer.WriteStringValue(MachineName); + writer.WritePropertyName("StreamId"u8); + writer.WriteStringValue(StreamId); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("Timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (Optional.IsDefined(TransmissionTime)) + { + writer.WritePropertyName("TransmissionTime"u8); + writer.WriteStringValue(TransmissionTime.Value, "O"); + } + writer.WritePropertyName("IsWebApp"u8); + writer.WriteBooleanValue(IsWebApp); + writer.WritePropertyName("PerformanceCollectionSupported"u8); + writer.WriteBooleanValue(PerformanceCollectionSupported); + if (Optional.IsCollectionDefined(Metrics)) + { + writer.WritePropertyName("Metrics"u8); + writer.WriteStartArray(); + foreach (var item in Metrics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("Documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TopCpuProcesses)) + { + writer.WritePropertyName("TopCpuProcesses"u8); + writer.WriteStartArray(); + foreach (var item in TopCpuProcesses) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CollectionConfigurationErrors)) + { + writer.WritePropertyName("CollectionConfigurationErrors"u8); + writer.WriteStartArray(); + foreach (var item in CollectionConfigurationErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MonitoringDataPoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitoringDataPoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitoringDataPoint(document.RootElement, options); + } + + internal static MonitoringDataPoint DeserializeMonitoringDataPoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + int invariantVersion = default; + string instance = default; + string roleName = default; + string machineName = default; + string streamId = default; + DateTimeOffset? timestamp = default; + DateTimeOffset? transmissionTime = default; + bool isWebApp = default; + bool performanceCollectionSupported = default; + IList metrics = default; + IList documents = default; + IList topCpuProcesses = default; + IList collectionConfigurationErrors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("InvariantVersion"u8)) + { + invariantVersion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("Instance"u8)) + { + instance = property.Value.GetString(); + continue; + } + if (property.NameEquals("RoleName"u8)) + { + roleName = property.Value.GetString(); + continue; + } + if (property.NameEquals("MachineName"u8)) + { + machineName = property.Value.GetString(); + continue; + } + if (property.NameEquals("StreamId"u8)) + { + streamId = property.Value.GetString(); + continue; + } + if (property.NameEquals("Timestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("TransmissionTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transmissionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("IsWebApp"u8)) + { + isWebApp = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("PerformanceCollectionSupported"u8)) + { + performanceCollectionSupported = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("Metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MetricPoint.DeserializeMetricPoint(item, options)); + } + metrics = array; + continue; + } + if (property.NameEquals("Documents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentIngress.DeserializeDocumentIngress(item, options)); + } + documents = array; + continue; + } + if (property.NameEquals("TopCpuProcesses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProcessCpuData.DeserializeProcessCpuData(item, options)); + } + topCpuProcesses = array; + continue; + } + if (property.NameEquals("CollectionConfigurationErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CollectionConfigurationError.DeserializeCollectionConfigurationError(item, options)); + } + collectionConfigurationErrors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitoringDataPoint( + version, + invariantVersion, + instance, + roleName, + machineName, + streamId, + timestamp, + transmissionTime, + isWebApp, + performanceCollectionSupported, + metrics ?? new ChangeTrackingList(), + documents ?? new ChangeTrackingList(), + topCpuProcesses ?? new ChangeTrackingList(), + collectionConfigurationErrors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(MonitoringDataPoint)} does not support writing '{options.Format}' format."); + } + } + + MonitoringDataPoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMonitoringDataPoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitoringDataPoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static MonitoringDataPoint FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMonitoringDataPoint(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.cs new file mode 100644 index 000000000000..5198042c9af1 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/MonitoringDataPoint.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Monitoring data point coming from the client, which includes metrics, documents and other metadata info. + public partial class MonitoringDataPoint + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Application Insights SDK version. + /// Version/generation of the data contract (MonitoringDataPoint) between SDK and Live Metrics. + /// Service instance name where Application Insights SDK lives. + /// Service role name. + /// Computer name where Application Insights SDK lives. + /// Identifies an Application Insights SDK as a trusted agent to report metrics and documents. + /// True if the current application is an Azure Web App. + /// True if performance counters collection is supported. + /// , , , or is null. + public MonitoringDataPoint(string version, int invariantVersion, string instance, string roleName, string machineName, string streamId, bool isWebApp, bool performanceCollectionSupported) + { + Argument.AssertNotNull(version, nameof(version)); + Argument.AssertNotNull(instance, nameof(instance)); + Argument.AssertNotNull(roleName, nameof(roleName)); + Argument.AssertNotNull(machineName, nameof(machineName)); + Argument.AssertNotNull(streamId, nameof(streamId)); + + Version = version; + InvariantVersion = invariantVersion; + Instance = instance; + RoleName = roleName; + MachineName = machineName; + StreamId = streamId; + IsWebApp = isWebApp; + PerformanceCollectionSupported = performanceCollectionSupported; + Metrics = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + TopCpuProcesses = new ChangeTrackingList(); + CollectionConfigurationErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Application Insights SDK version. + /// Version/generation of the data contract (MonitoringDataPoint) between SDK and Live Metrics. + /// Service instance name where Application Insights SDK lives. + /// Service role name. + /// Computer name where Application Insights SDK lives. + /// Identifies an Application Insights SDK as a trusted agent to report metrics and documents. + /// Data point generation timestamp. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. + /// True if the current application is an Azure Web App. + /// True if performance counters collection is supported. + /// An array of metric data points. + /// + /// An array of documents of a specific type {Request}, {RemoteDependency}, {Exception}, {Event}, or {Trace} + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// An array of top cpu consumption data point. + /// An array of error while SDK parses and applies the {CollectionConfigurationInfo} provided by Live Metrics. + /// Keeps track of any properties unknown to the library. + internal MonitoringDataPoint(string version, int invariantVersion, string instance, string roleName, string machineName, string streamId, DateTimeOffset? timestamp, DateTimeOffset? transmissionTime, bool isWebApp, bool performanceCollectionSupported, IList metrics, IList documents, IList topCpuProcesses, IList collectionConfigurationErrors, IDictionary serializedAdditionalRawData) + { + Version = version; + InvariantVersion = invariantVersion; + Instance = instance; + RoleName = roleName; + MachineName = machineName; + StreamId = streamId; + Timestamp = timestamp; + TransmissionTime = transmissionTime; + IsWebApp = isWebApp; + PerformanceCollectionSupported = performanceCollectionSupported; + Metrics = metrics; + Documents = documents; + TopCpuProcesses = topCpuProcesses; + CollectionConfigurationErrors = collectionConfigurationErrors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitoringDataPoint() + { + } + + /// Application Insights SDK version. + public string Version { get; } + /// Version/generation of the data contract (MonitoringDataPoint) between SDK and Live Metrics. + public int InvariantVersion { get; } + /// Service instance name where Application Insights SDK lives. + public string Instance { get; } + /// Service role name. + public string RoleName { get; } + /// Computer name where Application Insights SDK lives. + public string MachineName { get; } + /// Identifies an Application Insights SDK as a trusted agent to report metrics and documents. + public string StreamId { get; } + /// Data point generation timestamp. + public DateTimeOffset? Timestamp { get; set; } + /// Timestamp when the client transmits the metrics and documents to Live Metrics. + public DateTimeOffset? TransmissionTime { get; set; } + /// True if the current application is an Azure Web App. + public bool IsWebApp { get; } + /// True if performance counters collection is supported. + public bool PerformanceCollectionSupported { get; } + /// An array of metric data points. + public IList Metrics { get; } + /// + /// An array of documents of a specific type {Request}, {RemoteDependency}, {Exception}, {Event}, or {Trace} + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public IList Documents { get; } + /// An array of top cpu consumption data point. + public IList TopCpuProcesses { get; } + /// An array of error while SDK parses and applies the {CollectionConfigurationInfo} provided by Live Metrics. + public IList CollectionConfigurationErrors { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/PredicateType.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/PredicateType.cs new file mode 100644 index 000000000000..1804309fc4e3 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/PredicateType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace LiveMetrics +{ + /// Enum representing the different types of predicates. + public readonly partial struct PredicateType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PredicateType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EqualValue = "Equal"; + private const string NotEqualValue = "NotEqual"; + private const string LessThanValue = "LessThan"; + private const string GreaterThanValue = "GreaterThan"; + private const string LessThanOrEqualValue = "LessThanOrEqual"; + private const string GreaterThanOrEqualValue = "GreaterThanOrEqual"; + private const string ContainsValue = "Contains"; + private const string DoesNotContainValue = "DoesNotContain"; + + /// Represents an equality predicate. + public static PredicateType Equal { get; } = new PredicateType(EqualValue); + /// Represents a not-equal predicate. + public static PredicateType NotEqual { get; } = new PredicateType(NotEqualValue); + /// Represents a less-than predicate. + public static PredicateType LessThan { get; } = new PredicateType(LessThanValue); + /// Represents a greater-than predicate. + public static PredicateType GreaterThan { get; } = new PredicateType(GreaterThanValue); + /// Represents a less-than-or-equal predicate. + public static PredicateType LessThanOrEqual { get; } = new PredicateType(LessThanOrEqualValue); + /// Represents a greater-than-or-equal predicate. + public static PredicateType GreaterThanOrEqual { get; } = new PredicateType(GreaterThanOrEqualValue); + /// Represents a contains predicate. + public static PredicateType Contains { get; } = new PredicateType(ContainsValue); + /// Represents a does-not-contain predicate. + public static PredicateType DoesNotContain { get; } = new PredicateType(DoesNotContainValue); + /// Determines if two values are the same. + public static bool operator ==(PredicateType left, PredicateType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PredicateType left, PredicateType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PredicateType(string value) => new PredicateType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PredicateType other && Equals(other); + /// + public bool Equals(PredicateType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.Serialization.cs new file mode 100644 index 000000000000..f4be0d94654a --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class ProcessCpuData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcessCpuData)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ProcessName"u8); + writer.WriteStringValue(ProcessName); + writer.WritePropertyName("CpuPercentage"u8); + writer.WriteNumberValue(CpuPercentage); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProcessCpuData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProcessCpuData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProcessCpuData(document.RootElement, options); + } + + internal static ProcessCpuData DeserializeProcessCpuData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string processName = default; + int cpuPercentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ProcessName"u8)) + { + processName = property.Value.GetString(); + continue; + } + if (property.NameEquals("CpuPercentage"u8)) + { + cpuPercentage = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProcessCpuData(processName, cpuPercentage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(ProcessCpuData)} does not support writing '{options.Format}' format."); + } + } + + ProcessCpuData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProcessCpuData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProcessCpuData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ProcessCpuData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProcessCpuData(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.cs new file mode 100644 index 000000000000..c4f1d9457d5e --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/ProcessCpuData.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// CPU consumption datapoint. + public partial class ProcessCpuData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Process name. + /// CPU consumption percentage. + /// is null. + public ProcessCpuData(string processName, int cpuPercentage) + { + Argument.AssertNotNull(processName, nameof(processName)); + + ProcessName = processName; + CpuPercentage = cpuPercentage; + } + + /// Initializes a new instance of . + /// Process name. + /// CPU consumption percentage. + /// Keeps track of any properties unknown to the library. + internal ProcessCpuData(string processName, int cpuPercentage, IDictionary serializedAdditionalRawData) + { + ProcessName = processName; + CpuPercentage = cpuPercentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProcessCpuData() + { + } + + /// Process name. + public string ProcessName { get; } + /// CPU consumption percentage. + public int CpuPercentage { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.Serialization.cs new file mode 100644 index 000000000000..0d25d516f280 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class QuotaConfigurationInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuotaConfigurationInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(InitialQuota)) + { + writer.WritePropertyName("InitialQuota"u8); + writer.WriteNumberValue(InitialQuota.Value); + } + writer.WritePropertyName("MaxQuota"u8); + writer.WriteNumberValue(MaxQuota); + writer.WritePropertyName("QuotaAccrualRatePerSec"u8); + writer.WriteNumberValue(QuotaAccrualRatePerSec); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + QuotaConfigurationInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(QuotaConfigurationInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeQuotaConfigurationInfo(document.RootElement, options); + } + + internal static QuotaConfigurationInfo DeserializeQuotaConfigurationInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? initialQuota = default; + float maxQuota = default; + float quotaAccrualRatePerSec = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("InitialQuota"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialQuota = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("MaxQuota"u8)) + { + maxQuota = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("QuotaAccrualRatePerSec"u8)) + { + quotaAccrualRatePerSec = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new QuotaConfigurationInfo(initialQuota, maxQuota, quotaAccrualRatePerSec, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(QuotaConfigurationInfo)} does not support writing '{options.Format}' format."); + } + } + + QuotaConfigurationInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQuotaConfigurationInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(QuotaConfigurationInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static QuotaConfigurationInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeQuotaConfigurationInfo(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.cs new file mode 100644 index 000000000000..3c09c73551fb --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/QuotaConfigurationInfo.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Controls document quotas to be sent to Live Metrics. + public partial class QuotaConfigurationInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Max quota. + /// Quota accrual rate per second. + internal QuotaConfigurationInfo(float maxQuota, float quotaAccrualRatePerSec) + { + MaxQuota = maxQuota; + QuotaAccrualRatePerSec = quotaAccrualRatePerSec; + } + + /// Initializes a new instance of . + /// Initial quota. + /// Max quota. + /// Quota accrual rate per second. + /// Keeps track of any properties unknown to the library. + internal QuotaConfigurationInfo(float? initialQuota, float maxQuota, float quotaAccrualRatePerSec, IDictionary serializedAdditionalRawData) + { + InitialQuota = initialQuota; + MaxQuota = maxQuota; + QuotaAccrualRatePerSec = quotaAccrualRatePerSec; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal QuotaConfigurationInfo() + { + } + + /// Initial quota. + public float? InitialQuota { get; } + /// Max quota. + public float MaxQuota { get; } + /// Quota accrual rate per second. + public float QuotaAccrualRatePerSec { get; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.Serialization.cs new file mode 100644 index 000000000000..4915cce8b211 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class RemoteDependency : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemoteDependency)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(CommandName)) + { + writer.WritePropertyName("CommandName"u8); + writer.WriteStringValue(CommandName); + } + if (Optional.IsDefined(ResultCode)) + { + writer.WritePropertyName("ResultCode"u8); + writer.WriteStringValue(ResultCode); + } + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("Duration"u8); + writer.WriteStringValue(Duration); + } + } + + RemoteDependency IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemoteDependency)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemoteDependency(document.RootElement, options); + } + + internal static RemoteDependency DeserializeRemoteDependency(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string commandName = default; + string resultCode = default; + string duration = default; + DocumentType documentType = default; + IList documentStreamIds = default; + IList properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("CommandName"u8)) + { + commandName = property.Value.GetString(); + continue; + } + if (property.NameEquals("ResultCode"u8)) + { + resultCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("Duration"u8)) + { + duration = property.Value.GetString(); + continue; + } + if (property.NameEquals("DocumentType"u8)) + { + documentType = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("DocumentStreamIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + documentStreamIds = array; + continue; + } + if (property.NameEquals("Properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringString.DeserializeKeyValuePairStringString(item, options)); + } + properties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemoteDependency( + documentType, + documentStreamIds ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingList(), + serializedAdditionalRawData, + name, + commandName, + resultCode, + duration); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(RemoteDependency)} does not support writing '{options.Format}' format."); + } + } + + RemoteDependency IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRemoteDependency(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemoteDependency)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new RemoteDependency FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRemoteDependency(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.cs new file mode 100644 index 000000000000..6cab0e3ad447 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/RemoteDependency.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// RemoteDependency document type. + public partial class RemoteDependency : DocumentIngress + { + /// Initializes a new instance of . + public RemoteDependency() + { + DocumentType = DocumentType.RemoteDependency; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Keeps track of any properties unknown to the library. + /// Name of the command initiated with this dependency call, e.g., GET /username. + /// URL of the dependency call to the target, with all query string parameters. + /// Result code of a dependency call. Examples are SQL error code and HTTP status code. + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + internal RemoteDependency(DocumentType documentType, IList documentStreamIds, IList properties, IDictionary serializedAdditionalRawData, string name, string commandName, string resultCode, string duration) : base(documentType, documentStreamIds, properties, serializedAdditionalRawData) + { + Name = name; + CommandName = commandName; + ResultCode = resultCode; + Duration = duration; + } + + /// Name of the command initiated with this dependency call, e.g., GET /username. + public string Name { get; set; } + /// URL of the dependency call to the target, with all query string parameters. + public string CommandName { get; set; } + /// Result code of a dependency call. Examples are SQL error code and HTTP status code. + public string ResultCode { get; set; } + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + public string Duration { get; set; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Request.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Request.Serialization.cs new file mode 100644 index 000000000000..113169b6b92b --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Request.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class Request : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Request)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("Url"u8); + writer.WriteStringValue(Url.AbsoluteUri); + } + if (Optional.IsDefined(ResponseCode)) + { + writer.WritePropertyName("ResponseCode"u8); + writer.WriteStringValue(ResponseCode); + } + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("Duration"u8); + writer.WriteStringValue(Duration); + } + } + + Request IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Request)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRequest(document.RootElement, options); + } + + internal static Request DeserializeRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + Uri url = default; + string responseCode = default; + string duration = default; + DocumentType documentType = default; + IList documentStreamIds = default; + IList properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("Url"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("ResponseCode"u8)) + { + responseCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("Duration"u8)) + { + duration = property.Value.GetString(); + continue; + } + if (property.NameEquals("DocumentType"u8)) + { + documentType = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("DocumentStreamIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + documentStreamIds = array; + continue; + } + if (property.NameEquals("Properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringString.DeserializeKeyValuePairStringString(item, options)); + } + properties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Request( + documentType, + documentStreamIds ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingList(), + serializedAdditionalRawData, + name, + url, + responseCode, + duration); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(Request)} does not support writing '{options.Format}' format."); + } + } + + Request IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Request)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Request FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRequest(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Request.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Request.cs new file mode 100644 index 000000000000..98ccc03686b9 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Request.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Request document type. + public partial class Request : DocumentIngress + { + /// Initializes a new instance of . + public Request() + { + DocumentType = DocumentType.Request; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Keeps track of any properties unknown to the library. + /// Name of the request, e.g., 'GET /values/{id}'. + /// Request URL with all query string parameters. + /// Result of a request execution. For http requests, it could be some HTTP status code. + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + internal Request(DocumentType documentType, IList documentStreamIds, IList properties, IDictionary serializedAdditionalRawData, string name, Uri url, string responseCode, string duration) : base(documentType, documentStreamIds, properties, serializedAdditionalRawData) + { + Name = name; + Url = url; + ResponseCode = responseCode; + Duration = duration; + } + + /// Name of the request, e.g., 'GET /values/{id}'. + public string Name { get; set; } + /// Request URL with all query string parameters. + public Uri Url { get; set; } + /// Result of a request execution. For http requests, it could be some HTTP status code. + public string ResponseCode { get; set; } + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + public string Duration { get; set; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/TelemetryType.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/TelemetryType.cs new file mode 100644 index 000000000000..9d35769389dc --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/TelemetryType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace LiveMetrics +{ + /// Telemetry type. + public readonly partial struct TelemetryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TelemetryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequestValue = "Request"; + private const string DependencyValue = "Dependency"; + private const string ExceptionValue = "Exception"; + private const string EventValue = "Event"; + private const string MetricValue = "Metric"; + private const string PerformanceCounterValue = "PerformanceCounter"; + private const string TraceValue = "Trace"; + + /// Represents a request telemetry type. + public static TelemetryType Request { get; } = new TelemetryType(RequestValue); + /// Represents a dependency telemetry type. + public static TelemetryType Dependency { get; } = new TelemetryType(DependencyValue); + /// Represents an exception telemetry type. + public static TelemetryType Exception { get; } = new TelemetryType(ExceptionValue); + /// Represents an event telemetry type. + public static TelemetryType Event { get; } = new TelemetryType(EventValue); + /// Represents a metric telemetry type. + public static TelemetryType Metric { get; } = new TelemetryType(MetricValue); + /// Represents a performance counter telemetry type. + public static TelemetryType PerformanceCounter { get; } = new TelemetryType(PerformanceCounterValue); + /// Represents a trace telemetry type. + public static TelemetryType Trace { get; } = new TelemetryType(TraceValue); + /// Determines if two values are the same. + public static bool operator ==(TelemetryType left, TelemetryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TelemetryType left, TelemetryType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TelemetryType(string value) => new TelemetryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TelemetryType other && Equals(other); + /// + public bool Equals(TelemetryType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Trace.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Trace.Serialization.cs new file mode 100644 index 000000000000..0bc168993ec8 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Trace.Serialization.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + public partial class Trace : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Trace)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("Message"u8); + writer.WriteStringValue(Message); + } + } + + Trace IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Trace)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTrace(document.RootElement, options); + } + + internal static Trace DeserializeTrace(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string message = default; + DocumentType documentType = default; + IList documentStreamIds = default; + IList properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("DocumentType"u8)) + { + documentType = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("DocumentStreamIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + documentStreamIds = array; + continue; + } + if (property.NameEquals("Properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringString.DeserializeKeyValuePairStringString(item, options)); + } + properties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Trace(documentType, documentStreamIds ?? new ChangeTrackingList(), properties ?? new ChangeTrackingList(), serializedAdditionalRawData, message); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(Trace)} does not support writing '{options.Format}' format."); + } + } + + Trace IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTrace(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Trace)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Trace FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTrace(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/Trace.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/Trace.cs new file mode 100644 index 000000000000..411e5ec67d06 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/Trace.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Trace document type. + public partial class Trace : DocumentIngress + { + /// Initializes a new instance of . + public Trace() + { + DocumentType = DocumentType.Trace; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Keeps track of any properties unknown to the library. + /// Trace message. + internal Trace(DocumentType documentType, IList documentStreamIds, IList properties, IDictionary serializedAdditionalRawData, string message) : base(documentType, documentStreamIds, properties, serializedAdditionalRawData) + { + Message = message; + } + + /// Trace message. + public string Message { get; set; } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.Serialization.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.Serialization.cs new file mode 100644 index 000000000000..d22bdebd6cbf --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace LiveMetrics +{ + internal partial class UnknownDocumentIngress : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentIngress)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DocumentIngress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DocumentIngress)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDocumentIngress(document.RootElement, options); + } + + internal static UnknownDocumentIngress DeserializeUnknownDocumentIngress(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DocumentType documentType = "AutoRest.CSharp.Output.Models.Types.EnumTypeValue"; + IList documentStreamIds = default; + IList properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("DocumentType"u8)) + { + documentType = new DocumentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("DocumentStreamIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + documentStreamIds = array; + continue; + } + if (property.NameEquals("Properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(KeyValuePairStringString.DeserializeKeyValuePairStringString(item, options)); + } + properties = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDocumentIngress(documentType, documentStreamIds ?? new ChangeTrackingList(), properties ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, LiveMetricsContext.Default); + default: + throw new FormatException($"The model {nameof(DocumentIngress)} does not support writing '{options.Format}' format."); + } + } + + DocumentIngress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDocumentIngress(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DocumentIngress)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownDocumentIngress FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUnknownDocumentIngress(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.cs b/sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.cs new file mode 100644 index 000000000000..6212f92f2bc6 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Generated/UnknownDocumentIngress.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace LiveMetrics +{ + /// Unknown version of DocumentIngress. + internal partial class UnknownDocumentIngress : DocumentIngress + { + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Keeps track of any properties unknown to the library. + internal UnknownDocumentIngress(DocumentType documentType, IList documentStreamIds, IList properties, IDictionary serializedAdditionalRawData) : base(documentType, documentStreamIds, properties, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownDocumentIngress() + { + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/src/LiveMetrics.csproj b/sdk/applicationinsights/LiveMetrics/src/LiveMetrics.csproj new file mode 100644 index 000000000000..17d89db02593 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/LiveMetrics.csproj @@ -0,0 +1,19 @@ + + + This is the LiveMetrics client library for developing .NET applications with rich experience. + Azure SDK Code Generation LiveMetrics for Azure Data Plane + 1.0.0-beta.1 + LiveMetrics + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/applicationinsights/LiveMetrics/src/Properties/AssemblyInfo.cs b/sdk/applicationinsights/LiveMetrics/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..f3bafe56f482 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/src/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("LiveMetrics.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/applicationinsights/LiveMetrics/tests/Generated/Samples/Samples_LiveMetricsClient.cs b/sdk/applicationinsights/LiveMetrics/tests/Generated/Samples/Samples_LiveMetricsClient.cs new file mode 100644 index 000000000000..94c8c0332502 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/tests/Generated/Samples/Samples_LiveMetricsClient.cs @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace LiveMetrics.Samples +{ + public partial class Samples_LiveMetricsClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_LiveMetrics_IsSubscribed_LiveMetricsClientChecksIfItsDataIsSubscribedTo() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + using RequestContent content = RequestContent.Create(new + { + Instance = "server-pc-name", + InvariantVersion = 5, + IsWebApp = false, + MachineName = "SERVER-PC-NAME", + PerformanceCollectionSupported = true, + RoleName = "", + StreamId = "41112328328b4edb9aa777aa6d675186", + Timestamp = "2024-02-01T21:36:32.5717105Z", + Version = "2.21.0-429", + }); + Response response = client.IsSubscribed("4473b98e-c70d-4220-b57c-2984c2a0e5cd", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ETag").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Projection").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Aggregation").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("BackEndAggregation").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_LiveMetrics_IsSubscribed_LiveMetricsClientChecksIfItsDataIsSubscribedTo_Async() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + using RequestContent content = RequestContent.Create(new + { + Instance = "server-pc-name", + InvariantVersion = 5, + IsWebApp = false, + MachineName = "SERVER-PC-NAME", + PerformanceCollectionSupported = true, + RoleName = "", + StreamId = "41112328328b4edb9aa777aa6d675186", + Timestamp = "2024-02-01T21:36:32.5717105Z", + Version = "2.21.0-429", + }); + Response response = await client.IsSubscribedAsync("4473b98e-c70d-4220-b57c-2984c2a0e5cd", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ETag").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Projection").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Aggregation").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("BackEndAggregation").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_LiveMetrics_IsSubscribed_LiveMetricsClientChecksIfItsDataIsSubscribedTo_Convenience() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + Response response = client.IsSubscribed("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_LiveMetrics_IsSubscribed_LiveMetricsClientChecksIfItsDataIsSubscribedTo_Convenience_Async() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + Response response = await client.IsSubscribedAsync("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_LiveMetrics_Publish_LiveMetricsClientPublishesLiveMetrics() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + using RequestContent content = RequestContent.Create(new object[] + { +new +{ +Instance = "server-pc-name", +Metrics = new object[] +{ +new +{ +Name = "\\ApplicationInsights\\Requests/Sec", +Value = 0.9989, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Request Duration", +Value = 2.266, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Requests Failed/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Requests Succeeded/Sec", +Value = 0.9989, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Calls/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Call Duration", +Value = 0, +Weight = 0, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Calls Failed/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Calls Succeeded/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Exceptions/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ASP.NET Applications(__Total__)\\Requests In Application Queue", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\Memory\\Committed Bytes", +Value = 19902644224, +Weight = 1, +}, +new +{ +Name = "\\Processor(_Total)\\% Processor Time", +Value = 54.738, +Weight = 1, +} +}, +Documents = new object[] +{ +new +{ +DocumentType = "Exception", +ExceptionMessage = "Value cannot be null.\r\nParameter name: This exception has properties", +ExceptionType = "System.ArgumentNullException", +Properties = new object[] +{ +new +{ +key = "UserProp2", +value = "UserPropValue2", +}, +new +{ +key = "DeveloperMode", +value = "true", +}, +new +{ +key = "UserProp1", +value = "UserPropValue1", +} +}, +}, +new +{ +DocumentType = "Request", +Duration = "PT0.0010105S", +Name = "GET Home/blablabla", +Properties = new object[] +{ +new +{ +key = "DeveloperMode", +value = "true", +} +}, +ResponseCode = "404", +Url = "http://40.78.109.134/Home/blablabla", +} +}, +Timestamp = "2024-02-01T21:36:30.5717105Z", +Version = "2.1.0.42", +InvariantVersion = 5, +IsWebApp = false, +MachineName = "SERVER-PC-NAME", +PerformanceCollectionSupported = true, +RoleName = "", +StreamId = "41112328328b4edb9aa777aa6d675186", +} + }); + Response response = client.Publish("4473b98e-c70d-4220-b57c-2984c2a0e5cd", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ETag").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Projection").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Aggregation").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("BackEndAggregation").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_LiveMetrics_Publish_LiveMetricsClientPublishesLiveMetrics_Async() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + using RequestContent content = RequestContent.Create(new object[] + { +new +{ +Instance = "server-pc-name", +Metrics = new object[] +{ +new +{ +Name = "\\ApplicationInsights\\Requests/Sec", +Value = 0.9989, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Request Duration", +Value = 2.266, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Requests Failed/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Requests Succeeded/Sec", +Value = 0.9989, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Calls/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Call Duration", +Value = 0, +Weight = 0, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Calls Failed/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Dependency Calls Succeeded/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ApplicationInsights\\Exceptions/Sec", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\ASP.NET Applications(__Total__)\\Requests In Application Queue", +Value = 0, +Weight = 1, +}, +new +{ +Name = "\\Memory\\Committed Bytes", +Value = 19902644224, +Weight = 1, +}, +new +{ +Name = "\\Processor(_Total)\\% Processor Time", +Value = 54.738, +Weight = 1, +} +}, +Documents = new object[] +{ +new +{ +DocumentType = "Exception", +ExceptionMessage = "Value cannot be null.\r\nParameter name: This exception has properties", +ExceptionType = "System.ArgumentNullException", +Properties = new object[] +{ +new +{ +key = "UserProp2", +value = "UserPropValue2", +}, +new +{ +key = "DeveloperMode", +value = "true", +}, +new +{ +key = "UserProp1", +value = "UserPropValue1", +} +}, +}, +new +{ +DocumentType = "Request", +Duration = "PT0.0010105S", +Name = "GET Home/blablabla", +Properties = new object[] +{ +new +{ +key = "DeveloperMode", +value = "true", +} +}, +ResponseCode = "404", +Url = "http://40.78.109.134/Home/blablabla", +} +}, +Timestamp = "2024-02-01T21:36:30.5717105Z", +Version = "2.1.0.42", +InvariantVersion = 5, +IsWebApp = false, +MachineName = "SERVER-PC-NAME", +PerformanceCollectionSupported = true, +RoleName = "", +StreamId = "41112328328b4edb9aa777aa6d675186", +} + }); + Response response = await client.PublishAsync("4473b98e-c70d-4220-b57c-2984c2a0e5cd", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ETag").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("FilterGroups")[0].GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Projection").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("Aggregation").ToString()); + Console.WriteLine(result.GetProperty("Metrics")[0].GetProperty("BackEndAggregation").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("Id").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("TelemetryType").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("FieldName").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Predicate").ToString()); + Console.WriteLine(result.GetProperty("DocumentStreams")[0].GetProperty("DocumentFilterGroups")[0].GetProperty("Filters").GetProperty("Filters")[0].GetProperty("Comparand").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_LiveMetrics_Publish_LiveMetricsClientPublishesLiveMetrics_Convenience() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + Response response = client.Publish("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_LiveMetrics_Publish_LiveMetricsClientPublishesLiveMetrics_Convenience_Async() + { + TokenCredential credential = new DefaultAzureCredential(); + LiveMetricsClient client = new LiveMetricsClient(credential); + + Response response = await client.PublishAsync("4473b98e-c70d-4220-b57c-2984c2a0e5cd"); + } + } +} diff --git a/sdk/applicationinsights/LiveMetrics/tests/LiveMetrics.Tests.csproj b/sdk/applicationinsights/LiveMetrics/tests/LiveMetrics.Tests.csproj new file mode 100644 index 000000000000..56fe204affe9 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/tests/LiveMetrics.Tests.csproj @@ -0,0 +1,19 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + diff --git a/sdk/applicationinsights/LiveMetrics/tsp-location.yaml b/sdk/applicationinsights/LiveMetrics/tsp-location.yaml new file mode 100644 index 000000000000..bc3d18bda7b7 --- /dev/null +++ b/sdk/applicationinsights/LiveMetrics/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/applicationinsights/ApplicationInsights.LiveMetrics +commit: c537a4e6cc3ed95c030b2c10671d1f0585ddcc08 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml index e015a1e38304..fc8b6fa01fe6 100644 --- a/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml +++ b/sdk/confidentialledger/Azure.Security.CodeTransparency/tsp-location.yaml @@ -1,3 +1,4 @@ -commit: 72a8e363d667f0681fc3c63f3b6422d1063a2f19 -repo: Azure/azure-rest-api-specs directory: specification/confidentialledger/Microsoft.CodeTransparency +commit: c537a4e6cc3ed95c030b2c10671d1f0585ddcc08 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/Microsoft.App.DynamicSessions.sln b/sdk/microsoft.app/Microsoft.App.DynamicSessions/Microsoft.App.DynamicSessions.sln new file mode 100644 index 000000000000..1e89be24951a --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/Microsoft.App.DynamicSessions.sln @@ -0,0 +1,50 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.App.DynamicSessions", "src\Microsoft.App.DynamicSessions.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.App.DynamicSessions.Tests", "tests\Microsoft.App.DynamicSessions.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeExecution.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeExecution.cs new file mode 100644 index 000000000000..1ad451e837bc --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeExecution.cs @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.App.DynamicSessions +{ + // Data plane generated sub-client. + /// The CodeExecution sub-client. + public partial class CodeExecution + { + private static readonly string[] AuthorizationScopes = new string[] { "https://dynamicsessions.io/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of CodeExecution for mocking. + protected CodeExecution() + { + } + + /// Initializes a new instance of CodeExecution. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// The management endpoint of the session pool. + /// The API version to use for this operation. + internal CodeExecution(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Get the code execution result. + /// Session code execution id. + /// The user-assigned identifier of the session. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSessionCodeExecutionResourceAsync(string executionId, string identifier, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSessionCodeExecutionResourceAsync(executionId, identifier, context).ConfigureAwait(false); + return Response.FromValue(SessionCodeExecutionResource.FromResponse(response), response); + } + + /// Get the code execution result. + /// Session code execution id. + /// The user-assigned identifier of the session. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSessionCodeExecutionResource(string executionId, string identifier, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSessionCodeExecutionResource(executionId, identifier, context); + return Response.FromValue(SessionCodeExecutionResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get the code execution result. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Session code execution id. + /// The user-assigned identifier of the session. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSessionCodeExecutionResourceAsync(string executionId, string identifier, RequestContext context) + { + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("CodeExecution.GetSessionCodeExecutionResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSessionCodeExecutionResourceRequest(executionId, identifier, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get the code execution result. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Session code execution id. + /// The user-assigned identifier of the session. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSessionCodeExecutionResource(string executionId, string identifier, RequestContext context) + { + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("CodeExecution.GetSessionCodeExecutionResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSessionCodeExecutionResourceRequest(executionId, identifier, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Execute code in a session. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The user-assigned identifier of the session. + /// The request to execute code. + /// The id of this execution operation. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> ExecuteAsync(WaitUntil waitUntil, string identifier, SessionCodeExecutionRequest codeExecutionRequest, string operationId = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(codeExecutionRequest, nameof(codeExecutionRequest)); + + using RequestContent content = codeExecutionRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = await ExecuteAsync(waitUntil, identifier, content, operationId, context).ConfigureAwait(false); + return ProtocolOperationHelpers.Convert(response, FetchSessionCodeExecutionResultFromSessionCodeExecutionResource, ClientDiagnostics, "CodeExecution.Execute"); + } + + /// Execute code in a session. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The user-assigned identifier of the session. + /// The request to execute code. + /// The id of this execution operation. + /// The cancellation token to use. + /// or is null. + /// + public virtual Operation Execute(WaitUntil waitUntil, string identifier, SessionCodeExecutionRequest codeExecutionRequest, string operationId = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(codeExecutionRequest, nameof(codeExecutionRequest)); + + using RequestContent content = codeExecutionRequest.ToRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Operation response = Execute(waitUntil, identifier, content, operationId, context); + return ProtocolOperationHelpers.Convert(response, FetchSessionCodeExecutionResultFromSessionCodeExecutionResource, ClientDiagnostics, "CodeExecution.Execute"); + } + + /// + /// [Protocol Method] Execute code in a session. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The user-assigned identifier of the session. + /// The content to send as the body of the request. + /// The id of this execution operation. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual async Task> ExecuteAsync(WaitUntil waitUntil, string identifier, RequestContent content, string operationId = null, RequestContext context = null) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("CodeExecution.Execute"); + scope.Start(); + try + { + using HttpMessage message = CreateExecuteRequest(identifier, content, operationId, context); + return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "CodeExecution.Execute", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Execute code in a session. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The user-assigned identifier of the session. + /// The content to send as the body of the request. + /// The id of this execution operation. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The representing an asynchronous operation on the service. + /// + public virtual Operation Execute(WaitUntil waitUntil, string identifier, RequestContent content, string operationId = null, RequestContext context = null) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("CodeExecution.Execute"); + scope.Start(); + try + { + using HttpMessage message = CreateExecuteRequest(identifier, content, operationId, context); + return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "CodeExecution.Execute", OperationFinalStateVia.OperationLocation, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateExecuteRequest(string identifier, RequestContent content, string operationId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/executions", false); + uri.AppendQuery("identifier", identifier, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (operationId != null) + { + request.Headers.Add("operation-id", operationId); + } + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetSessionCodeExecutionResourceRequest(string executionId, string identifier, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/executions/", false); + uri.AppendPath(executionId, true); + uri.AppendQuery("identifier", identifier, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + + private SessionCodeExecutionResult FetchSessionCodeExecutionResultFromSessionCodeExecutionResource(Response response) + { + var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result"); + return SessionCodeExecutionResult.DeserializeSessionCodeExecutionResult(resultJsonElement); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeInputType.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeInputType.cs new file mode 100644 index 000000000000..6d931a411fcf --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeInputType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.App.DynamicSessions +{ + /// Code input type. + public readonly partial struct CodeInputType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CodeInputType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InlineValue = "Inline"; + private const string InlineBase64Value = "InlineBase64"; + private const string InlineTextValue = "InlineText"; + + /// Inline. + public static CodeInputType Inline { get; } = new CodeInputType(InlineValue); + /// InlineBase64. + public static CodeInputType InlineBase64 { get; } = new CodeInputType(InlineBase64Value); + /// InlineText. + public static CodeInputType InlineText { get; } = new CodeInputType(InlineTextValue); + /// Determines if two values are the same. + public static bool operator ==(CodeInputType left, CodeInputType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CodeInputType left, CodeInputType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CodeInputType(string value) => new CodeInputType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CodeInputType other && Equals(other); + /// + public bool Equals(CodeInputType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/CodeExecution.xml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/CodeExecution.xml new file mode 100644 index 000000000000..1f7cf7d6e2b1 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/CodeExecution.xml @@ -0,0 +1,291 @@ + + + + + +This sample shows how to call GetSessionCodeExecutionResourceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier"); +]]> +This sample shows how to call GetSessionCodeExecutionResourceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier"); +]]> + + + +This sample shows how to call GetSessionCodeExecutionResource. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier"); +]]> +This sample shows how to call GetSessionCodeExecutionResource. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier"); +]]> + + + +This sample shows how to call GetSessionCodeExecutionResourceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("identifier").ToString()); +Console.WriteLine(result.GetProperty("executionType").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSessionCodeExecutionResourceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("identifier").ToString()); +Console.WriteLine(result.GetProperty("executionType").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> + + + +This sample shows how to call GetSessionCodeExecutionResource and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("identifier").ToString()); +Console.WriteLine(result.GetProperty("executionType").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> +This sample shows how to call GetSessionCodeExecutionResource and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("identifier").ToString()); +Console.WriteLine(result.GetProperty("executionType").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +]]> + + + +This sample shows how to call ExecuteAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); +Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); +SessionCodeExecutionResult responseData = operation.Value; +]]> +This sample shows how to call ExecuteAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); +Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); +SessionCodeExecutionResult responseData = operation.Value; +]]> +This sample shows how to call ExecuteAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Synchronous, "print(7*9)", 60L); +Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); +SessionCodeExecutionResult responseData = operation.Value; +]]> + + + +This sample shows how to call Execute. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); +Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); +SessionCodeExecutionResult responseData = operation.Value; +]]> +This sample shows how to call Execute. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); +Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); +SessionCodeExecutionResult responseData = operation.Value; +]]> +This sample shows how to call Execute. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Synchronous, "print(7*9)", 60L); +Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); +SessionCodeExecutionResult responseData = operation.Value; +]]> + + + +This sample shows how to call ExecuteAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = RequestContent.Create(new +{ + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, +}); +Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call ExecuteAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = RequestContent.Create(new +{ + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, +}); +Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call ExecuteAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = RequestContent.Create(new +{ + codeInputType = "Inline", + executionType = "Synchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, +}); +Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call Execute and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = RequestContent.Create(new +{ + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, +}); +Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call Execute and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = RequestContent.Create(new +{ + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, +}); +Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call Execute and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = RequestContent.Create(new +{ + codeInputType = "Inline", + executionType = "Synchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, +}); +Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content); +BinaryData responseData = operation.Value; + +JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + \ No newline at end of file diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionResourceFiles.xml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionResourceFiles.xml new file mode 100644 index 000000000000..b756e760389f --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionResourceFiles.xml @@ -0,0 +1,253 @@ + + + + + +This sample shows how to call GetSessionResourceFileAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetSessionResourceFileAsync("testfile", "testSessionIdentifier"); +]]> + + + +This sample shows how to call GetSessionResourceFile. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetSessionResourceFile("testfile", "testSessionIdentifier"); +]]> + + + +This sample shows how to call GetSessionResourceFileAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetSessionResourceFileAsync("testfile", "testSessionIdentifier", "/", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call GetSessionResourceFile and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetSessionResourceFile("testfile", "testSessionIdentifier", "/", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call DeleteAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.DeleteAsync("testfile", "testSessionIdentifier"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call Delete. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = client.Delete("testfile", "testSessionIdentifier"); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call UploadAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +UploadRequest body = null; +Response response = await client.UploadAsync("testSessionIdentifier", body); +]]> + + + +This sample shows how to call Upload. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +UploadRequest body = null; +Response response = client.Upload("testSessionIdentifier", body); +]]> + + + +This sample shows how to call UploadAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = null; +Response response = await client.UploadAsync("testSessionIdentifier", content, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call Upload and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +using RequestContent content = null; +Response response = client.Upload("testSessionIdentifier", content, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call GetContentAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetContentAsync("testfile", "testSessionIdentifier"); +]]> + + + +This sample shows how to call GetContent. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetContent("testfile", "testSessionIdentifier"); +]]> + + + +This sample shows how to call GetContentAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = await client.GetContentAsync("testfile", "testSessionIdentifier", "/", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetContent and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +Response response = client.GetContent("testfile", "testSessionIdentifier", "/", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetSessionResourceFilesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +await foreach (SessionResourceFile item in client.GetSessionResourceFilesAsync("testSessionIdentifier")) +{ +} +]]> + + + +This sample shows how to call GetSessionResourceFiles. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +foreach (SessionResourceFile item in client.GetSessionResourceFiles("testSessionIdentifier")) +{ +} +]]> + + + +This sample shows how to call GetSessionResourceFilesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +await foreach (BinaryData item in client.GetSessionResourceFilesAsync("testSessionIdentifier", "/", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); +} +]]> + + + +This sample shows how to call GetSessionResourceFiles and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + +foreach (BinaryData item in client.GetSessionResourceFiles("testSessionIdentifier", "/", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClient.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClient.cs new file mode 100644 index 000000000000..c6ea990624a9 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClient.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.App.DynamicSessions +{ + // Data plane generated client. + /// The DynamicSessions service client. + public partial class DynamicSessionsClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://dynamicsessions.io/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of DynamicSessionsClient for mocking. + protected DynamicSessionsClient() + { + } + + /// Initializes a new instance of DynamicSessionsClient. + /// The management endpoint of the session pool. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public DynamicSessionsClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new DynamicSessionsClientOptions()) + { + } + + /// Initializes a new instance of DynamicSessionsClient. + /// The management endpoint of the session pool. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public DynamicSessionsClient(Uri endpoint, TokenCredential credential, DynamicSessionsClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new DynamicSessionsClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of CodeExecution. + /// The API version to use for this operation. + /// is null. + public virtual CodeExecution GetCodeExecutionClient(string apiVersion = "2024-10-02-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new CodeExecution(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of SessionResourceFiles. + /// The API version to use for this operation. + /// is null. + public virtual SessionResourceFiles GetSessionResourceFilesClient(string apiVersion = "2024-10-02-preview") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new SessionResourceFiles(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClientOptions.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClientOptions.cs new file mode 100644 index 000000000000..31ad50ae5345 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + /// Client options for DynamicSessionsClient. + public partial class DynamicSessionsClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_02_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2024-10-02-preview". + V2024_10_02_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of DynamicSessionsClientOptions. + public DynamicSessionsClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2024_10_02_Preview => "2024-10-02-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.Serialization.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.Serialization.cs new file mode 100644 index 000000000000..8bb9ae55203a --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + public partial class ErrorResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorResponse)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorResponse(document.RootElement, options); + } + + internal static ErrorResponse DeserializeErrorResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorResponse(error, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, MicrosoftAppDynamicSessionsContext.Default); + default: + throw new FormatException($"The model {nameof(ErrorResponse)} does not support writing '{options.Format}' format."); + } + } + + ErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeErrorResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ErrorResponse FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeErrorResponse(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.cs new file mode 100644 index 000000000000..365411fe4646 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Microsoft.App.DynamicSessions +{ + /// A response containing error details. + public partial class ErrorResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The error object. + /// is null. + internal ErrorResponse(ResponseError error) + { + Argument.AssertNotNull(error, nameof(error)); + + Error = error; + } + + /// Initializes a new instance of . + /// The error object. + /// Keeps track of any properties unknown to the library. + internal ErrorResponse(ResponseError error, IDictionary serializedAdditionalRawData) + { + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ErrorResponse() + { + } + + /// The error object. + public ResponseError Error { get; } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ExecutionType.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ExecutionType.cs new file mode 100644 index 000000000000..8a5b0220c472 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ExecutionType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.App.DynamicSessions +{ + /// Execution Type. + public readonly partial struct ExecutionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExecutionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SynchronousValue = "Synchronous"; + private const string AsynchronousValue = "Asynchronous"; + + /// Synchronous. + public static ExecutionType Synchronous { get; } = new ExecutionType(SynchronousValue); + /// Asynchronous. + public static ExecutionType Asynchronous { get; } = new ExecutionType(AsynchronousValue); + /// Determines if two values are the same. + public static bool operator ==(ExecutionType left, ExecutionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExecutionType left, ExecutionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExecutionType(string value) => new ExecutionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExecutionType other && Equals(other); + /// + public bool Equals(ExecutionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Argument.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..b29962ac493f --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.App.DynamicSessions +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..2f625026ca9e --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.App.DynamicSessions +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingList.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..d9cfe9c47a7f --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.App.DynamicSessions +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..bfaa03837995 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/MultipartFormDataRequestContent.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/MultipartFormDataRequestContent.cs new file mode 100644 index 000000000000..e644801a470a --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/MultipartFormDataRequestContent.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.IO; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.App.DynamicSessions +{ + internal class MultipartFormDataRequestContent : RequestContent + { + private readonly System.Net.Http.MultipartFormDataContent _multipartContent; + private static readonly Random _random = new Random(); + private static readonly char[] _boundaryValues = "0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".ToCharArray(); + + public MultipartFormDataRequestContent() + { + _multipartContent = new System.Net.Http.MultipartFormDataContent(CreateBoundary()); + } + + public string ContentType + { + get + { + return _multipartContent.Headers.ContentType.ToString(); + } + } + + internal HttpContent HttpContent => _multipartContent; + + private static string CreateBoundary() + { + Span chars = new char[70]; + byte[] random = new byte[70]; + _random.NextBytes(random); + int mask = 255 >> 2; + for (int i = 0; i < 70; i++) + { + chars[i] = _boundaryValues[random[i] & mask]; + } + return chars.ToString(); + } + + public void Add(string content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new StringContent(content), name, filename, contentType); + } + + public void Add(int content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(long content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(float content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(double content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(decimal content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(bool content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content ? "true" : "false"; + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(Stream content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new StreamContent(content), name, filename, contentType); + } + + public void Add(byte[] content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new ByteArrayContent(content), name, filename, contentType); + } + + public void Add(BinaryData content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new ByteArrayContent(content.ToArray()), name, filename, contentType); + } + + private void Add(HttpContent content, string name, string filename, string contentType) + { + if (filename != null) + { + Argument.AssertNotNullOrEmpty(filename, nameof(filename)); + AddFilenameHeader(content, name, filename); + } + if (contentType != null) + { + Argument.AssertNotNullOrEmpty(contentType, nameof(contentType)); + AddContentTypeHeader(content, contentType); + } + _multipartContent.Add(content, name); + } + + public static void AddFilenameHeader(HttpContent content, string name, string filename) + { + ContentDispositionHeaderValue header = new ContentDispositionHeaderValue("form-data") { Name = name, FileName = filename }; + content.Headers.ContentDisposition = header; + } + + public static void AddContentTypeHeader(HttpContent content, string contentType) + { + MediaTypeHeaderValue header = new MediaTypeHeaderValue(contentType); + content.Headers.ContentType = header; + } + + public override bool TryComputeLength(out long length) + { + if (_multipartContent.Headers.ContentLength is long contentLength) + { + length = contentLength; + return true; + } + length = 0; + return false; + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { +#if NET6_0_OR_GREATER + _multipartContent.CopyTo(stream, default, cancellationToken); +#else +#pragma warning disable AZC0107 + _multipartContent.CopyToAsync(stream).EnsureCompleted(); +#pragma warning restore AZC0107 +#endif + } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { +#if NET6_0_OR_GREATER + await _multipartContent.CopyToAsync(stream, cancellationToken).ConfigureAwait(false); +#else + await _multipartContent.CopyToAsync(stream).ConfigureAwait(false); +#endif + } + + public override void Dispose() + { + _multipartContent.Dispose(); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Optional.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..e39a6bf9bdee --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Microsoft.App.DynamicSessions +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..fa00656bf0f9 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsClientBuilderExtensions.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsClientBuilderExtensions.cs new file mode 100644 index 000000000000..7ef784e1b0cb --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsClientBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; +using Microsoft.App.DynamicSessions; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class MicrosoftAppDynamicSessionsClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The management endpoint of the session pool. + public static IAzureClientBuilder AddDynamicSessionsClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new DynamicSessionsClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddDynamicSessionsClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsModelFactory.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsModelFactory.cs new file mode 100644 index 000000000000..31c82261fe9a --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/MicrosoftAppDynamicSessionsModelFactory.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; + +namespace Microsoft.App.DynamicSessions +{ + /// Model factory for models. + public static partial class MicrosoftAppDynamicSessionsModelFactory + { + /// Initializes a new instance of . + /// Session code execution id. + /// The identifier of the session. + /// The execution type of the code execution request. + /// The status of the code execution operation, indicates whether succeeded or not. + /// The error of this code execution if failed. + /// The result of this code execution operation. + /// A new instance for mocking. + public static SessionCodeExecutionResource SessionCodeExecutionResource(string id = null, string identifier = null, ExecutionType executionType = default, OperationState status = default, ErrorResponse error = null, SessionCodeExecutionResult result = null) + { + return new SessionCodeExecutionResource( + id, + identifier, + executionType, + status, + error, + result, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error object. + /// A new instance for mocking. + public static ErrorResponse ErrorResponse(ResponseError error = null) + { + return new ErrorResponse(error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The standard output of the code execution. + /// The standard error of the code execution. + /// The result of the code execution. The type of this field is same as the type of actual result of the code execution after being Json serialized. + /// The execution time of the code in milliseconds. + /// A new instance for mocking. + public static SessionCodeExecutionResult SessionCodeExecutionResult(string stdout = null, string stderr = null, BinaryData executionResult = null, long? executionTimeInMilliseconds = null) + { + return new SessionCodeExecutionResult(stdout, stderr, executionResult, executionTimeInMilliseconds, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the file. + /// The type of the session resource file. + /// The type of the content of this file. + /// The size of the file. + /// The date time in RFC3339 format when the file was last modified. + /// A new instance for mocking. + public static SessionResourceFile SessionResourceFile(string name = null, string type = null, string contentType = null, long? sizeInBytes = null, DateTimeOffset lastModifiedAt = default) + { + return new SessionResourceFile( + name, + type, + contentType, + sizeInBytes, + lastModifiedAt, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Models/MicrosoftAppDynamicSessionsContext.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Models/MicrosoftAppDynamicSessionsContext.cs new file mode 100644 index 000000000000..88c1b45bbcee --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Models/MicrosoftAppDynamicSessionsContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Microsoft.App.DynamicSessions +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// + public partial class MicrosoftAppDynamicSessionsContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/OperationState.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/OperationState.cs new file mode 100644 index 000000000000..d2bcf46d8694 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/OperationState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Microsoft.App.DynamicSessions +{ + /// Enum describing allowed operation states. + public readonly partial struct OperationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OperationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RunningValue = "Running"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// The operation has not started. + public static OperationState NotStarted { get; } = new OperationState(NotStartedValue); + /// The operation is in progress. + public static OperationState Running { get; } = new OperationState(RunningValue); + /// The operation has completed successfully. + public static OperationState Succeeded { get; } = new OperationState(SucceededValue); + /// The operation has failed. + public static OperationState Failed { get; } = new OperationState(FailedValue); + /// The operation has been canceled by the user. + public static OperationState Canceled { get; } = new OperationState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(OperationState left, OperationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperationState left, OperationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OperationState(string value) => new OperationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperationState other && Equals(other); + /// + public bool Equals(OperationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.Serialization.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.Serialization.cs new file mode 100644 index 000000000000..72aed7aff2b8 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + public partial class SessionCodeExecutionRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionCodeExecutionRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("codeInputType"u8); + writer.WriteStringValue(CodeInputType.ToString()); + writer.WritePropertyName("executionType"u8); + writer.WriteStringValue(ExecutionType.ToString()); + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + writer.WritePropertyName("timeoutInSeconds"u8); + writer.WriteNumberValue(TimeoutInSeconds); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionCodeExecutionRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionCodeExecutionRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionCodeExecutionRequest(document.RootElement, options); + } + + internal static SessionCodeExecutionRequest DeserializeSessionCodeExecutionRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CodeInputType codeInputType = default; + ExecutionType executionType = default; + string code = default; + long timeoutInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("codeInputType"u8)) + { + codeInputType = new CodeInputType(property.Value.GetString()); + continue; + } + if (property.NameEquals("executionType"u8)) + { + executionType = new ExecutionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeoutInSeconds"u8)) + { + timeoutInSeconds = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionCodeExecutionRequest(codeInputType, executionType, code, timeoutInSeconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, MicrosoftAppDynamicSessionsContext.Default); + default: + throw new FormatException($"The model {nameof(SessionCodeExecutionRequest)} does not support writing '{options.Format}' format."); + } + } + + SessionCodeExecutionRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionCodeExecutionRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionCodeExecutionRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SessionCodeExecutionRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionCodeExecutionRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.cs new file mode 100644 index 000000000000..b6197c19e287 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionRequest.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.App.DynamicSessions +{ + /// The request to execute code. + public partial class SessionCodeExecutionRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The code input type of the code execution request. + /// The execution type of the code execution request. + /// The string of the code to execute, based on CodeInputType. + /// Code execution timeout in seconds. + /// is null. + public SessionCodeExecutionRequest(CodeInputType codeInputType, ExecutionType executionType, string code, long timeoutInSeconds) + { + Argument.AssertNotNull(code, nameof(code)); + + CodeInputType = codeInputType; + ExecutionType = executionType; + Code = code; + TimeoutInSeconds = timeoutInSeconds; + } + + /// Initializes a new instance of . + /// The code input type of the code execution request. + /// The execution type of the code execution request. + /// The string of the code to execute, based on CodeInputType. + /// Code execution timeout in seconds. + /// Keeps track of any properties unknown to the library. + internal SessionCodeExecutionRequest(CodeInputType codeInputType, ExecutionType executionType, string code, long timeoutInSeconds, IDictionary serializedAdditionalRawData) + { + CodeInputType = codeInputType; + ExecutionType = executionType; + Code = code; + TimeoutInSeconds = timeoutInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionCodeExecutionRequest() + { + } + + /// The code input type of the code execution request. + public CodeInputType CodeInputType { get; } + /// The execution type of the code execution request. + public ExecutionType ExecutionType { get; } + /// The string of the code to execute, based on CodeInputType. + public string Code { get; } + /// Code execution timeout in seconds. + public long TimeoutInSeconds { get; } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.Serialization.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.Serialization.cs new file mode 100644 index 000000000000..b079aad47923 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + public partial class SessionCodeExecutionResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionCodeExecutionResource)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + writer.WritePropertyName("identifier"u8); + writer.WriteStringValue(Identifier); + writer.WritePropertyName("executionType"u8); + writer.WriteStringValue(ExecutionType.ToString()); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, options); + } + if (Optional.IsDefined(Result)) + { + writer.WritePropertyName("result"u8); + writer.WriteObjectValue(Result, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionCodeExecutionResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionCodeExecutionResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionCodeExecutionResource(document.RootElement, options); + } + + internal static SessionCodeExecutionResource DeserializeSessionCodeExecutionResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string identifier = default; + ExecutionType executionType = default; + OperationState status = default; + ErrorResponse error = default; + SessionCodeExecutionResult result = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("identifier"u8)) + { + identifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("executionType"u8)) + { + executionType = new ExecutionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new OperationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ErrorResponse.DeserializeErrorResponse(property.Value, options); + continue; + } + if (property.NameEquals("result"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + result = SessionCodeExecutionResult.DeserializeSessionCodeExecutionResult(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionCodeExecutionResource( + id, + identifier, + executionType, + status, + error, + result, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, MicrosoftAppDynamicSessionsContext.Default); + default: + throw new FormatException($"The model {nameof(SessionCodeExecutionResource)} does not support writing '{options.Format}' format."); + } + } + + SessionCodeExecutionResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionCodeExecutionResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionCodeExecutionResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SessionCodeExecutionResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionCodeExecutionResource(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.cs new file mode 100644 index 000000000000..78ed209c1e62 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResource.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.App.DynamicSessions +{ + /// The session code execution resource. + public partial class SessionCodeExecutionResource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The identifier of the session. + /// The execution type of the code execution request. + /// The status of the code execution operation, indicates whether succeeded or not. + /// is null. + internal SessionCodeExecutionResource(string identifier, ExecutionType executionType, OperationState status) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + + Identifier = identifier; + ExecutionType = executionType; + Status = status; + } + + /// Initializes a new instance of . + /// Session code execution id. + /// The identifier of the session. + /// The execution type of the code execution request. + /// The status of the code execution operation, indicates whether succeeded or not. + /// The error of this code execution if failed. + /// The result of this code execution operation. + /// Keeps track of any properties unknown to the library. + internal SessionCodeExecutionResource(string id, string identifier, ExecutionType executionType, OperationState status, ErrorResponse error, SessionCodeExecutionResult result, IDictionary serializedAdditionalRawData) + { + Id = id; + Identifier = identifier; + ExecutionType = executionType; + Status = status; + Error = error; + Result = result; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionCodeExecutionResource() + { + } + + /// Session code execution id. + public string Id { get; } + /// The identifier of the session. + public string Identifier { get; } + /// The execution type of the code execution request. + public ExecutionType ExecutionType { get; } + /// The status of the code execution operation, indicates whether succeeded or not. + public OperationState Status { get; } + /// The error of this code execution if failed. + public ErrorResponse Error { get; } + /// The result of this code execution operation. + public SessionCodeExecutionResult Result { get; } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.Serialization.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.Serialization.cs new file mode 100644 index 000000000000..22e9c70f0758 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + public partial class SessionCodeExecutionResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionCodeExecutionResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Stdout)) + { + writer.WritePropertyName("stdout"u8); + writer.WriteStringValue(Stdout); + } + if (Optional.IsDefined(Stderr)) + { + writer.WritePropertyName("stderr"u8); + writer.WriteStringValue(Stderr); + } + if (Optional.IsDefined(ExecutionResult)) + { + writer.WritePropertyName("executionResult"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(ExecutionResult); +#else + using (JsonDocument document = JsonDocument.Parse(ExecutionResult, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(ExecutionTimeInMilliseconds)) + { + writer.WritePropertyName("executionTimeInMilliseconds"u8); + writer.WriteNumberValue(ExecutionTimeInMilliseconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionCodeExecutionResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionCodeExecutionResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionCodeExecutionResult(document.RootElement, options); + } + + internal static SessionCodeExecutionResult DeserializeSessionCodeExecutionResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string stdout = default; + string stderr = default; + BinaryData executionResult = default; + long? executionTimeInMilliseconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("stdout"u8)) + { + stdout = property.Value.GetString(); + continue; + } + if (property.NameEquals("stderr"u8)) + { + stderr = property.Value.GetString(); + continue; + } + if (property.NameEquals("executionResult"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionResult = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("executionTimeInMilliseconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionTimeInMilliseconds = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionCodeExecutionResult(stdout, stderr, executionResult, executionTimeInMilliseconds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, MicrosoftAppDynamicSessionsContext.Default); + default: + throw new FormatException($"The model {nameof(SessionCodeExecutionResult)} does not support writing '{options.Format}' format."); + } + } + + SessionCodeExecutionResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionCodeExecutionResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionCodeExecutionResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SessionCodeExecutionResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionCodeExecutionResult(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.cs new file mode 100644 index 000000000000..56244e575e1d --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionCodeExecutionResult.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.App.DynamicSessions +{ + /// The result of the code execution. + public partial class SessionCodeExecutionResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SessionCodeExecutionResult() + { + } + + /// Initializes a new instance of . + /// The standard output of the code execution. + /// The standard error of the code execution. + /// The result of the code execution. The type of this field is same as the type of actual result of the code execution after being Json serialized. + /// The execution time of the code in milliseconds. + /// Keeps track of any properties unknown to the library. + internal SessionCodeExecutionResult(string stdout, string stderr, BinaryData executionResult, long? executionTimeInMilliseconds, IDictionary serializedAdditionalRawData) + { + Stdout = stdout; + Stderr = stderr; + ExecutionResult = executionResult; + ExecutionTimeInMilliseconds = executionTimeInMilliseconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The standard output of the code execution. + public string Stdout { get; } + /// The standard error of the code execution. + public string Stderr { get; } + /// + /// The result of the code execution. The type of this field is same as the type of actual result of the code execution after being Json serialized. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData ExecutionResult { get; } + /// The execution time of the code in milliseconds. + public long? ExecutionTimeInMilliseconds { get; } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.Serialization.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.Serialization.cs new file mode 100644 index 000000000000..8e663679522c --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.Serialization.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + public partial class SessionResourceFile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionResourceFile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + if (Optional.IsDefined(ContentType)) + { + writer.WritePropertyName("contentType"u8); + writer.WriteStringValue(ContentType); + } + if (Optional.IsDefined(SizeInBytes)) + { + writer.WritePropertyName("sizeInBytes"u8); + writer.WriteNumberValue(SizeInBytes.Value); + } + writer.WritePropertyName("lastModifiedAt"u8); + writer.WriteStringValue(LastModifiedAt, "O"); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionResourceFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionResourceFile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionResourceFile(document.RootElement, options); + } + + internal static SessionResourceFile DeserializeSessionResourceFile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string type = default; + string contentType = default; + long? sizeInBytes = default; + DateTimeOffset lastModifiedAt = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("contentType"u8)) + { + contentType = property.Value.GetString(); + continue; + } + if (property.NameEquals("sizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizeInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lastModifiedAt"u8)) + { + lastModifiedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionResourceFile( + name, + type, + contentType, + sizeInBytes, + lastModifiedAt, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, MicrosoftAppDynamicSessionsContext.Default); + default: + throw new FormatException($"The model {nameof(SessionResourceFile)} does not support writing '{options.Format}' format."); + } + } + + SessionResourceFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionResourceFile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionResourceFile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SessionResourceFile FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionResourceFile(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.cs new file mode 100644 index 000000000000..5438b780714c --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFile.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Microsoft.App.DynamicSessions +{ + /// Code execution file resource. + public partial class SessionResourceFile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the file. + /// The type of the session resource file. + /// The date time in RFC3339 format when the file was last modified. + /// or is null. + internal SessionResourceFile(string name, string type, DateTimeOffset lastModifiedAt) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(type, nameof(type)); + + Name = name; + Type = type; + LastModifiedAt = lastModifiedAt; + } + + /// Initializes a new instance of . + /// The name of the file. + /// The type of the session resource file. + /// The type of the content of this file. + /// The size of the file. + /// The date time in RFC3339 format when the file was last modified. + /// Keeps track of any properties unknown to the library. + internal SessionResourceFile(string name, string type, string contentType, long? sizeInBytes, DateTimeOffset lastModifiedAt, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + ContentType = contentType; + SizeInBytes = sizeInBytes; + LastModifiedAt = lastModifiedAt; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionResourceFile() + { + } + + /// The name of the file. + public string Name { get; } + /// The type of the session resource file. + public string Type { get; } + /// The type of the content of this file. + public string ContentType { get; } + /// The size of the file. + public long? SizeInBytes { get; } + /// The date time in RFC3339 format when the file was last modified. + public DateTimeOffset LastModifiedAt { get; } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFiles.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFiles.cs new file mode 100644 index 000000000000..d8e594dd3af7 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/SessionResourceFiles.cs @@ -0,0 +1,722 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Microsoft.App.DynamicSessions +{ + // Data plane generated sub-client. + /// The SessionResourceFiles sub-client. + public partial class SessionResourceFiles + { + private static readonly string[] AuthorizationScopes = new string[] { "https://dynamicsessions.io/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of SessionResourceFiles for mocking. + protected SessionResourceFiles() + { + } + + /// Initializes a new instance of SessionResourceFiles. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// The management endpoint of the session pool. + /// The API version to use for this operation. + internal SessionResourceFiles(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// Get the file resource. + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSessionResourceFileAsync(string name, string identifier, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSessionResourceFileAsync(name, identifier, path, context).ConfigureAwait(false); + return Response.FromValue(SessionResourceFile.FromResponse(response), response); + } + + /// Get the file resource. + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSessionResourceFile(string name, string identifier, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSessionResourceFile(name, identifier, path, context); + return Response.FromValue(SessionResourceFile.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get the file resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSessionResourceFileAsync(string name, string identifier, string path, RequestContext context) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.GetSessionResourceFile"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSessionResourceFileRequest(name, identifier, path, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get the file resource. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSessionResourceFile(string name, string identifier, string path, RequestContext context) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.GetSessionResourceFile"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSessionResourceFileRequest(name, identifier, path, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete the file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteAsync(string name, string identifier, string path = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(name, identifier, path, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete the file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Delete(string name, string identifier, string path = null, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.Delete"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteRequest(name, identifier, path, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Upload a file to a session. + /// The user-assigned identifier of the session. + /// Multipart body. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> UploadAsync(string identifier, UploadRequest body, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await UploadAsync(identifier, content, content.ContentType, path, context).ConfigureAwait(false); + return Response.FromValue(SessionResourceFile.FromResponse(response), response); + } + + /// Upload a file to a session. + /// The user-assigned identifier of the session. + /// Multipart body. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response Upload(string identifier, UploadRequest body, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(body, nameof(body)); + + using MultipartFormDataRequestContent content = body.ToMultipartRequestContent(); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = Upload(identifier, content, content.ContentType, path, context); + return Response.FromValue(SessionResourceFile.FromResponse(response), response); + } + + /// + /// [Protocol Method] Upload a file to a session. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The user-assigned identifier of the session. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UploadAsync(string identifier, RequestContent content, string contentType, string path = null, RequestContext context = null) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.Upload"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadRequest(identifier, content, contentType, path, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Upload a file to a session. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The user-assigned identifier of the session. + /// The content to send as the body of the request. + /// The content type for the operation. Always multipart/form-data for this operation. Allowed values: "multipart/form-data". + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response Upload(string identifier, RequestContent content, string contentType, string path = null, RequestContext context = null) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.Upload"); + scope.Start(); + try + { + using HttpMessage message = CreateUploadRequest(identifier, content, contentType, path, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get the content of the file. + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetContentAsync(string name, string identifier, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetContentAsync(name, identifier, path, context).ConfigureAwait(false); + return Response.FromValue(response.Content, response); + } + + /// Get the content of the file. + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetContent(string name, string identifier, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetContent(name, identifier, path, context); + return Response.FromValue(response.Content, response); + } + + /// + /// [Protocol Method] Get the content of the file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetContentAsync(string name, string identifier, string path, RequestContext context) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.GetContent"); + scope.Start(); + try + { + using HttpMessage message = CreateGetContentRequest(name, identifier, path, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get the content of the file. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The name of the file. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetContent(string name, string identifier, string path, RequestContext context) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(identifier, nameof(identifier)); + + using var scope = ClientDiagnostics.CreateScope("SessionResourceFiles.GetContent"); + scope.Start(); + try + { + using HttpMessage message = CreateGetContentRequest(name, identifier, path, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// List the file resources. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// is null. + /// + public virtual AsyncPageable GetSessionResourceFilesAsync(string identifier, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSessionResourceFilesRequest(identifier, path, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSessionResourceFilesNextPageRequest(nextLink, identifier, path, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => SessionResourceFile.DeserializeSessionResourceFile(e), ClientDiagnostics, _pipeline, "SessionResourceFiles.GetSessionResourceFiles", "value", "nextLink", context); + } + + /// List the file resources. + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The cancellation token to use. + /// is null. + /// + public virtual Pageable GetSessionResourceFiles(string identifier, string path = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSessionResourceFilesRequest(identifier, path, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSessionResourceFilesNextPageRequest(nextLink, identifier, path, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => SessionResourceFile.DeserializeSessionResourceFile(e), ClientDiagnostics, _pipeline, "SessionResourceFiles.GetSessionResourceFiles", "value", "nextLink", context); + } + + /// + /// [Protocol Method] List the file resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetSessionResourceFilesAsync(string identifier, string path, RequestContext context) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSessionResourceFilesRequest(identifier, path, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSessionResourceFilesNextPageRequest(nextLink, identifier, path, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "SessionResourceFiles.GetSessionResourceFiles", "value", "nextLink", context); + } + + /// + /// [Protocol Method] List the file resources. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The user-assigned identifier of the session. + /// The path of the file after uploaded. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetSessionResourceFiles(string identifier, string path, RequestContext context) + { + Argument.AssertNotNull(identifier, nameof(identifier)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSessionResourceFilesRequest(identifier, path, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSessionResourceFilesNextPageRequest(nextLink, identifier, path, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "SessionResourceFiles.GetSessionResourceFiles", "value", "nextLink", context); + } + + internal HttpMessage CreateGetSessionResourceFilesRequest(string identifier, string path, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/files", false); + uri.AppendQuery("identifier", identifier, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (path != null) + { + uri.AppendQuery("path", path, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSessionResourceFileRequest(string name, string identifier, string path, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/files/", false); + uri.AppendPath(name, true); + uri.AppendQuery("identifier", identifier, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (path != null) + { + uri.AppendQuery("path", path, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateDeleteRequest(string name, string identifier, string path, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/files/", false); + uri.AppendPath(name, true); + uri.AppendQuery("identifier", identifier, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (path != null) + { + uri.AppendQuery("path", path, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateUploadRequest(string identifier, RequestContent content, string contentType, string path, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/files", false); + uri.AppendQuery("identifier", identifier, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (path != null) + { + uri.AppendQuery("path", path, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", contentType); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetContentRequest(string name, string identifier, string path, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/files/", false); + uri.AppendPath(name, true); + uri.AppendPath("/content", false); + uri.AppendQuery("identifier", identifier, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (path != null) + { + uri.AppendQuery("path", path, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/octet-stream"); + return message; + } + + internal HttpMessage CreateGetSessionResourceFilesNextPageRequest(string nextLink, string identifier, string path, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.Serialization.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.Serialization.cs new file mode 100644 index 000000000000..7f8e590b1210 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Microsoft.App.DynamicSessions +{ + public partial class UploadRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("file"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(global::System.BinaryData.FromStream(File)); +#else + using (JsonDocument document = JsonDocument.Parse(BinaryData.FromStream(File), ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UploadRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUploadRequest(document.RootElement, options); + } + + internal static UploadRequest DeserializeUploadRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Stream file = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("file"u8)) + { + file = BinaryData.FromString(property.Value.GetRawText()).ToStream(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UploadRequest(file, serializedAdditionalRawData); + } + + private BinaryData SerializeMultipart(ModelReaderWriterOptions options) + { + using MultipartFormDataRequestContent content = ToMultipartRequestContent(); + using MemoryStream stream = new MemoryStream(); + content.WriteTo(stream); + if (stream.Position > int.MaxValue) + { + return BinaryData.FromStream(stream); + } + else + { + return new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position)); + } + } + + internal virtual MultipartFormDataRequestContent ToMultipartRequestContent() + { + MultipartFormDataRequestContent content = new MultipartFormDataRequestContent(); + content.Add(File, "file", "file", "application/octet-stream"); + return content; + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, MicrosoftAppDynamicSessionsContext.Default); + case "MFD": + return SerializeMultipart(options); + default: + throw new FormatException($"The model {nameof(UploadRequest)} does not support writing '{options.Format}' format."); + } + } + + UploadRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUploadRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UploadRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "MFD"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UploadRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUploadRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.cs new file mode 100644 index 000000000000..e4101c59cecf --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/UploadRequest.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.App.DynamicSessions +{ + /// The UploadRequest. + public partial class UploadRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The file to upload. + /// is null. + public UploadRequest(Stream file) + { + Argument.AssertNotNull(file, nameof(file)); + + File = file; + } + + /// Initializes a new instance of . + /// The file to upload. + /// Keeps track of any properties unknown to the library. + internal UploadRequest(Stream file, IDictionary serializedAdditionalRawData) + { + File = file; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UploadRequest() + { + } + + /// The file to upload. + public Stream File { get; } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Microsoft.App.DynamicSessions.csproj b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Microsoft.App.DynamicSessions.csproj new file mode 100644 index 000000000000..66908b681557 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Microsoft.App.DynamicSessions.csproj @@ -0,0 +1,19 @@ + + + This is the Microsoft.App.DynamicSessions client library for developing .NET applications with rich experience. + Azure SDK Code Generation Microsoft.App.DynamicSessions for Azure Data Plane + 1.0.0-beta.1 + Microsoft.App.DynamicSessions + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Properties/AssemblyInfo.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..30c11b3b63b9 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.App.DynamicSessions.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_CodeExecution.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_CodeExecution.cs new file mode 100644 index 000000000000..8e0115b4ae8f --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_CodeExecution.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.App.DynamicSessions.Samples +{ + public partial class Samples_CodeExecution + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetCompleted() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("identifier").ToString()); + Console.WriteLine(result.GetProperty("executionType").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetCompleted_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("identifier").ToString()); + Console.WriteLine(result.GetProperty("executionType").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetCompleted_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetCompleted_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetRunning() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("identifier").ToString()); + Console.WriteLine(result.GetProperty("executionType").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetRunning_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("identifier").ToString()); + Console.WriteLine(result.GetProperty("executionType").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetRunning_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionCodeExecutionResource_GetSessionCodeExecutionResource_CodeExecutionGetRunning_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CodeExecution_Execute_CodeExecutionExecuteAsyncCompleted() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = RequestContent.Create(new + { + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, + }); + Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CodeExecution_Execute_CodeExecutionExecuteAsyncCompleted_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = RequestContent.Create(new + { + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, + }); + Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CodeExecution_Execute_CodeExecutionExecuteAsyncCompleted_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); + Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); + SessionCodeExecutionResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CodeExecution_Execute_CodeExecutionExecuteAsyncCompleted_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); + Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); + SessionCodeExecutionResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CodeExecution_Execute_CodeExecutionExecuteAsyncRunning() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = RequestContent.Create(new + { + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, + }); + Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CodeExecution_Execute_CodeExecutionExecuteAsyncRunning_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = RequestContent.Create(new + { + codeInputType = "Inline", + executionType = "Asynchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, + }); + Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CodeExecution_Execute_CodeExecutionExecuteAsyncRunning_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); + Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); + SessionCodeExecutionResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CodeExecution_Execute_CodeExecutionExecuteAsyncRunning_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L); + Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); + SessionCodeExecutionResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CodeExecution_Execute_CodeExecutionExecuteSync() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = RequestContent.Create(new + { + codeInputType = "Inline", + executionType = "Synchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, + }); + Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CodeExecution_Execute_CodeExecutionExecuteSync_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = RequestContent.Create(new + { + codeInputType = "Inline", + executionType = "Synchronous", + code = "print(7*9)", + timeoutInSeconds = 60L, + }); + Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content); + BinaryData responseData = operation.Value; + + JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CodeExecution_Execute_CodeExecutionExecuteSync_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Synchronous, "print(7*9)", 60L); + Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); + SessionCodeExecutionResult responseData = operation.Value; + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_CodeExecution_Execute_CodeExecutionExecuteSync_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview"); + + SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Synchronous, "print(7*9)", 60L); + Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest); + SessionCodeExecutionResult responseData = operation.Value; + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_SessionResourceFiles.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_SessionResourceFiles.cs new file mode 100644 index 000000000000..f1aa68e5c63d --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Generated/Samples/Samples_SessionResourceFiles.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Microsoft.App.DynamicSessions.Samples +{ + public partial class Samples_SessionResourceFiles + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFile_GetSessionResourceFile_SessionResourceFilesGet() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetSessionResourceFile("testfile", "testSessionIdentifier", "/", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFile_GetSessionResourceFile_SessionResourceFilesGet_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetSessionResourceFileAsync("testfile", "testSessionIdentifier", "/", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFile_GetSessionResourceFile_SessionResourceFilesGet_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetSessionResourceFile("testfile", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFile_GetSessionResourceFile_SessionResourceFilesGet_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetSessionResourceFileAsync("testfile", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFile_Delete_SessionResourceFilesDelete() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = client.Delete("testfile", "testSessionIdentifier"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFile_Delete_SessionResourceFilesDelete_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.DeleteAsync("testfile", "testSessionIdentifier"); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFiles_Upload_SessionResourceFilesUpload() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = null; + Response response = client.Upload("testSessionIdentifier", content, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFiles_Upload_SessionResourceFilesUpload_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + using RequestContent content = null; + Response response = await client.UploadAsync("testSessionIdentifier", content, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFiles_Upload_SessionResourceFilesUpload_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + UploadRequest body = null; + Response response = client.Upload("testSessionIdentifier", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFiles_Upload_SessionResourceFilesUpload_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + UploadRequest body = null; + Response response = await client.UploadAsync("testSessionIdentifier", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFiles_GetContent_SessionResourceFilesGetContent() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetContent("testfile", "testSessionIdentifier", "/", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFiles_GetContent_SessionResourceFilesGetContent_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetContentAsync("testfile", "testSessionIdentifier", "/", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFiles_GetContent_SessionResourceFilesGetContent_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = client.GetContent("testfile", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFiles_GetContent_SessionResourceFilesGetContent_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + Response response = await client.GetContentAsync("testfile", "testSessionIdentifier"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFile_GetSessionResourceFiles_SessionResourceFilesList() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + foreach (BinaryData item in client.GetSessionResourceFiles("testSessionIdentifier", "/", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFile_GetSessionResourceFiles_SessionResourceFilesList_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + await foreach (BinaryData item in client.GetSessionResourceFilesAsync("testSessionIdentifier", "/", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("lastModifiedAt").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_SessionResourceFile_GetSessionResourceFiles_SessionResourceFilesList_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + foreach (SessionResourceFile item in client.GetSessionResourceFiles("testSessionIdentifier")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_SessionResourceFile_GetSessionResourceFiles_SessionResourceFilesList_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview"); + + await foreach (SessionResourceFile item in client.GetSessionResourceFilesAsync("testSessionIdentifier")) + { + } + } + } +} diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Microsoft.App.DynamicSessions.Tests.csproj b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Microsoft.App.DynamicSessions.Tests.csproj new file mode 100644 index 000000000000..060a1cce65bd --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tests/Microsoft.App.DynamicSessions.Tests.csproj @@ -0,0 +1,19 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/tsp-location.yaml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tsp-location.yaml new file mode 100644 index 000000000000..419960772bb1 --- /dev/null +++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/app/Microsoft.App.DynamicSessions +commit: c537a4e6cc3ed95c030b2c10671d1f0585ddcc08 +repo: Azure/azure-rest-api-specs +additionalDirectories: